diff --git a/.gitignore b/.gitignore index add4942..1b798ac 100644 --- a/.gitignore +++ b/.gitignore @@ -123,4 +123,9 @@ dmypy.json # End of https://www.gitignore.io/api/django # vs code files -.vscode \ No newline at end of file +.vscode +bin +libs +pyvenv.cfg + +.idea \ No newline at end of file diff --git a/get_a_doc/settings/__init__.py b/get_a_doc/settings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/get_a_doc/settings.py b/get_a_doc/settings/base.py similarity index 92% rename from get_a_doc/settings.py rename to get_a_doc/settings/base.py index f1d1a38..97d0158 100644 --- a/get_a_doc/settings.py +++ b/get_a_doc/settings/base.py @@ -23,9 +23,7 @@ SECRET_KEY = '0&+ddh#txdwpps86wp57f9=_pynv#lug5no3!z2)qmd%v7%va)' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] +DEBUG = False # Application definition @@ -75,17 +73,6 @@ WSGI_APPLICATION = 'get_a_doc.wsgi.application' -# Database -# https://docs.djangoproject.com/en/3.0/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators diff --git a/get_a_doc/settings/dev.py b/get_a_doc/settings/dev.py new file mode 100644 index 0000000..5405902 --- /dev/null +++ b/get_a_doc/settings/dev.py @@ -0,0 +1,12 @@ +from .base import * # noqa + +DEBUG = True + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), # noqa + } +} + +ALLOWED_HOST = ['*'] diff --git a/get_a_doc/settings/prod.py b/get_a_doc/settings/prod.py new file mode 100644 index 0000000..847eb3d --- /dev/null +++ b/get_a_doc/settings/prod.py @@ -0,0 +1,17 @@ +from .base import * # noqa + +# Database +# https://docs.djangoproject.com/en/3.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresq', + 'NAME': '', + 'PORT': 5432, + 'HOST': '127.0.0.1', + 'PASSWORD': '', + 'USER': '', + } +} + +ALLOWED_HOST = ['your_domains'] diff --git a/get_a_doc/settings/test.py b/get_a_doc/settings/test.py new file mode 100644 index 0000000..894333e --- /dev/null +++ b/get_a_doc/settings/test.py @@ -0,0 +1 @@ +from .dev import * # noqa diff --git a/manage.py b/manage.py index 272d202..fe689bd 100644 --- a/manage.py +++ b/manage.py @@ -5,7 +5,9 @@ def main(): - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'get_a_doc.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', + os.environ.get('DJANGO_SETTINGS_MODULE', + 'get_a_doc.settings.dev')) try: from django.core.management import execute_from_command_line except ImportError as exc: