donors

git clone git://ce9e.org/donors

commit
4a85f32097203c374cecad8c76e6134abedfd2f9
parent
a8e74628ad5e6da69a096b641120241bd2d644c9
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2021-03-06 12:10
split settings

Diffstat

R donors/settings.py -> donors/settings/base.py 31 +++----------------------------
A donors/settings/dev.py 22 ++++++++++++++++++++++
M manage.py 3 +--

3 files changed, 26 insertions, 30 deletions


diff --git a/donors/settings.py b/donors/settings/base.py

@@ -10,27 +10,12 @@ For the full list of settings and their values, see
   10    10 https://docs.djangoproject.com/en/3.1/ref/settings/
   11    11 """
   12    12 
   13    -1 from pathlib import Path
   14    -1 
   15    -1 # Build paths inside the project like this: BASE_DIR / 'subdir'.
   16    -1 BASE_DIR = Path(__file__).resolve().parent.parent
   17    -1 
   18    -1 
   19    -1 # Quick-start development settings - unsuitable for production
   20    -1 # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
   21    -1 
   22    -1 # SECURITY WARNING: keep the secret key used in production secret!
   23    -1 SECRET_KEY = '(_26c1i#kl^vshc6cue$jbq(@_q^m61_0ar^578c=0k)mngcqz'
   24    -1 
   25    -1 # SECURITY WARNING: don't run with debug turned on in production!
   26    -1 DEBUG = True
   27    -1 
   28    -1 ALLOWED_HOSTS = []
   29    -1 
   -1    13 ALLOWED_HOSTS = ['localhost']
   30    14 
   31    15 # Application definition
   32    16 
   33    17 INSTALLED_APPS = [
   -1    18     'donors',
   34    19     'django.contrib.admin',
   35    20     'django.contrib.auth',
   36    21     'django.contrib.contenttypes',
@@ -42,6 +27,7 @@ INSTALLED_APPS = [
   42    27 MIDDLEWARE = [
   43    28     'django.middleware.security.SecurityMiddleware',
   44    29     'django.contrib.sessions.middleware.SessionMiddleware',
   -1    30     'django.middleware.locale.LocaleMiddleware',
   45    31     'django.middleware.common.CommonMiddleware',
   46    32     'django.middleware.csrf.CsrfViewMiddleware',
   47    33     'django.contrib.auth.middleware.AuthenticationMiddleware',
@@ -70,17 +56,6 @@ TEMPLATES = [
   70    56 WSGI_APPLICATION = 'donors.wsgi.application'
   71    57 
   72    58 
   73    -1 # Database
   74    -1 # https://docs.djangoproject.com/en/3.1/ref/settings/#databases
   75    -1 
   76    -1 DATABASES = {
   77    -1     'default': {
   78    -1         'ENGINE': 'django.db.backends.sqlite3',
   79    -1         'NAME': BASE_DIR / 'db.sqlite3',
   80    -1     }
   81    -1 }
   82    -1 
   83    -1 
   84    59 # Password validation
   85    60 # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
   86    61 

diff --git a/donors/settings/dev.py b/donors/settings/dev.py

@@ -0,0 +1,22 @@
   -1     1 from pathlib import Path
   -1     2 
   -1     3 from .base import *
   -1     4 
   -1     5 BASE_DIR = Path(__file__).resolve().parent.parent
   -1     6 
   -1     7 # SECURITY WARNING: keep the secret key used in production secret!
   -1     8 SECRET_KEY = '(_26c1i#kl^vshc6cue$jbq(@_q^m61_0ar^578c=0k)mngcqz'
   -1     9 
   -1    10 # SECURITY WARNING: don't run with debug turned on in production!
   -1    11 DEBUG = True
   -1    12 
   -1    13 
   -1    14 # Database
   -1    15 # https://docs.djangoproject.com/en/3.1/ref/settings/#databases
   -1    16 
   -1    17 DATABASES = {
   -1    18     'default': {
   -1    19         'ENGINE': 'django.db.backends.sqlite3',
   -1    20         'NAME': BASE_DIR / 'db.sqlite3',
   -1    21     }
   -1    22 }

diff --git a/manage.py b/manage.py

@@ -5,8 +5,7 @@ import sys
    5     5 
    6     6 
    7     7 def main():
    8    -1     """Run administrative tasks."""
    9    -1     os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'donors.settings')
   -1     8     os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'donors.settings.dev')
   10     9     try:
   11    10         from django.core.management import execute_from_command_line
   12    11     except ImportError as exc: