I'm attempting to update some javascript files within my projects static
files. I'm noticing that they are not updating accordingly on PythonAnywhere. The changes were pushed to Github. Next I would pull the changes from Github to the console running on PythonAnywhere and run python manage.py collectstatic
. Yet the older static files remain when I check the developer tools in my browsers console. It's seems the files have been cached?
I read the following article on this topic but have had no luck resolving the issue
- https://help.pythonanywhere.com/pages/DebuggingStaticFiles/
Following the steps in that article, I've posted the URL of a JS script that is suppose to be running (AND updated) as an example as a Django View is requested. To verify that changes were pulled, I checked the Files
and they show the updated changes that I made.
The URL which you expect to be able to load the static file from
https://binnybit.pythonanywhere.com/main_static/posts/js/votings.js
The path where this file is stored on disk, in your PythonAnywhere account
/home/binnybit/django_stackoverflow/posts/static/posts/js/votings.js
The relevant static files mapping from the web tab, the values for its URL and path settings
Dashbord - Web tab
- URL -> /main_static/
- Directory -> /home/binnybit/django_stackoverflow/main_static
settings.py
STATIC_ROOT = os.path.join(BASE_DIR, "main_static")
STATIC_URL = '/main_static/'