ValueError: Missing staticfiles manifest entry for ‘favicon.ico’

Try running: python manage.py collectstatic Does the test work now? If so, this might be the configuration causing a problem: STATICFILES_STORAGE = ‘whitenoise.django.GzipManifestStaticFilesStorage’ as of whitenoise v4 this will fail and you should use: STATICFILES_STORAGE = ‘whitenoise.storage.CompressedManifestStaticFilesStorage’ Related: https://stackoverflow.com/a/32347324/2596187 Check out the Django documentation: https://docs.djangoproject.com/en/1.11/ref/contrib/staticfiles/#django.contrib.staticfiles.storage.ManifestStaticFilesStorage.manifest_strict

django 1.5 – How to use variables inside static tag

You should be able to concatenate strings with the add template filter: {% with ‘assets/flags/’|add:request.LANGUAGE_CODE|add:’.gif’ as image_static %} {% static image_static %} {% endwith %} What you are trying to do doesn’t work with the static template tag because it takes either a string or a variable only: {% static “myapp/css/base.css” %} {% static variable_with_path … Read more

Difference between static STATIC_URL and STATIC_ROOT on Django

STATIC_ROOT The absolute path to the directory where ./manage.py collectstatic will collect static files for deployment. Example: STATIC_ROOT=”/var/www/example.com/static/” now the command ./manage.py collectstatic will copy all the static files(ie in static folder in your apps, static files in all paths) to the directory /var/www/example.com/static/. now you only need to serve this directory on apache or … Read more

django html template can’t find static css and js files

Some of settings are misused: STATIC_URL = ‘/static/’ – this is fine STATIC_ROOT = ‘/vira_app/template’ – nope, this is supposed to be some folder not really related to the project structure. In the end, on prod it can be a CDN URL or a folder on different server. So try changing it to something like … Read more

Differences between STATICFILES_DIR, STATIC_ROOT and MEDIA_ROOT

Development STATIC_ROOT is useless during development, it’s only required for deployment. While in development, STATIC_ROOT does nothing. You don’t even need to set it. Django looks for static files inside each app’s directory (myProject/appName/static) and serves them automatically. This is the magic done by manage.py runserver when DEBUG=True. Deployment When your project goes live, things … Read more