From 81e40fa610ee84254c1b2905f0b98f980f8faebb Mon Sep 17 00:00:00 2001 From: Mike Olund Date: Thu, 23 Feb 2017 10:29:53 -0800 Subject: [PATCH] Removed unnecessary dependencies --- .env.example | 1 - edivorce/settings/base.py | 5 ++--- edivorce/settings/local.py | 16 +++++++++------- manage.py | 4 ++-- requirements.txt | 27 --------------------------- wsgi.py | 4 ++-- 6 files changed, 15 insertions(+), 42 deletions(-) diff --git a/.env.example b/.env.example index 3b4b5ce2..05d0a483 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,3 @@ -LOCAL_DEV=True DEBUG=True TEMPLATE_DEBUG=True DJANGO_SECRET_KEY= diff --git a/edivorce/settings/base.py b/edivorce/settings/base.py index e4e1d476..33a0fa35 100644 --- a/edivorce/settings/base.py +++ b/edivorce/settings/base.py @@ -11,7 +11,6 @@ https://docs.djangoproject.com/en/1.8/ref/settings/ """ import os -from decouple import config from unipath import Path # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -22,12 +21,12 @@ BASE_DIR = Path(__file__).parent.parent # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ # The SECRET_KEY is provided via an environment variable in OpenShift -SECRET_KEY = config( +SECRET_KEY = os.environ.get( 'DJANGO_SECRET_KEY', default='9e4@&tw46$l31)zrqe3wi+-slqm(ruvz&se0^%9#6(_w3ui!c0' ) -DEBUG = config('DEBUG', default=False, cast=bool) +DEBUG = False # TODO: Set ALLOWED_HOSTS this to the actual host headers used by the local/dev/test/prod instances & health probes # ALLOWED_HOSTS = ['localhost', '127.0.0.1'] diff --git a/edivorce/settings/local.py b/edivorce/settings/local.py index d74cb355..d0176134 100644 --- a/edivorce/settings/local.py +++ b/edivorce/settings/local.py @@ -1,16 +1,18 @@ from .base import * -from decouple import config DATABASES = { 'default': { - 'ENGINE': config('DATABASE_ENGINE'), - 'NAME': config('DATABASE_NAME'), - 'USER': config('DATABASE_USER'), - 'PASSWORD': config('DATABASE_PASSWORD'), - 'HOST': config('DATABASE_HOST'), - 'PORT': config('DATABASE_PORT'), + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'db.sqlite3', + 'USER': '', + 'PASSWORD': '', + 'HOST': '', + 'PORT': '', } } +DEBUG = True +TEMPLATES[0]["OPTIONS"]["debug"] = True + WEASYPRINT_URL = 'http://localhost:5005' WEASYPRINT_CSS_LOOPBACK = 'http://10.200.10.1:8000' diff --git a/manage.py b/manage.py index 866389e0..ad36642c 100755 --- a/manage.py +++ b/manage.py @@ -1,11 +1,11 @@ #!/usr/bin/env python import os import sys -import decouple if __name__ == "__main__": - if decouple.config("LOCAL_DEV", default=False, cast=bool): + # check if the app is running on OpenShift + if not os.environ.get('OPENSHIFT_APP_NAME', False): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.local") else: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.openshift") diff --git a/requirements.txt b/requirements.txt index f13c98f7..6c54e54c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,38 +1,11 @@ -astroid==1.4.9 -backports.functools-lru-cache==1.3 -configparser==3.5.0 Django==1.8.17 -django-appconf==1.0.2 django-compressor==2.1 django-debug-toolbar==1.5 django-libsass==0.7 djangorestframework==3.5.3 -enum34==1.1.6 -flake8==3.2.1 -futures==3.0.5 -greenlet==0.4.11 gunicorn==19.4.5 -isort==4.2.5 -lazy-object-proxy==1.2.2 -libsass==0.12.3 -mccabe==0.5.3 -msgpack-python==0.4.8 -neovim==0.1.12 -olefile==0.44 -Pillow==4.0.0 psycopg2==2.6.1 -pycodestyle==2.2.0 -pyflakes==1.3.0 -pylint==1.6.4 -python-decouple==3.0 -rcssmin==1.0.6 -reportlab==3.3.0 requests==2.13.0 -rjsmin==1.0.12 six==1.10.0 -sqlparse==0.2.2 -trollius==2.1 Unipath==1.1 -wheel==0.24.0 whitenoise==3.0 -wrapt==1.10.8 diff --git a/wsgi.py b/wsgi.py index aa2126ad..287c878a 100644 --- a/wsgi.py +++ b/wsgi.py @@ -8,11 +8,11 @@ https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os -import decouple from django.core.wsgi import get_wsgi_application from django.core.management import execute_from_command_line -if decouple.config("LOCAL_DEV", default=False, cast=bool): +# check if the app is running on OpenShift +if not os.environ.get('OPENSHIFT_APP_NAME', False): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.local") else: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.openshift")