Skip to content

Commit 5da6ffa

Browse files
committed
Made a few more changes before deploying
1 parent 99c1a34 commit 5da6ffa

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web:gunicorn finance.wsgi
1+
web: gunicorn finance.wsgi --log-file -

finance/settings.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
"""
2-
Django settings for finance project.
3-
4-
Generated by 'django-admin startproject' using Django 3.2.7.
5-
6-
For more information on this file, see
7-
https://docs.djangoproject.com/en/3.2/topics/settings/
8-
9-
For the full list of settings and their values, see
10-
https://docs.djangoproject.com/en/3.2/ref/settings/
11-
"""
12-
1+
import django_heroku
132
from pathlib import Path
3+
import os
144

155
# Build paths inside the project like this: BASE_DIR / 'subdir'.
166
BASE_DIR = Path(__file__).resolve().parent.parent
@@ -51,6 +41,7 @@
5141
'django.contrib.sessions.middleware.SessionMiddleware',
5242
'django.middleware.common.CommonMiddleware',
5343
'django.middleware.csrf.CsrfViewMiddleware',
44+
'whitenoise.middleware.WhiteNoiseMiddleware',
5445
'django.contrib.auth.middleware.AuthenticationMiddleware',
5546
'django.contrib.messages.middleware.MessageMiddleware',
5647
'django.middleware.clickjacking.XFrameOptionsMiddleware',
@@ -151,7 +142,17 @@
151142
# Static files (CSS, JavaScript, Images)
152143
# https://docs.djangoproject.com/en/3.2/howto/static-files/
153144

145+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
146+
147+
# Static files (CSS, JavaScript, Images)
148+
# https://docs.djangoproject.com/en/1.9/howto/static-files/
149+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
154150
STATIC_URL = '/static/'
151+
152+
# Extra places for collectstatic to find static files.
153+
STATICFILES_DIRS = (
154+
os.path.join(BASE_DIR, 'static'),
155+
)
155156
# Default primary key field type
156157
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
157158

@@ -171,4 +172,5 @@
171172

172173
api_key = 'Tpk_c46f4087296c43358402984f3b26ed2f'
173174

174-
X_FRAME_OPTIONS = 'SAMEORIGIN'
175+
X_FRAME_OPTIONS = 'SAMEORIGIN'
176+
django_heroku.settings(locals())

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ Werkzeug==2.0.3
7171
yahooquery==2.2.15
7272
zipp==3.8.0
7373
zope.interface==5.4.0
74-
gunicorn
74+
gunicorn==20.1.0
75+
django-heroku==0.3.1
76+
whitenoise==6.1.0

0 commit comments

Comments
 (0)