diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..e6088524 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn PyRIGS.wsgi --log-file - diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index d1aa118a..ad815647 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -10,7 +10,9 @@ https://docs.djangoproject.com/en/1.7/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os -BASE_DIR = os.path.dirname(os.path.dirname(__file__)) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ @@ -19,13 +21,13 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = 'gxhy(a#5mhp289_=6xx$7jh=eh$ymxg^ymc+di*0c*geiu3p_e' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['*'] -INTERNAL_IPS = ['127.0.0.1', '10.20.30.20'] +INTERNAL_IPS = ['127.0.0.1'] # Application definition @@ -63,24 +65,8 @@ WSGI_APPLICATION = 'PyRIGS.wsgi.application' # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases -try: - import pymysql - pymysql.install_as_MySQLdb() -except ImportError: - pass -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - }, - 'legacy': { - 'ENGINE': 'django.db.backends.mysql', - 'HOST': 'alfie.codedinternet.com', - 'NAME': 'tec_rigs', - 'USER': 'tec_rigs', - 'PASSWORD': 'xMNb(b+Giu]&', - } -} +import dj_database_url +DATABASES['default'] = dj_database_url.config() # User system AUTH_USER_MODEL = 'RIGS.Profile' diff --git a/PyRIGS/wsgi.py b/PyRIGS/wsgi.py index ae436d87..7fa79ab0 100644 --- a/PyRIGS/wsgi.py +++ b/PyRIGS/wsgi.py @@ -6,9 +6,7 @@ It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ - -import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PyRIGS.settings") - from django.core.wsgi import get_wsgi_application -application = get_wsgi_application() +from dj_static import Cling + +application = Cling(get_wsgi_application())