Django Host Static files

serving static file in Django 1.9.3 is little some thing to take care of.

make dir in root named static and host jquery.js

in settings.py

find the line STATIC_URL = ‘/static/’
and add
STATICFILES_DIRS = [
os.path.join(BASE_DIR, “static”),
‘/static/’,
]

in your template just add
{% load static %}

For production static file load for product use this command before deployment
#i am using python 3
python3 manage.py collectstatic

Leave a Reply

Your email address will not be published. Required fields are marked *