Questions tagged [django-static]

113 questions
3
votes
1 answer

Javascript module management in Django (closed)

I am working on a project that has multiple .js file for containing different functions. I want to use the function from M1.js in M2.js and what I am doing is exporting the function from M1.js and importing in M2.js. The export works fine, but the…
3
votes
3 answers

How can i fix the error Uncaught ReferenceError: addEvent is not defined

After changing my python and Django version I came up with the error of Uncaught ReferenceError: addEvent is not defined. The error took place at my DateTimeShortcuts.js file. The code raising the error is: addEvent(window, 'load',…
gtopal
  • 544
  • 1
  • 9
  • 35
3
votes
3 answers

ValueError: Missing staticfiles manifest entry for 'favicon.png' when DEBUG = False

raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name) ValueError: Missing staticfiles manifest entry for 'favicon.png' when DEBUG = False I only get this error when DEBUG = False, I do not get any error when DEBUG = True To…
Padoga
  • 495
  • 3
  • 18
3
votes
2 answers

Django stops serving static files when DEBUG is False

I use Docker Compose along with this Dockerfile that copies the static folder into /static: FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code COPY requirements.txt /code/ RUN pip install --upgrade pip && pip install -r…
4m1nh4j1
  • 4,289
  • 16
  • 62
  • 104
3
votes
1 answer

(django) static file for the whole project

When I use {% load static %} and then add an image like this to my template: I only get the image if it's stored in a direction called static which is in the same app. But I want to use the logo for the whole…
Asqiir
  • 607
  • 1
  • 8
  • 23
3
votes
1 answer

OSError at /admin/pages/richtextpage/3/ [Errno 13] Permission denied: '/static'

I am creating pages from admin in mezzanine and in description of page I want to show some images but when I am giving the images path and trying to save it , the page is throwing this error. OSError at /admin/pages/richtextpage/3/ [Errno 13]…
Inforian
  • 1,716
  • 5
  • 21
  • 42
2
votes
3 answers

Is there a better way to load Django static directories for multiple apps than this? Thank you

I currently have the following in settings.py: STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') #add app-specific static directory STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'project/static'), …
2
votes
2 answers

Serving static files from the project directory in Django

I have the following project structure: myproject - myapp - manage.py - myproject - settings.py - urls.py ... - static - templates I want to serve all my static files from within this static folder.…
darkhorse
  • 8,192
  • 21
  • 72
  • 148
2
votes
1 answer

Django - manage.py collectstatic saving to the wrong folder

Update: looks like this is being cause by the django-heroku package and specifically the inherited whitenoise package, which in docs says your supposed to put STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') at the end of settings file, which I…
Padoga
  • 495
  • 3
  • 18
2
votes
1 answer

Django Debug False server 500, ValueError The file 'css/styles.css' could not be found

Today I deployed my project on a hosting server and since I have DEBUG = False I have an internal server error too. The full report is: /storage.py", line 280, in stored_name cache_name = self.clean_name(self.hashed_name(name)) File…
noob-py
  • 63
  • 8
2
votes
3 answers

Not getting static files with django & heroku deployment

I'm developing a webapp with Django 1.7 (project_name is "sonata") and the project layout from the "Two scoops of Django 1.6", so I have a 3-tier basic folder tree. . ├── docs ├── requirements ├── scripts └── sonata ├── person │   └──…
madtyn
  • 1,469
  • 27
  • 55
2
votes
1 answer

How to import dajaxice?

I'm a nooby to django and I tried many hours to get a simple example of dajaxice running, but I don't seem to find the right way to look for the files. I did and redid installation and tried to find answers in the numerous similar questions on…
kmgrds
  • 131
  • 2
  • 13
2
votes
2 answers

How to make STATIC_URL work in external JS Files (Django)

I am trying to use STATIC_URL in external javascript file. I was expecting the result as it is working in template, but I found that it is not working in external Javascript file. Please also tell me some work around to make STATIC_URL work in…
1
vote
1 answer

how to enable /static/css URL enable in django

When I use MEDIA_URL or STATIC_URL to point to /static/ currently set MEDIA_URL to /static/ and using it in a path to CSS file like: It points to /static/css.css, but trying…
Hafiz
  • 4,187
  • 12
  • 58
  • 111
1
vote
3 answers

Django Static compressed files not rendering on Firefox

I am using django-static for optimization of static stylesheets and javascripts. Now all these scripts and css properties are being loaded in Chrome and on Safari. But for some reason they are not loading in Firefox. Am i doing something wrong? Does…
Akamad007
  • 1,551
  • 3
  • 22
  • 38