I am working on my Windows Machine, trying to develop multiple apps for a project called "portal". After working on it, I have set DEBUG=False, and now all my static files are giving me a 404 error after loading any page. When running python manage.py runserver
in CMD, I get this when loading a page:
[02/Dec/2018 14:10:14] "GET /account/sign-in HTTP/1.1" 200 6249
[02/Dec/2018 14:10:14] "GET /static/fonts/fonts.css HTTP/1.1" 404 96
[02/Dec/2018 14:10:14] "GET /static/css/argon.css HTTP/1.1" 404 94
[02/Dec/2018 14:10:14] "GET /static/branding/logo.png HTTP/1.1" 404 98
I have looked at over 20+ posts about this which were mostly the same and I have followed all of their steps, such as:
- I have set these in my settings.py file:
STATIC_URL = '/static/'
,STATICFILES_DIRS = ['portal/static/']
(I have a static folder in the folder that holds files like settings.py), andSTATIC_ROOT = os.path.join(BASE_DIR, "static")
- I have called
python manage.py collectstatic
I have even created a new Django test project and did all these steps above, and they ARE working for that new test project. I have even removed all files in __pycache__
and reset my migrations, and database files.
Are there any other possible secure (I have seen others use cheats such as --insecure) solutions to fix my project so it can go into production other than the other solutions above?