<link rel="stylesheet" type="text/css" href="{% static 'css/admin.css' %}"> Not working

When I make the website outside of Django it works perfectly fine. However, when I integrate everything in and put the CSS file in static files, it fails to load. The JavaScript file in the same folder loads perfectly fine. The files being used are: base.html, adminDash.html, admin.js, main.css, and admin.css. The admin.css file is the one specific to adminDash.html and is the one failing to load. Attached are images of all files, what the site should look like, and what it currently looks like. admin.js main.css admin.css adminDash.html base.html what it looks like outside django what it looks like inside django

I have tried running it outside of the django project, changing the file location, got some friends to have a go at it, and got chatGPT to try rewriting it it.

In settings.py include your static file details STATIC_URL = '/static/' STATICFILES_DIRS=[os.path.join(BASE_DIR, 'static'),]

Then run collect static file. python manage.py collectstatic

Then load it in base.html file {% load static %} Hope this will help

Back to Top