I was wondering how was django templating system works and how to use it, took me awhile to get this.
I thought that you need to put all the assets in one folder like in /static but actually its not, the system need to be pulled using python manage.py collectstatic then it will store to a folder which will be read by the webserver usually it's called static.
STATICFILES_DIRS = put the assets in here
STATIC_ROOT = This where the collectstatic grabs all data from STATICFILES_DIRS to STATIC_ROOT (where the webserver will read).
Right now I'm putting my assets in the apps which is NOT the right way, I need to put this at the project so can be used in others apps too. I'm still learning this.
Here are the example of setting.py
STATIC_ROOT = 'D:/CODESPACE/PYTHON/Madindo/madindo/static' STATIC_URL = '/static/' STATICFILES_DIRS = ( 'D:/CODESPACE/PYTHON/Madindo/madindo/apps/templates/apps/', )
In the index.html
{% load static from staticfiles %}