From 4e313c7be40ef2bda1e53dace60f990f3f112036 Mon Sep 17 00:00:00 2001 From: Jomari Macaraig Date: Thu, 13 Sep 2018 14:11:55 +0000 Subject: [PATCH 1/4] #1 Separated project and configuration --- {pythonph => config}/__init__.py | 0 {pythonph => config}/settings.py | 0 {pythonph => config}/urls.py | 0 {pythonph => config}/wsgi.py | 0 pythonph/empty | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {pythonph => config}/__init__.py (100%) rename {pythonph => config}/settings.py (100%) rename {pythonph => config}/urls.py (100%) rename {pythonph => config}/wsgi.py (100%) create mode 100644 pythonph/empty diff --git a/pythonph/__init__.py b/config/__init__.py similarity index 100% rename from pythonph/__init__.py rename to config/__init__.py diff --git a/pythonph/settings.py b/config/settings.py similarity index 100% rename from pythonph/settings.py rename to config/settings.py diff --git a/pythonph/urls.py b/config/urls.py similarity index 100% rename from pythonph/urls.py rename to config/urls.py diff --git a/pythonph/wsgi.py b/config/wsgi.py similarity index 100% rename from pythonph/wsgi.py rename to config/wsgi.py diff --git a/pythonph/empty b/pythonph/empty new file mode 100644 index 0000000..e69de29 From 596802ac16146b24c51bacfeaf4a1746f0db05c9 Mon Sep 17 00:00:00 2001 From: Jomari Macaraig Date: Thu, 13 Sep 2018 14:23:03 +0000 Subject: [PATCH 2/4] #1 Created development settings file and fix conflicts it raises --- .gitignore | 2 ++ config/{settings.py => settings/base.py} | 4 ++-- config/settings/development.py | 3 +++ config/wsgi.py | 2 +- manage.py | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .gitignore rename config/{settings.py => settings/base.py} (97%) create mode 100644 config/settings/development.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d59fb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__/ +db.sqlite3 diff --git a/config/settings.py b/config/settings/base.py similarity index 97% rename from config/settings.py rename to config/settings/base.py index b8b9f45..fb795ed 100644 --- a/config/settings.py +++ b/config/settings/base.py @@ -49,7 +49,7 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'pythonph.urls' +ROOT_URLCONF = 'config.urls' TEMPLATES = [ { @@ -67,7 +67,7 @@ }, ] -WSGI_APPLICATION = 'pythonph.wsgi.application' +WSGI_APPLICATION = 'config.wsgi.application' # Database diff --git a/config/settings/development.py b/config/settings/development.py new file mode 100644 index 0000000..16e6aab --- /dev/null +++ b/config/settings/development.py @@ -0,0 +1,3 @@ +from .base import * + +ALLOWED_HOSTS = ['*'] diff --git a/config/wsgi.py b/config/wsgi.py index 45008f8..266f8ca 100644 --- a/config/wsgi.py +++ b/config/wsgi.py @@ -11,6 +11,6 @@ from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pythonph.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development") application = get_wsgi_application() diff --git a/manage.py b/manage.py index edbc237..04e1173 100755 --- a/manage.py +++ b/manage.py @@ -3,7 +3,7 @@ import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pythonph.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development") try: from django.core.management import execute_from_command_line except ImportError as exc: From 305348a56a20a708907c18abb81febda5e11aa5d Mon Sep 17 00:00:00 2001 From: Jomari Macaraig Date: Thu, 13 Sep 2018 14:48:13 +0000 Subject: [PATCH 3/4] #1 Separate Applications, django apps, third party apps and local apps --- config/settings/base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/settings/base.py b/config/settings/base.py index fb795ed..2717c1c 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -30,7 +30,7 @@ # Application definition -INSTALLED_APPS = [ +DJANGO_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -39,6 +39,12 @@ 'django.contrib.staticfiles', ] +THIRD_PARTY_APPS = [] + +LOCAL_APPS = [] + +INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS + MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', From 3e7acb8d32cbdaf0c18d107459d323dd05fae70b Mon Sep 17 00:00:00 2001 From: Jomari Macaraig Date: Thu, 13 Sep 2018 14:58:41 +0000 Subject: [PATCH 4/4] #1 Created requirements files --- requirements/base.pip | 1 + requirements/development.pip | 1 + 2 files changed, 2 insertions(+) create mode 100644 requirements/base.pip create mode 100644 requirements/development.pip diff --git a/requirements/base.pip b/requirements/base.pip new file mode 100644 index 0000000..e72874d --- /dev/null +++ b/requirements/base.pip @@ -0,0 +1 @@ +Django==2.0 diff --git a/requirements/development.pip b/requirements/development.pip new file mode 100644 index 0000000..e1ba29c --- /dev/null +++ b/requirements/development.pip @@ -0,0 +1 @@ +-r base.pip