django-staticfiles

Django give Error 500 for all static files like CSS and Images, when DEBUG is False

点点圈 提交于 2020-12-21 04:05:47
问题 I've tried different solutions already posted by users, but they didn't work for me. settings.py of Project BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = False ALLOWED_HOSTS = ["*"] STATIC_URL = '/static/' STATICFILES_DIRS=[ os.path.join(BASE_DIR,'static') ] STATIC_ROOT=os.path.join(BASE_DIR,'assets') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR,'media') All my CSS files are in style folder inside the static folder. And all images are in the media

Django give Error 500 for all static files like CSS and Images, when DEBUG is False

旧城冷巷雨未停 提交于 2020-12-21 04:05:33
问题 I've tried different solutions already posted by users, but they didn't work for me. settings.py of Project BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = False ALLOWED_HOSTS = ["*"] STATIC_URL = '/static/' STATICFILES_DIRS=[ os.path.join(BASE_DIR,'static') ] STATIC_ROOT=os.path.join(BASE_DIR,'assets') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR,'media') All my CSS files are in style folder inside the static folder. And all images are in the media

Django give Error 500 for all static files like CSS and Images, when DEBUG is False

痞子三分冷 提交于 2020-12-21 04:04:56
问题 I've tried different solutions already posted by users, but they didn't work for me. settings.py of Project BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = False ALLOWED_HOSTS = ["*"] STATIC_URL = '/static/' STATICFILES_DIRS=[ os.path.join(BASE_DIR,'static') ] STATIC_ROOT=os.path.join(BASE_DIR,'assets') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR,'media') All my CSS files are in style folder inside the static folder. And all images are in the media

Django doesn't load static files ValueError(“Missing staticfiles manifest entry for '%s'” % clean_name)

限于喜欢 提交于 2020-12-10 08:47:39
问题 is my first app in Django and I am trying to prepare my Django (2.0) application for production, but I am unable to make the static files load properly using WhiteNoise I keep having all the time the next error in my log ValueError("Missing staticfiles manifest entry for '%s'" % clean_name) ValueError: Missing staticfiles manifest entry for 'css/inicio.css' [02/Jun/2018 14:40:37] ERROR [django.server:124] "GET /participation/prueba HTTP/1.1" 500 27 I have the following settings.py ... DEBUG

Heroku doesn't collect static on Django but tell that it does

拈花ヽ惹草 提交于 2020-08-10 19:15:54
问题 Command heroku run python manage.py collectstatic returns me something like 163 static files copied to '/app/live-static-files/static-root', 509 post-processed. Here are my settings: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', # White Noise 'django.contrib.sessions.middleware.SessionMiddleware', ... ] STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, "live-static-files", "static-root") STATICFILES_STORAGE =

Django: External JS using framework doesn't load

家住魔仙堡 提交于 2020-07-11 03:26:45
问题 I have these JS files that runs just fine on local host server using WAMP Server. However when I put these files into my templates in Django then nothing loads. index.html template {% load staticfiles %} <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Phaser - Making your first game, part 1</title> <script type="text/javascript" src="{% static 'game/js/game.js' %}"></script> </head> <body> And this is game.js (using Phaser.io framework) var game = new Phaser.Game(1000,