I've followed the tutorial to deploy with static files. In settings.py:
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_URL = 'static'
STATIC_ROOT = os.path.join(BASE_DIR, "static")
I've collected the static by
collectstatic --> 353 static files copied to '/home/gustavk/LingL/static'
But when I go to any views, I've got an error log:
For example:
Not Found: /text_list/static/lwt/js/ajax_text_list.js
(where the views text_list
got a line: {% static 'lwt/js/ajax_text_list.js %}
)
My solution:
Create a mapping in Web tab, in the STATIC FILES
section:
for example:
/text_list/static /home/gustavk/LingL/static
and now it's working when I go on the text_list
view.
My question: Do I really need to create a mapping for every single view that I have to get the static files right?
Thanks a lot in advance!