django-staticfiles

Django uwsgi Nginx not serving media files

三世轮回 提交于 2019-12-25 03:44:51
问题 Edit: I've made some progress trouble shooting this issue. For an update on the situation, read the comments and view this post on ServerFault: https://serverfault.com/questions/690836/django-uwsgi-nginx-not-serving-media-files-django-returns-404-status-code?noredirect=1#comment851441_690836 I'm following this tutorial: http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html Everything was going well until I reached the "Basic nginx test" section. When I stopped and

Not able to find static file path page redirect to another page

偶尔善良 提交于 2019-12-24 16:31:06
问题 When first time index page load it give static file path: [04/May/2015 09:16:22] "GET / HTTP/1.1" 200 3536 [04/May/2015 09:16:22] "GET /static/css/bootstrap.min.css HTTP/1.1" 304 0 [04/May/2015 09:16:22] "GET /static/js/jquery.js HTTP/1.1" 304 0 [04/May/2015 09:16:22] "GET /static/js/bootstrap.min.js HTTP/1.1" 304 0 [04/May/2015 09:16:22] "GET /static/css/simple-sidebar.css HTTP/1.1" 304 After click on hyperlink it redirect to another page static file path change to: [04/May/2015 10:24:11]

Receiving 404 error when trying to load static urls directly in Django

♀尐吖头ヾ 提交于 2019-12-24 15:25:26
问题 When I visit the url of my static files (http://127.0.0.1:8000/site_media/static/css/site_base.css) I receive a 404 error message. 404 from the log [27/Oct/2012 14:14:54] "GET /site_media/static/js/libs/modernizr-2.5.2.min.js HTTP/1.1" 404 1716 [27/Oct/2012 14:34:20] "GET /site_media/static/css/site_base.css HTTP/1.1" 404 1677 Directory Structure mysite |-- manage.py |-- mysite |-- settings |-- base.py |-- dev.py |-- prod.py |-- site_media |-- static |-- css |-- site_base.css site_base.html

AWS S3 Access Denied Error

北战南征 提交于 2019-12-24 13:10:14
问题 I am getting access denied error when I try to open a file I have hosted on my S3 bucket. When my Django app tries to get the same file I get 403 Forbidden Error on my console. I have made all the files public but still no luck. I am getting this when I open a link to a file. <Error> <Code>AccessDenied</Code> <Message>Access Denied</Message> <RequestId>D4FCD94BD9DEE9F8</RequestId> <HostId> J9RtjMA4wk8kL4f+Ye/6XAQaXrfi9lz5HZ1tWRut8E5Qf/b8RAQbAF/fp3j2bep8Jfd+dtim/fs= </HostId> </Error> My CORS

Media files are served, static files aren't

早过忘川 提交于 2019-12-24 11:29:31
问题 I'm stuck due to an evergreen issue, static files not served. Conversely the files placed in the MEDIA_ROOT subtree get served correctly under MEDIA_URL . Stripped settings.py : DEBUG = True STATIC_URL = '/static/' STATIC_ROOT = '/home/foo/devel/static' MEDIA_URL = '/media/' MEDIA_ROOT = '/home/foo/devel/media' # the following is deprecated but is it seems grappelly requires it ADMIN_MEDIA_PREFIX = STATIC_URL + "grappelli/" STATIC_FILES = () STATICFILES_FINDERS = ( 'django.contrib.staticfiles

AWS S3 Url changing dynamically with django statics

老子叫甜甜 提交于 2019-12-24 10:45:06
问题 When I am serving static files from AWS S3 using the {%static %} template I get this type of url: https://elasticbeanstalk-eu-west-1-2548513.s3.amazonaws.com/css/7aa4edf0c543.css?Signature=lpSpJuyv55JwkjxGKnNVmfn5QKs%3D&Expires=1370880855&AWSAccessKeyId=AKIAIDOQ45S6OQCXGNYQ Well the signature changes everytime. So when I am using django_storages with offline compression the key for that file is changing everytime because its name is changing so I get the error: You have offline compression

Why does Dajaxice and Dajax uses MEDIAL_URL?

浪尽此生 提交于 2019-12-24 02:24:25
问题 In Dajaxice's installation documentation, it says to set DAJAXICE_MEDIA_PREFIX in settings.py . Later that value is retrieved in the urls.py . In Dajax's installation documentation (which is 2 years old), it says to load the static file like this: <script src="{{ MEDIA_URL }}/js/prototype.dajax.core.js.js" type="text/javascript" charset="utf-8"></script> Why is it using MEDIA_URL ? Shouldn't it be using STATIC_URL since js , css , and img files should be STATIC ? 回答1: You're right, their docs

Django Static Root 404 Error

泄露秘密 提交于 2019-12-23 19:48:56
问题 Right now I am trying to connect my django project html files to static files but keep getting 404 errors. My Project is organized as src admin homePage media static homepage css images fonts js templates in my settings file i have STATIC_URL = "/static/" STATIC_ROOT = os.path.join(BASE_DIR, "static") STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'myProjectName/static'), ) and in my html file {% static "home/css/bootstrap.css"%} Why do I keep getting 404 errors ? Thank you for your time. 回答1:

apache server cant find static files in Django project

做~自己de王妃 提交于 2019-12-23 15:54:17
问题 I'm trying to upload my code on an apache server using mod_python. I have tried a lot but the server is not able to access my static files (all my images, js and css). Here are my Virtualhost settings: <VirtualHost *:80> ServerName mysite.com ServerAlias www.mysite.com Alias /static/ /home/mysite/products/static/ # RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.mysite\.com RewriteRule (.*) http://mysite.com$1 [R=301,L] # DocumentRoot /home <Directory /home/mysite/> SetHandler mod_python

django static file not loading

白昼怎懂夜的黑 提交于 2019-12-22 10:48:35
问题 I have problem that i done every thing as described in tutorial https://docs.djangoproject.com/en/1.5/intro/tutorial06/ and every thing also running fine but css,images are not showing their effects. Being a new one on django, Suggestions required. thanks for any help. My css file:- li a { color: red; } body { background: white url("images/background.gif") no-repeat right bottom; } url.py file:- from django.conf import settings from django.conf.urls.static import static from django.conf.urls