django-staticfiles

Static files won't load

Static files won't load Question: I`ve created a new Django project and ran into a problem with static images. So, apparently when i was connecting my css and javascript files with static it worked well, but when i tried to connect images they won’t load. here is my settings.py STATIC_URL = ‘/static/’ STATIC_ROOT = os.path.join(BASE_DIR, …

Total answers: 1

Django / Apache / Ubuntu Static files not being served

Django / Apache / Ubuntu Static files not being served Question: Everything was working fine until I moved from my local PC to a web server (AWS Ubuntu). I am using Apache with WSGI adapter. DEBUG = FALSE so this is a live production environment. I followed all the guides I could and have been …

Total answers: 1

static files not found error in django

static files not found error in django Question: I know that this problem has already been asked several times here. I have searched and read a number of answers but no help. I guess, I am missing something very basic. In my settings.py, I have: STATIC_URL = ‘/static/’ STATIC_ROOT = join(APPS_DIR, “static/”) # STATICFILES_DIRS = …

Total answers: 3

ValueError: Missing staticfiles manifest entry for 'favicon.ico'

ValueError: Missing staticfiles manifest entry for 'favicon.ico' Question: I’m getting a ValueError when running python manage.py test. My project is named fellow_go, and I’m currently working on an App called pickup. Please note that this error is added in a relatively recent commit to Django: Fixed #24452 — Fixed HashedFilesMixin correctness with nested paths.. ====================================================================== …

Total answers: 15

What's the difference between STATIC_URL and STATIC_ROOT in Django?

What's the difference between STATIC_URL and STATIC_ROOT in Django? Question: I’m somewhat confused as to what the difference is between STATIC_URL and STATIC_ROOT in Django’s ‘staticfiles’ app. I believe I understand what the STATIC_ROOT is: it’s essentially the location on the server where the staticfiles’ collectstatic command will place the static files collected from your …

Total answers: 3

What's the point of Django's collectstatic?

What's the point of Django's collectstatic? Question: In Django, the convention is to put all of your static files (i.e css, js) specific to your app into a folder called static. So the structure would look like this: mysite/ manage.py mysite/ –> (settings.py, etc) myapp/ –> (models.py, views.py, etc) static/ In mysite/settings.py I have: STATIC_ROOT …

Total answers: 4

Invalid block tag: 'static'

Invalid block tag: 'static' Question: Server returned TemplateSyntaxError at / Invalid block tag: ‘static’ on this line: <img src=”{% static ‘icon/logo.png’ %}”>. The whold html file is like this (it’s an html file {% include %}ed by another one): {% load staticfiles %} <div class=”header”> <nav> <ul class=”nav nav-pills pull-right”> <li role=”presentation”><a href=”{% url ‘offer …

Total answers: 10

Differences between STATICFILES_DIR, STATIC_ROOT and MEDIA_ROOT

Differences between STATICFILES_DIR, STATIC_ROOT and MEDIA_ROOT Question: What are the differences of these three static url? I am not sure if I am right, I am using the MEDIA_ROOT to store my uploaded photos (via models.ImageField()) However, I created a JS script to my admin and in admin.py. I defined the media as below: …. …

Total answers: 4