django-staticfiles

Django admin not serving static files on Apache

流过昼夜 提交于 2020-01-07 02:49:03
问题 I've seen similar questions but they are more than 4 years old and the answers doesn't work anymore. I have a site that works correctly on Apache, except for the admin staticfiles. The staticfiles work fine with Django's runserver. I'm kind of lost here, any advice will help. 回答1: When you serve static files using apache, static folder is supposed to be in your /var/www/html directory. I had gone through same scenario as yours. collectstatic didnt work for me. What I did was, copied static

Django ValueError: Missing staticfiles manifest entry, but the manifest appears to show the entry

为君一笑 提交于 2020-01-05 08:29:16
问题 On a Django 1.11 app deployed to Heroku. When loading the root URL / (and I presume when Django gets to {% static 'angular/angular.min.js' %} in the homepage.html template) I get the following error: ValueError: Missing staticfiles manifest entry for 'angular/angular.min.js' File "django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File

Performance hits from loading Django static tag multiple times

泄露秘密 提交于 2020-01-04 06:07:34
问题 Unless I am doing things wrong, it seems like if you have nested templates (i.e., {% include %} a template within a template), you will sometimes need to call {% load static %} in multiple "layers" of the nest. For example, say I have templateA.html : {% load static %} <a href={% static "some/path" %}>Some Link</a> {% include 'templateB.html' %} And then in `templateB.html, I have: {% load static %} <a href={% static "some/other/path" %}>Some Other Link</a> As far as I can tell from testing,

Django Static js files not working

孤人 提交于 2020-01-02 07:00:34
问题 Well my template code. <!DOCTYPE html> <html> <head> {% load staticfiles %} <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript" src="{% static 'website/staffaddproblem.js' %}"></script> <title>Dashboard</title> <link href="{% static 'website/style.css' %}" rel="stylesheet" type="text/css"/> </head> <body> body </body> <html> As you can see it has a css file. which is working properly, but java script file does not work.

Files served unbearably slow from amazon s3

痴心易碎 提交于 2020-01-01 05:48:09
问题 I have a django app on heroku which serves the static files from amazon s3 bucket. I use boto library and followed the guide on the website. What can I do to speed up the file transfers? Some of the code: DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' AWS_ACCESS_KEY_ID = 'xxxx' AWS_SECRET_ACCESS_KEY = 'xxxx' AWS_STORAGE_BUCKET_NAME = 'boxitwebservicebucket' STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' STATIC_URL = 'http://' + AWS_STORAGE_BUCKET_NAME + '.s3

Invalid block tag: 'static'

余生颓废 提交于 2020-01-01 03:55:05
问题 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 rank' %}">潮品榜</a></li> <li role="presentation"><a href="{% url 'user rank' %}">达人榜</a></li> <li role="presentation"><a href="#" data-toggle="modal"

Static files not found - Deploying Django on Heroku

时光毁灭记忆、已成空白 提交于 2019-12-30 11:13:29
问题 I am trying to deploy a Django site on Heroku, but I'm running into problems getting the app to locate my static files. I have used python manage.py collectstatic to collect my static files into a staticfiles folder, but my app still doesn't seem to be able to find them. I continue to get errors like this in my log: I'm not sure if I am referencing the paths properly. The path's that are set to images/stylesheets/scripts in the code are using the path to the original static folder used in

Static files not found - Deploying Django on Heroku

青春壹個敷衍的年華 提交于 2019-12-30 11:13:10
问题 I am trying to deploy a Django site on Heroku, but I'm running into problems getting the app to locate my static files. I have used python manage.py collectstatic to collect my static files into a staticfiles folder, but my app still doesn't seem to be able to find them. I continue to get errors like this in my log: I'm not sure if I am referencing the paths properly. The path's that are set to images/stylesheets/scripts in the code are using the path to the original static folder used in

Heroku static files not loading, Django

纵然是瞬间 提交于 2019-12-30 07:44:33
问题 I'm trying to push my Django project to Heroku, but it isn't loading the staticfiles. I used this to setup the things, everything is fine but I'm not able to fix the issue with static files. My directory structure is like this help_the_needy help_the_needy __init__.py settings.py urls.py views.py wsgi.py manage.py Procfile requirements.txt static css font-awesome fonts img js templates base.html display_list2.html index.html Here is the complete code (all files). This is my settings.py. I

Django Model: ValueError: Missing staticfiles manifest entry for “file_name.ext”

久未见 提交于 2019-12-29 09:37:20
问题 Before you mark it as duplicate, I have read ValueError: Missing staticfiles manifest entry for 'favicon.ico' , and it does not solve my problem. I have the following model: from django.contrib.staticfiles.templatetags.staticfiles import static class Profile(models.Model): user = models.ForeignKey(SocialUser, on_delete=models.PROTECT) avatar_url = models.URLField( default=static('pledges/images/no-profile-photo.png')) I am using Codeship for CI, and when I run: $ python manage.py