Skip to content

Commit

Permalink
Testing static files issue
Browse files Browse the repository at this point in the history
  • Loading branch information
juliolugo96 committed Jul 15, 2019
1 parent 1abeb38 commit 0c67120
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
web: gunicorn projexbackend.wsgi
release: python manage.py migrate
web: gunicorn projexbackend.wsgi --log-file -
16 changes: 15 additions & 1 deletion projexbackend/config/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@
DATABASES['default'].update(prod_db)


django_heroku.settings(locals())
# django_heroku.settings(locals())

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
PROJECT_ROOT = os.path.join(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/static/'

# Extra lookup directories for collectstatic to find static files
STATICFILES_DIRS = (
os.path.join(PROJECT_ROOT, 'static'),
)

# Add configuration for static files storage using whitenoise
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
4 changes: 1 addition & 3 deletions projexbackend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
"""
import datetime
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__)))

SECRET_KEY = os.environ['SECRET_KEY']


PROJECT_ROOT = os.path.join(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/static/'
Expand Down Expand Up @@ -82,9 +80,9 @@
SITE_ID = 1

MIDDLEWARE = [
'whitenoise.middleware.WhiteNoiseMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
Expand Down

0 comments on commit 0c67120

Please sign in to comment.