static files copied to heroku while DEBUG=False but doesn't show image and styling.

312 views
Skip to first unread message

Aaron Kim

unread,
Oct 11, 2016, 10:46:16 AM10/11/16
to django-oscar
I managed to run my oscar site on heroku while DEBUG=True. This shows all the html and css. 

Then, I differentiated local setting and production setting. Part of the differentiation was making DEBUG=False for production setting. 

I can still see static files still copied to where I set as STATIC_ROOT in heroku's build log. However, I cannot see any image or styling. 

Can anyone please comment? Following was the setting and build log. 

PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))

STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_URL = '/static/'

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

 
 -----> Python app detected
$ pip install -r requirements.txt
$ python manage.py collectstatic --noinput
Error importing settings_local. Don't panic, this just means that this is a production environment.
294 static files copied to '/app/sample/staticfiles', 1 unmodified.
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 76.1M
-----> Launching...
Released v14
https://sampleapp.herokuapp.com/ deployed to Heroku

Aaron Kim

unread,
Oct 12, 2016, 10:43:48 AM10/12/16
to django-oscar
Resolved. Followed a guide from here
Reply all
Reply to author
Forward
0 new messages