Questions tagged [django-staticfiles]

A Django app that provides helpers for serving static files.

django-staticfiles is a Django app that provides helpers for serving static files.

1241 questions
-1
votes
1 answer

Why 404 error occurs even though I have set STATIC_ROOT and urls.py

I don't know why, but I get 404 errors when trying to use static file like this: {% static 'js/some.js' %}. Here's my urls.py urlpatterns = [ path('admin/', admin.site.urls), path("account/", include("account.urls")), path("",…
user16987274
-1
votes
1 answer

Invalid block tag 'Static...' Django 3.1

I hope my message finds you well. I have this error: Invalid block tag on line 8: 'Static'/Style/style.css''. I followed all the solutions I found here and it didn't work.
Mim5
  • 1
-1
votes
1 answer

My static files in django are not getting reloaded unless i rename them every time i reboot my pc

I am trying to work on a django project which has static files. Every time I reload my pc and make some changes in the static files those changes don't get applied. Then i rename that static file and also change the static url in my template..Then…
user14038734
-1
votes
1 answer

{% extends 'base.html' %} doesn't loaded in django

I am working on a one page website, and try to disect each section to different html file, and now the base.html that contain css, js file don't want to load. Instead, it returns "Invalid block tag on line 21: 'static', expected 'endblock'. Did you…
arkur
  • 1
  • 3
-1
votes
2 answers

Why we serve static and media files using webserver in production not with Django?

Every web developer and programmer said that if you are working on Django project never serve your static and media files using Django on the production environment, always use webserver like Apache or Nginx to serve these files. Actually I get so…
-1
votes
1 answer

Django Static files cached

My site is in production and whenever I modify my static files it doesn't reflect changes as it seems to be cached somewhere, though I can see the see changes when fresh from network tab in "inspect". My question is how can I force Django to do it…
Sean
  • 79
  • 1
  • 10
-1
votes
1 answer

Django 2.2 staticfiles don't work in production (DEBUG False)

I'm making a new django app where a user can upload images and then they can be displayed on a page. I have read the django staticfiles deployment docs a bunch and don't understand why they still dont work. All my images are going to where they're…
Lumiobyte
  • 65
  • 1
  • 8
-1
votes
1 answer

More that one path for static files with django on IIS

With django (python server) is possible to add more that one path to serve static files using STATICFILES_DIRS = ("C:/some/path/static_two",) on settings file, and works fine, but on production server, in my case IIS, is that possible? I tried…
M. Gar
  • 889
  • 4
  • 16
  • 33
-1
votes
5 answers

django angular load static files - image in assets folder get 404

i have a assets/image folder in angular src folder and i left all of my images there, i have many component and child component that are using that images like , i build my angular app and place all files to…
devmrh
  • 1,171
  • 4
  • 19
  • 46
-1
votes
2 answers

Static files not loading on Heroku : Django 1.6

I am deploying my Django application on Heroku. It has been deployed successfully. But static files are not loading. I followed this link, but when Whitenoise 3.x is included, the command python manage.py collectstatic --noinput fails. my…
Rakmo
  • 1,926
  • 3
  • 19
  • 37
-1
votes
1 answer

cannot loading custom CSS in Django ontop of Bootstrap

I am able to load my static images, however; when it comes to loading my custom css sheets I cannot seem to get it working. Because my static images are loading, I believe that my settings.py is set up properly, however, I could be wrong. My static…
salty_coffee
  • 631
  • 1
  • 10
  • 22
-1
votes
1 answer

Django : Cant include static files in webpage

I know there are a few questions like this, but none of them have worked for me. I have django version 1.9.2. The documentation was not of much help wither as i found it quite confusing. Here is my set up myApp- static- myApp- …
AbtPst
  • 7,778
  • 17
  • 91
  • 172
-1
votes
1 answer

access a file with a specific link in django

In Django, I have a file foo.txt in my static folder, which can be accessed through www.example.com/static/foo.txt. How would it be possible to access this file by simple doing www.example.com/foo.txt? (without redirections) thanks in advance!
Ruben
  • 23
  • 2
-1
votes
3 answers

css in django templates

I have a problem using css in my django template, In my settings.py i have this : BASE_DIR = os.path.abspath(os.path.dirname(__file__) + '/') STATIC_URL = BASE_DIR + '/static/' In my paths I have the folder "static/css/home_css.css" In my template…
rayashi
  • 1,721
  • 3
  • 20
  • 28
-1
votes
3 answers

Django and it's weird way of dealing with css, js and images

My question: Can I simply ignore all of that nonsense of static, media, collectstatic and god knows what and simply link my css, img and my js files normally? Take the admin files as for an example. I copied the templates into my projects template…
1 2 3
82
83