from django.urls import path, re_path, include from django.contrib import admin from django.conf.urls.static import static from django.conf import settings from django.contrib.sitemaps.views import sitemap from django.views.generic.base import RedirectView from pages.views import PageDetailView, PageDetailTXTView, HomePageList from locations.models import WritingbyCountrySitemap from photos.models import PhotoGallerySitemap from books.models import BookSitemap from posts.models import PostSitemap from pages.models import PageSitemap import builder.views import utils.views import products.views from locations.views import MapDataList #from income.views import MonthlyInvoiceView, DownloadMonthlyInvoiceView from posts.views import PostRSSFeedView admin.autodiscover() sitemaps = { 'posts': PostSitemap, 'pages': PageSitemap, 'writingbyloc': WritingbyCountrySitemap, 'books': BookSitemap, } urlpatterns = [ re_path(r'^admin/build/.*', builder.views.do_build), path(r'admin/data/', include('utils.urls')), #path(r'admin/income/invoice/monthlyview//invoice/', DownloadMonthlyInvoiceView.as_view(), name="download-invoice"), #path(r'admin/income/invoice/monthlyview//', MonthlyInvoiceView.as_view(), name="monthly-invoice"), path(r'admin/', admin.site.urls), path(r'luximages/insert/', utils.views.insert_image), path(r'luxproduct/insert/', products.views.insert_products), path(r'feed.xml', PostRSSFeedView(),name="feed"), path(r'sitemap.xml', sitemap, {'sitemaps': sitemaps}), path(r'links/', include('links.urls')), path(r'newsletter/', include('lttr.urls')), #path(r'jrnl/', include('jrnl.urls')), path(r'jrnl/', include('posts.urls.jrnl_urls', namespace='jrnl')), #path(r'projects/', include('projects.urls')), path(r'topics/', include('taxonomy.urls')), path(r'walk/', include('locations.walk_urls')), path(r'walks/', include('locations.walk_urls')), path(r'locations/', include('locations.urls')), #path(r'expenses/', include('expenses.urls', namespace='expenses')), path(r'photos/', include('photos.urls')), path(r'guide/', include('posts.urls.guide_urls', namespace='guide')), path(r'essay/', include('posts.urls.essay_urls')), re_path(r'^essay/$', RedirectView.as_view(url='/essays/')), path(r'essays/', include('posts.urls.essay_urls', namespace='essay-list')), path(r'book-notes/', include('books.urls')), #path(r'people/', include('people.urls')), path(r'dialogues/', include('sightings.urls', namespace='sightings')), path(r'field-notes/', include('posts.urls.field_note_urls', namespace='fieldnote')), path(r'src/', include('posts.urls.src_urls', namespace='src')), #path(r'essays/', include('essays.urls', namespace='essays')), path(r'work/', include('resume.urls', namespace='resume')), path(r'map', include('locations.urls', namespace='map')), path(r'map/', include('locations.urls', namespace='map')), path(r'', HomePageList.as_view(), {'pk':1,}, name="homepage"), path(r'comments/', include('django_comments.urls')), path(r'.txt', PageDetailTXTView.as_view()), path(r'', include('pages.urls', namespace='pages')), path(r'//', PageDetailView.as_view()), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) if settings.DEBUG: import debug_toolbar urlpatterns = [ path('__debug__/', include(debug_toolbar.urls)), # For django versions before 2.0: # url(r'^__debug__/', include(debug_toolbar.urls)), ] + urlpatterns