1

I have created a simple web-app using django when i run it on my localhost it works fine. But after I deployed it to heroku the admin page has no css

my setting.py file has configuration

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

When I visit my site deployed on heroku the admin page looks like this (ie, no css) heroku site error screenshot

And on my localhost it lookscompletely fine

same website on localhost

i also ran python manage.py collectstatic command
In static folder all css are present but when ran on heroku they are not loaded

Edit - I have not added any css They are the css files provided by django by default

sachuverma
  • 559
  • 6
  • 27
  • 1
    Does this answer your question? [Django static files on heroku](https://stackoverflow.com/questions/21141315/django-static-files-on-heroku) There's also this: https://devcenter.heroku.com/articles/django-assets – schillingt Apr 29 '20 at 16:29
  • Thanks man. The article from heroku helped me. I installed whitenoise middleware and all files were loaded. – sachuverma Apr 29 '20 at 17:21

0 Answers0