Skip to content

Commit aa818e2

Browse files
committed
Preparing for launch captain
1 parent a5ca990 commit aa818e2

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 pritchardn
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Procfile

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

django_unchained/settings.py

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
MIDDLEWARE = [
4444
'django.middleware.security.SecurityMiddleware',
45+
'whitenoise.middleware.WhiteNoiseMiddleware',
4546
'django.contrib.sessions.middleware.SessionMiddleware',
4647
'django.middleware.common.CommonMiddleware',
4748
'django.middleware.csrf.CsrfViewMiddleware',
@@ -119,6 +120,13 @@
119120
# https://docs.djangoproject.com/en/2.0/howto/static-files/
120121

121122
STATIC_URL = '/static/'
123+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
124+
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
122125

123126
LOGIN_REDIRECT_URL = '/todos/home/'
124127
LOGOUT_REDIRECT_URL = '/todos/home/'
128+
129+
#Heroku: Update database configuration from $DATABASE_URL
130+
import dj_database_url
131+
db_from_env = dj_database_url.config(conn_max_age=500)
132+
DATABASES['default'].update(db_from_env)

requirements.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dj-database-url==0.5.0
2+
Django==2.0.6
3+
gunicorn==19.8.1
4+
psycopg2==2.7.5
5+
pytz==2018.4
6+
whitenoise==3.3.1

runtime.txt

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

0 commit comments

Comments
 (0)