Skip to content

Commit 97836ac

Browse files
committed
adding heroku deployment
1 parent 022e7dd commit 97836ac

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

project3/Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn deployProject.wsgi --log-file -

project3/pizza/settings.py

+4
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@
119119
# https://docs.djangoproject.com/en/2.0/howto/static-files/
120120

121121
STATIC_URL = '/static/'
122+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
123+
import dj_database_url
124+
db_from_env = dj_database_url.config()
125+
DATABASES['default'].update(db_from_env)

project3/pizza/wsgi.py

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pizza.settings")
1515

1616
application = get_wsgi_application()
17+
18+
# Use whitenoise package to serve static files on Heroku
19+
from whitenoise.django import DjangoWhiteNoise
20+
application = DjangoWhiteNoise(application)

project3/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
Django==2.0.3
2+
python-3.7.0
3+
whitenoise==3.2.1
4+
gunicorn==19.6.0
5+
dj-database-url==0.5.0
6+
psycopg2==2.7.1

project3/runtime.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.7.0

0 commit comments

Comments
 (0)