Questions tagged [django-static]
113 questions
1
vote
2 answers
How to connect css/js files to my Django Project?
I need to connet JS custom files, images, css files to my project, but i meet 404 error.
REQ
asgiref==3.6.0
Django==4.1.4
sqlparse==0.4.3
tzdata==2022.7
MY DIR
enter image description here
MY SETTINGS
INSTALLED_APPS = [
…

pshpth_ sht
- 11
- 3
1
vote
2 answers
Django 3.2.8: 0 static files copied to '/static'
This error occurs when performing command python manage.py collectstatic:
0 static files copied to '/home/project'.
That means there is no changes and my static files already exist in the destination but in this folder only one file:
static/
…

Saeed
- 3,294
- 5
- 35
- 52
1
vote
4 answers
Why static files are not loading? | Django
I'm trying to load static files, but it's showing following error:
GET http://127.0.0.1:8000/static/css/user/style.css net::ERR_ABORTED 404 (Not Found) - home:25
GET http://127.0.0.1:8000/static/css/user/style.css 404 (Not Found) - home:25
GET…

Qasim Iftikhar
- 21
- 1
- 5
1
vote
2 answers
Django Not showing Static Images but shows its alternative text(alt) by displaying["GET /static/image/down.jpg HTTP/1.1" 404 1771] in console window
I just simply want to show my static image in template.
I have looked every possible ways to solve this issue and try various approaches but could not get my static images in template. The alternative text of the respective image is shown but image…

Muneeba
- 49
- 1
- 5
1
vote
2 answers
Django - Is My Static File in the Wrong Place?
I'm creating a project for a weather app with Django, and I think my Javascript file is in the wrong place. I have it in a static folder.
But I'm getting the console error GET http://127.0.0.1:8000/static/capstone/capstone.js net::ERR_ABORTED 404…

user14567126
- 313
- 3
- 12
1
vote
1 answer
Do we need to add files (in the folder) that White Noise creates to the gitignore list?
I have a django project and using whitenoise for static files serving.
When we run py manage.py collectstatic whitenoise, that create lot of files in selected folder in STATIC_ROOT object of settings.py file.
It takes up a lot of volume.
Do I have…

Ali Nazari
- 43
- 1
- 6
1
vote
1 answer
Django is not serving staticfiles
I would like to use django staticfiles, but unfortunately I can't get it to serve to images locally.
This is what I have done so far:
settings.py:
INSTALLED_APPS =…

David
- 646
- 1
- 7
- 27
1
vote
2 answers
custom static files not loading in django project
I have a django project where I have kept all the static files in a project level static directory.
I have included
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
in the settings.py. ALso I have added +…

Kush
- 644
- 1
- 12
- 30
1
vote
1 answer
why I can not in folder static inside app for project django
I can't get access to the STATIC folder for my Django project.
Here's my project structure.
-myproject
--core
--settings.py
--myapp
--static
--------myapp
---- js
---- css
--templates
--static
In settings.py:
STATIC_URL =…

CodeView
- 498
- 3
- 14
1
vote
2 answers
How do I serve static files and dynamic files in Django 1.3 development urls?
I'm a little stumped. In development, I'm trying to serve both static AND dynamic files for my app in DJango 1.3. I love the new static features, but I can't seem to get this to work properly.
When I read the docs, it looks like the following should…

Dave Merwin
- 1,382
- 2
- 22
- 44
1
vote
1 answer
How to convert a div css line to django template line for this particular line?
I want to convert a particular template line containing and inline css into django template line which will show the static files too. The template line is
1
vote
1 answer
django: how to load the static files with hash/md5 appending correctly?
using Django 3
I followed the Django Doc
https://docs.djangoproject.com/en/3.0/ref/contrib/staticfiles/#manifeststaticfilesstorage
to export my static files with a hash appending.
settings.py production
STATICFILES_STORAGE =…

black_hole_sun
- 908
- 11
- 41
1
vote
1 answer
Django: How to set a new static path in production?
working with django 3.0.5, but i guess this relates also to < django
2.0.
I uploaded my first django app on my providers space, so far everything works.
This is a Server Schema of my Provider...
_
(` ).
( ). …

black_hole_sun
- 908
- 11
- 41
1
vote
1 answer
Static files don't load in django login.html
My problem: static files in django can't load in my login.html. For example, it perfectly loads in my index.html, but not in login.html. I've tried everything: changing settings, urls, nothing works.
Here is the code for login.html:
{% load static…

Artemii Chirkov
- 11
- 1
1
vote
0 answers
Can use app specific static files fine, cannot get static files under project root to load
So I have two apps (account and job). Each app has its own respective app_name/templates/app_name and app_name/static/app_name directories.
With the following static related settings:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,…

Justin
- 1,329
- 3
- 16
- 25