diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/base_urls.py | 50 | ||||
-rw-r--r-- | config/req.txt | 44 | ||||
-rw-r--r-- | config/wsgi.py | 26 |
3 files changed, 120 insertions, 0 deletions
diff --git a/config/base_urls.py b/config/base_urls.py new file mode 100644 index 0000000..7bc3431 --- /dev/null +++ b/config/base_urls.py @@ -0,0 +1,50 @@ +from django.urls import path, re_path, include +from django.conf.urls.static import static +from django.conf import settings +from django.contrib import admin +from django.contrib.sitemaps.views import sitemap +from django.views.generic.base import RedirectView + +from pages.views import PageDetailView, PageDetailTXTView, HomePageList +from posts.models import PostSitemap +from pages.models import PageSitemap +import builder.views +import utils.views +#import products.views + +from posts.views import PostRSSFeedView + +admin.autodiscover() +admin.site.enable_nav_sidebar = False + +sitemaps = { + 'posts': PostSitemap, + 'pages': PageSitemap, +} + +urlpatterns = [ + re_path(r'^admin/build/.*', builder.views.do_build), + path(r'admin/data/', include('utils.urls')), + path(r'admin/', admin.site.urls), + path(r'luximages/insert/', utils.views.insert_image), + path('contact/', include('contact.urls')), + path(r'newsletter/', include('lttr.urls')), + path(r'feed.xml', PostRSSFeedView(),name="feed"), + path(r'sitemap.xml', sitemap, {'sitemaps': sitemaps}), + path(r'classes/', include('classes.urls')), + path(r'<slug>.txt', PageDetailTXTView.as_view()), + path(r'<slug>', include('pages.urls', namespace='pages')), + path(r'<path>/<slug>/', PageDetailView.as_view()), + path(r'', HomePageList.as_view(), {'pk':1,}, name="homepage"), +] + 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 diff --git a/config/req.txt b/config/req.txt new file mode 100644 index 0000000..4d0221b --- /dev/null +++ b/config/req.txt @@ -0,0 +1,44 @@ +asgiref==3.4.1 +backcall==0.2.0 +beautifulsoup4==4.10.0 +bleach==4.1.0 +certifi==2021.5.30 +charset-normalizer==2.0.6 +decorator==5.1.0 +Django==3.2.8 +django-bleach==0.9.0 +django-debug-toolbar==3.2.2 +django-extensions==3.1.3 +django-gravatar2==1.4.4 +django-taggit==1.5.1 +idna==3.2 +ipython==7.28.0 +jedi==0.18.0 +Jinja2==3.0.2 +jsmin==3.0.0 +lxml==4.6.3 +Markdown==3.3.4 +MarkupSafe==2.0.1 +matplotlib-inline==0.1.3 +packaging==21.0 +parso==0.8.2 +pexpect==4.8.0 +pickleshare==0.7.5 +Pillow==8.3.2 +prompt-toolkit==3.0.20 +psycopg2-binary==2.9.1 +ptyprocess==0.7.0 +Pygments==2.10.0 +pyparsing==2.4.7 +python-resize-image==1.1.19 +pytz==2021.3 +requests==2.26.0 +six==1.16.0 +smartypants==2.0.1 +soupsieve==2.2.1 +sqlparse==0.4.2 +traitlets==5.1.0 +typogrify==2.0.7 +urllib3==1.26.7 +wcwidth==0.2.5 +webencodings==0.5.1 diff --git a/config/wsgi.py b/config/wsgi.py new file mode 100644 index 0000000..4493e47 --- /dev/null +++ b/config/wsgi.py @@ -0,0 +1,26 @@ +""" +WSGI config for myproject project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ +""" + +import os, sys, site +from os.path import dirname, abspath +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + +# Fix markdown.py (and potentially others) using stdout +sys.stdout = sys.stderr +SERVER_ROOT = abspath(dirname(dirname(__file__)))+'/' +# Tell wsgi to add the Python site-packages to it's path. +site.addsitedir(SERVER_ROOT+'venv/lib/python3.7/site-packages') +sys.path = [SERVER_ROOT,] + sys.path +sys.path.insert(0, os.path.join(SERVER_ROOT, "app")) +sys.path.insert(0, os.path.join(SERVER_ROOT, "app/lib")) +sys.path.insert(0, os.path.join(SERVER_ROOT, "config")) + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() + |