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

TemplateSyntaxError 'staticfiles' is not a valid tag library'

I'm having a really strange issue trying to get the staticfiles taglib working in my application. I'm essentially getting the following error: 'staticfiles' is not a valid tag library: Template library staticfiles not found, tried…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
10
votes
3 answers

Django can't find staticfiles with Debug=False and Allowed_Hosts

Hi all I'm having trouble solving this issue: If I turn DEBUG to False, I can't run manage.py runserver: CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False Then, let's say I add something to ALLOWED_HOSTS: ALLOWED_HOSTS =…
Alejandro Veintimilla
  • 10,743
  • 23
  • 91
  • 180
10
votes
1 answer

django-pipeline - Page load really slow

I am trying django-pipeline in order to minify static resources, use cache for them and make my templates simpler. My CSS and JS files are found and loaded by my browser but it takes about 10 seconds for my (very simple) home page to load. I am…
Q Caron
  • 952
  • 13
  • 26
10
votes
7 answers

Django: serving static file on debug=false

I know this question was asked many times, but none of the answers i found and tried helped me. Those are my static files settings: STATIC_ROOT = os.path.abspath(SETTINGS_PATH+'/staticfiles/') # URL prefix for static files. # Example:…
Neara
  • 3,693
  • 7
  • 29
  • 40
10
votes
2 answers

Isn't it unsafe to expose django media_url to everyone?

According to Django document: "it was common to place static assets in MEDIA_ROOT along with user-uploaded files, and serve them both at MEDIA_URL. " Does that mean everyone could access other people's uploaded files? Isn't it unsafe?
yejinxin
  • 586
  • 1
  • 3
  • 13
10
votes
3 answers

django staticfiles at url root

I have a general question about the new Django 1.3 static file framework. I really like the new Django staticfile functionality introduced in Django 1.3. Normally, I set STATIC_URL="/static/" and enter the {{ STATIC_URL }} template tag into my…
Joe J
  • 9,985
  • 16
  • 68
  • 100
9
votes
1 answer

Django: Only collect changed static files

I'm using amazon s3 to store all of my static files (via django-storages) and it costs a lot more money to do PUTs than it does GETs. When I run manage.py collectstatic, Django does a PUT for every single static file I have. Is there a way to have…
Kurtis Nusbaum
  • 30,445
  • 13
  • 78
  • 102
9
votes
2 answers

background image in css style from static files with django

I used this template to create a home page in a django project, however I can't have the background image displayed correctly (bg.jpg) The background image is used as foollows in the css file : .wrapper.style3 { background-color: #000; …
Boidot
  • 363
  • 1
  • 6
  • 18
9
votes
4 answers

Django: Static Image won't load

I have been following the official documentation to the letter, trying some of the advice for related questions on here, and just searching the web in general and I am still having no luck getting one little image to load. I have an image called…
rawa
  • 315
  • 3
  • 8
  • 20
9
votes
1 answer

Use the same static file into multiple apps in Django

My Django project is divided into several apps, and the static files are stored in each app like this: /Project /foo /static /css /style.css /views.py /models.py /urls.py /bar /static …
Ryan Rho
  • 515
  • 5
  • 18
8
votes
4 answers

Django app on Azure not getting static files

Got my Django project on a Azure webapp, but when I call on SSH terminal: Python manage.py collectstatic It says 252 files copied but my static files are not visible on my templates and static folder in wwwroot its empty...Here's my wwwroot…
jsanchezs
  • 1,992
  • 3
  • 25
  • 51
8
votes
2 answers

Django load ES6 javascript file

I would like to use the import feature in ES6 in index.html in django. I do not want to compile to ES5 for browser compatibility. I would like to assume that all the users will have ES6 compatible browsers. Therefore I do not need a ES6 to ES5…
8
votes
1 answer

Django how to use npm modules with static/ templates

I have recently added npm to my project in order to keep better track of my js dependencies. Previously I have just been git cloning to my static/vendor folder. I've also added gulp , but have only got it doing hello world things right now. It seems…
Kermit
  • 4,922
  • 4
  • 42
  • 74
8
votes
3 answers

Django - Load static files from another app

In app1 I am trying to load static files from app2. I set no STATICFILES_FINDERS in project settings.py, which means, Django will use default AppDirectoriesFinder when it finds static subdirectory inside app directory. Problem: In template files of…
Fusion
  • 5,046
  • 5
  • 42
  • 51
8
votes
1 answer

Django, uwsgi static files not being served even after collectstatic

I'm having trouble with the deployment of a Django application on a Debian 8 VPS. Python version 2.7, Django 1.10.2. My problem is that it will not serve static files in production mode (DEBUG = False) even after having run 'collectstatic' and…
beerandsmiles
  • 134
  • 3
  • 12