diff options
author | luxagraf <sng@luxagraf.net> | 2023-06-29 12:40:43 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-06-29 12:40:43 -0500 |
commit | 8fe8e1c333b721c61f1723e114bc46f2698fd6c1 (patch) | |
tree | 5bb9ced6665d23840cea5a63bffbf89e6a659b78 /config |
initital commit of pd tool
Diffstat (limited to 'config')
-rw-r--r-- | config/base_urls.py | 26 | ||||
-rw-r--r-- | config/req.txt | 31 | ||||
-rw-r--r-- | config/settings.py | 139 | ||||
-rw-r--r-- | config/wsgi.py | 26 |
4 files changed, 222 insertions, 0 deletions
diff --git a/config/base_urls.py b/config/base_urls.py new file mode 100644 index 0000000..8fb6658 --- /dev/null +++ b/config/base_urls.py @@ -0,0 +1,26 @@ +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 + +admin.autodiscover() +admin.site.enable_nav_sidebar = False +from django.contrib.admin.sites import AdminSite +AdminSite.site_header = "PD Data Sorting Tools" +AdminSite.site_title = "Sorting" +urlpatterns = [ + path(r'admin/', admin.site.urls), +] + 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..2bfc228 --- /dev/null +++ b/config/req.txt @@ -0,0 +1,31 @@ +asgiref==3.5.1 +beautifulsoup4==4.11.1 +bleach==4.1.0 +certifi==2021.10.8 +charset-normalizer==2.0.12 +Django==4.0.4 +django-bleach==2.0.0 +django-debug-toolbar==3.4.0 +django-extensions==3.1.5 +django-gravatar2==1.4.4 +django-taggit==3.0.0 +idna==3.3 +importlib-metadata==4.11.3 +Jinja2==3.1.2 +jsmin==3.0.1 +Markdown==3.3.7 +MarkupSafe==2.1.1 +packaging==21.3 +Pillow==9.1.0 +psycopg2-binary==2.9.3 +pyparsing==3.0.9 +python-resize-image==1.1.20 +requests==2.27.1 +six==1.16.0 +smartypants==2.0.1 +soupsieve==2.3.2.post1 +sqlparse==0.4.2 +typogrify==2.0.7 +urllib3==1.26.9 +webencodings==0.5.1 +zipp==3.8.0 diff --git a/config/settings.py b/config/settings.py new file mode 100644 index 0000000..ee0ea53 --- /dev/null +++ b/config/settings.py @@ -0,0 +1,139 @@ +""" +Django settings for mysite project. + +Generated by 'django-admin startproject' using Django 4.2.1. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/ref/settings/ +""" +import os +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-h8hp$ne=mq*!4y9*q9kes@0_iik2&coksbs$+rkmn^ui28v!v8' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = ['10.153.93.177',] + +STATIC_ROOT = os.path.join(BASE_DIR, 'static/') +MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') + +# Application definition + +DJANGO_APPS = [ + 'django.contrib.admin', + 'django.contrib.sites', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django.contrib.sitemaps', +] +THIRD_PARTY_APPS = [ + 'django_extensions', + 'django_admin_listfilter_dropdown', +] +LOCAL_APPS = [ + 'deals', +] + +INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'config.base_urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'config.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'NAME': 'pdthtn', + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'USER': 'luxagraf', + 'PASSWORD': 'tryptaminevfr$32', + 'HOST': '127.0.0.1', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.2/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 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() + |