summaryrefslogtreecommitdiff
path: root/config/base_urls.py
blob: 8a699ba435c15b2bda1c6ea3cb0a35ac74256ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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 pages.views import PageDetailView
from jrnl.models import BlogSitemap
from fieldnotes.models import FieldNoteSitemap 
from jrnl.views import HomepageList
from locations.models import WritingbyCountrySitemap
from photos.models import PhotoGallerySitemap
from src.models import SrcSitemap
from books.models import BookSitemap
from essays.models import EssaySitemap
from projects.models.base import ProjectSitemap
import builder.views
import utils.views

from locations.views import MapDataList
from income.views import MonthlyInvoiceView, DownloadMonthlyInvoiceView

admin.autodiscover()

sitemaps = {
    'blog': BlogSitemap,
    'notes': FieldNoteSitemap,
    'writingbyloc': WritingbyCountrySitemap,
    'src': SrcSitemap,
    'essays': EssaySitemap,
    '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/<str:slug>/invoice/', DownloadMonthlyInvoiceView.as_view(), name="download-invoice"),
    path(r'admin/income/invoice/monthlyview/<str:slug>/', MonthlyInvoiceView.as_view(), name="monthly-invoice"),
    path(r'admin/', admin.site.urls),
    path(r'luximages/insert/', utils.views.insert_image),
    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'projects/', include('projects.urls')),
    path(r'locations/', include('locations.urls')),
    path(r'expenses/', include('expenses.urls', namespace='expenses')),
    path(r'photos/', include('photos.urls')),
    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('fieldnotes.urls', namespace='fieldnotes')),
    path(r'src/', include('src.urls', namespace='src')),
    path(r'tools/', include('essays.urls', namespace='tools')),
    path(r'essays/', include('essays.urls', namespace='essays')),
    path(r'figments/', include('figments.urls', namespace='figments')),
    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(), name="homepage"),
    path(r'comments/', include('django_comments.urls')),
    path(r'<slug>', PageDetailView.as_view()),
    path(r'<path>/<slug>/', 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