diff --git a/mymusix/settings.py b/mymusix/settings.py index d210ba0..49f841e 100644 --- a/mymusix/settings.py +++ b/mymusix/settings.py @@ -11,6 +11,7 @@ """ import os +import django_heroku # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -19,15 +20,15 @@ # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = os.environ['SECRET_KEY'] -# '-1izvs+(!mx%vx8qh^_(d(d1la38x_hmg7(q5mq#fk%48)tpir' +SECRET_KEY = '-1izvs+(!mx%vx8qh^_(d(d1la38x_hmg7(q5mq#fk%48)tpir' # os.environ['SECRET_KEY'] +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') + # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['127.0.0.1', 'localhost' 'mymusix-server.herokuapp.com'] - +ALLOWED_HOSTS = [] # Application definition @@ -107,10 +108,10 @@ 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'MyMusix', - 'USER': 'b5cc6e5cfac38f', - 'PASSWORD': '4480e459', - 'HOST': 'us-cdbr-iron-east-05.cleardb.net', - 'PORT': '3306' + 'USER': 'root', + 'PASSWORD': '', + 'HOST': '127.0.0.1', + 'PORT': '' } } @@ -150,9 +151,10 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.2/howto/static-files/ -STATIC_URL = '/static/' -PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) -STATIC_ROOT = os.path.join(PROJECT_DIR, 'static') +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') +STATIC_URL = "/static/" + +django_heroku.settings(locals()) SECURE_SSL_REDIRECT = False diff --git a/requirements.txt b/requirements.txt index 33611d6..36a60bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,17 @@ +dj-database-url==0.5.0 Django==2.2.7 django-cors-headers==3.1.1 django-extensions==2.2.5 +django-heroku==0.3.1 djangorestframework==3.10.3 djangorestframework-jsonapi==3.0.0 djangorestframework-jwt==1.11.0 gunicorn==20.0.4 inflection==0.3.1 mysqlclient==1.4.5 +psycopg2==2.8.4 PyJWT==1.7.1 pytz==2019.3 six==1.13.0 sqlparse==0.3.0 +whitenoise==5.0.1