summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/__init__.py0
-rw-r--r--config/base_urls.py35
-rw-r--r--config/django.ini30
-rw-r--r--config/requirements.txt41
-rw-r--r--config/wsgi.py26
5 files changed, 132 insertions, 0 deletions
diff --git a/config/__init__.py b/config/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/config/__init__.py
diff --git a/config/base_urls.py b/config/base_urls.py
new file mode 100644
index 0000000..ed7da2d
--- /dev/null
+++ b/config/base_urls.py
@@ -0,0 +1,35 @@
+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, HomePageDetailView
+#import builder.views
+import utils.views
+import builder.views
+
+
+admin.autodiscover()
+
+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(r'sitemap.xml', sitemap, {'sitemaps': sitemaps}),
+ path(r'<slug>', PageDetailView.as_view()),
+ path(r'<path>/<slug>/', PageDetailView.as_view()),
+ path(r'', HomePageDetailView.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
diff --git a/config/django.ini b/config/django.ini
new file mode 100644
index 0000000..f238c17
--- /dev/null
+++ b/config/django.ini
@@ -0,0 +1,30 @@
+# django.ini file
+[uwsgi]
+
+# maximum number of processes
+processes = 4
+max-requests = 5000
+enable-threads = true
+# the socket (use the full path to be safe)
+uid = http
+gid = http
+
+socket = /tmp/uwsgi.sock
+chmod-socket = 664
+chown-socket = www-data:www-data
+
+# the base directory
+chdir = /home/lxf/sites/luxagraf.net
+
+# django's wsgi file
+module = config.wsgi
+# the virtualenv
+home = /home/lxf/sites/luxagraf.net/venv
+
+buffer-size =65535
+#plugin=python
+limit-as = 1024
+limit-post = 0
+# clear environment on exit
+vacuum = true
+logto = /var/log/uwsgi/test.log
diff --git a/config/requirements.txt b/config/requirements.txt
new file mode 100644
index 0000000..a75a0c8
--- /dev/null
+++ b/config/requirements.txt
@@ -0,0 +1,41 @@
+backcall==0.1.0
+beautifulsoup4==4.7.1
+bs4==0.0.1
+certifi==2019.3.9
+chardet==3.0.4
+decorator==4.4.0
+Django==2.1.7
+django-debug-toolbar==1.11
+django-extensions==2.1.6
+django-taggit==1.1.0
+django-typogrify==1.3.3
+idna==2.8
+ipython==7.4.0
+ipython-genutils==0.2.0
+jedi==0.13.3
+Jinja2==2.10
+lxml==4.3.3
+Markdown==3.1
+MarkupSafe==1.1.1
+parso==0.3.4
+pexpect==4.6.0
+pickleshare==0.7.5
+Pillow==5.4.1
+pkg-resources==0.0.0
+prompt-toolkit==2.0.9
+psycopg2-binary==2.7.7
+ptyprocess==0.6.0
+pwned-passwords-django==1.3.1
+Pygments==2.3.1
+python-decouple==3.1
+python-resize-image==1.1.18
+pytz==2018.9
+requests==2.21.0
+six==1.12.0
+smartypants==2.0.1
+soupsieve==1.9
+sqlparse==0.3.0
+traitlets==4.3.2
+typogrify==2.0.7
+urllib3==1.24.1
+wcwidth==0.1.7
diff --git a/config/wsgi.py b/config/wsgi.py
new file mode 100644
index 0000000..cc7e144
--- /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.6/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()
+