initial django base

This commit is contained in:
meeb
2020-11-23 17:32:02 +11:00
parent 840d4fbc62
commit 6ed18a6953
123 changed files with 44533 additions and 0 deletions

0
app/tubesync/__init__.py Normal file
View File

6
app/tubesync/asgi.py Normal file
View File

@@ -0,0 +1,6 @@
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tubesync.settings')
application = get_asgi_application()

View File

View File

114
app/tubesync/settings.py Normal file
View File

@@ -0,0 +1,114 @@
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = ''
DEBUG = False
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'sass_processor',
'common',
'sync',
]
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 = 'tubesync.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',
],
},
},
]
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'sass_processor.finders.CssFinder',
]
WSGI_APPLICATION = 'tubesync.wsgi.application'
DATABASES = {}
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',
},
]
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / 'static'
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
SASS_PROCESSOR_ROOT = STATIC_ROOT
ROBOTS = '''
User-agent: *
Disallow: /
'''.strip()
HEALTHCHECK_FIREWALL = True
HEALTHCHECK_ALLOWED_IPS = ('127.0.0.1',)
try:
from .local_settings import *
except ImportError as e:
import sys
sys.stderr.write(f'Unable to import local_settings: {e}\n')
sys.exit(1)

22
app/tubesync/urls.py Normal file
View File

@@ -0,0 +1,22 @@
from django.urls import path, include
from django.contrib import admin
admin.site.site_title = 'TubeSync dashboard admin'
admin.site.site_header = 'TubeSync dashboard admin'
handler404 = 'common.views.error404'
handler500 = 'common.views.error500'
urlpatterns = [
path('admin/',
admin.site.urls),
path('',
include('common.urls', namespace='common')),
path('',
include('sync.urls', namespace='sync')),
]

6
app/tubesync/wsgi.py Normal file
View File

@@ -0,0 +1,6 @@
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tubesync.settings')
application = get_wsgi_application()