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
0
votes
1 answer

Static File Dir django

ive set my STATIC_ROOT dir in my settings.py. The shell print the path right where the files are located. But on rendering template on /comp/xyz the static files wont be loaded. http://127.0.0.1:8000/static/js/jquery.min.js This is the link…
oranj33
  • 123
  • 1
  • 4
  • 11
0
votes
1 answer

Django: specify file paths in a JavaScript file

I have the following directory structure which follows Django's standard: /my_site /my_site /my_app /static /my_app /js a.js b.js c.js …
Randy Tang
  • 4,283
  • 12
  • 54
  • 112
0
votes
1 answer

strange django static file behaviour

I'm getting 404 for static files when DEBUG=False in my settings. The file is served fine when DEBUG=True. I'm looking at the docs and all my configs seem OK to me. # my_settings.py STATIC_ROOT = os.path.join(PROJECT_PATH, 'static') STATIC_URL =…
Rich Tier
  • 9,021
  • 10
  • 48
  • 71
0
votes
1 answer

Django: a custom view inside /static/ directory

Community, I am using Django 1.7. Due to specific nature of the project, I have complicated needs for handling static files. In other words, I need /static/ to be served on development just as usual, but /static/blueprints/ subdirectory should be…
Anatoly Scherbakov
  • 1,672
  • 1
  • 13
  • 20
0
votes
1 answer

Managing Static Files and Templates Django

I have gone through a few tutorials on creating a web application in Django. Based on the different tutorials so far, everyone seems to have a slightly different ways of storing their static files and templates. In one particular tutorial, the…
codemax
  • 1,322
  • 10
  • 19
0
votes
3 answers

Static Files With Django Development Server 1.7 Slightly Different Directory Settings

This is my website directory: django_project \bin \include \lib \src \django_project settings.py \app2 manage.py \static \js \css \media \templates …
Hasan Can Saral
  • 2,950
  • 5
  • 43
  • 78
0
votes
1 answer

Django/Apache static file error: object of type 'NoneType' has no len()

I followed the tutorial on setting up Django with Apache and mod_wsgi (on Windows), but whenever I try to access a static file, I get the following error: TypeError at /static/js/map.js object of type 'NoneType' has no len() This has something to do…
autonomy
  • 1,165
  • 1
  • 12
  • 18
0
votes
1 answer

Can't get django 1.5.8 to serve static files in apps sub-directory

I have followed the doc for Managing static files in django 1.5.8 Make sure that django.contrib.staticfiles is included in your INSTALLED_APPS. Done, and 'django.contrib.staticfiles.finders.AppDirectoriesFinder' is in my STATICFILES_FINDERS In…
Laurent
  • 1,710
  • 4
  • 25
  • 46
0
votes
1 answer

Serve static files in Django. Need explanation

I want to know which way is correct to serve static files in Django. All are working but which one is the best way. I have tried {{ STATIC_URL }} in my templates. Which is working fine. And then {% load static %} and used {% static…
Vaibhav Jain
  • 5,287
  • 10
  • 54
  • 114
0
votes
1 answer

Call django staticfiles tag from inside a view

I'd like to call the staticfiles static tag inside my view, or its equivalent. How can I do that? What I've tried: nothing so far. What I've found: a bunch of questions asking how to call a function inside a template, which is the exact opposite of…
Marcin
  • 48,559
  • 18
  • 128
  • 201
0
votes
0 answers

css missing from some page DEBUG = False django

Hello everybody and thanks in advance for the helpers! I have created a django project and I want to run it on the server in production mode. I have set the setting.py DEBUG = False and suddenly some of my CSS files got "missing". Some of the…
0
votes
1 answer

Confusion with STATIC_ROOT in DjangoProject documentation

I have some confusion with the DjangoProject 1.6 Documentation for STATIC_ROOT The absolute path to the directory where collectstatic will collect static files for deployment. Example: "/var/www/example.com/static/" Does this mean The absolute…
Deepend
  • 4,057
  • 17
  • 60
  • 101
0
votes
0 answers

Django: site loads static files but django admin does not

I have been noticing a weird problem on my site. I have managed to make my regular site load all the static content by defining STATIC_URL and STATIC_ROOT directives. However, when I go to mysite.com/admin, the admin site does not load any css at…
summerNight
  • 1,446
  • 3
  • 25
  • 52
0
votes
4 answers

Django Static Files are not visible

My Django website will not show CSS or JS using the Django static file management My html (live version available here) {% load staticfiles %}
Deepend
  • 4,057
  • 17
  • 60
  • 101
0
votes
1 answer

Location of settings file for deploying static files with Django on Apache2 with mod_wsgi

I am trying to follow the tutorial on Deploying static files on Apache using mod_wsgi from the 1.6 Documentation. I already have a work in progress site deployed on Apache using mod_wsgi but I need to learn how to correctly deploy static files…
Deepend
  • 4,057
  • 17
  • 60
  • 101