Heroku/Django Static files -


in local development environment

href={% static "datetimepicker-master/jquery.datetimepicker.css" %}/> 

loads fine. in heroku, says csrf error think because trying load local host.

how configure settings.py load static files correctly? file structure is:

/project   /app     /staticfiles   /mysite 

install dj-static (a django static file server) (getting started django on heroku)

installing pip:

pip install dj-static 

settings.py

# static asset configuration import os base_dir = os.path.dirname(os.path.abspath(__file__)) static_root = 'staticfiles' static_url = '/static/'  staticfiles_dirs = (     os.path.join(base_dir, 'static'), ) 

wsgi.py

from django.core.wsgi import get_wsgi_application dj_static import cling  application = cling(get_wsgi_application()) 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -