django-staticfiles

STATIC_ROOT setup in Django 1.8

女生的网名这么多〃 提交于 2019-12-22 01:06:52
问题 I was tried n I can't set-up as per official documents... I am attaching IMG here, pls give me suggestions, Where is the problem.enter image description here Or, give me simple steps for it with dictionary tree structure. Thank you. # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static_root', 'static') STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), # '/var/www/static/',

django staticfiles at url root

▼魔方 西西 提交于 2019-12-21 09:35:31
问题 I have a general question about the new Django 1.3 static file framework. I really like the new Django staticfile functionality introduced in Django 1.3. Normally, I set STATIC_URL="/static/" and enter the {{ STATIC_URL }} template tag into my templates. It's great how the development server automatically serves up the static files and all of my content is served up as expected. The {{ STATIC_URL }} would be substituted in the template and might serve up files like this... example.com/static

Amazon Elastic Beanstalk not serving django static files

风流意气都作罢 提交于 2019-12-21 07:12:00
问题 I am trying to put up a simple django app on elastic beanstalk. I thought I had the static parts of the app figured out as it works with heroku and on a server that was set up manually. In debugging I even checked in a pushed the static files in the static directory to try to simplify things. The mapping seems very strange in that it doesn't seem to follow the STATIC_ROOT. My relevant configs: settings.py PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) STATIC_ROOT = os.path.join

South + Django 1.4 Database error

孤者浪人 提交于 2019-12-20 10:24:09
问题 I have just installed my Django project on a new system, and installed Django 1.4. However when I try to run manage.py runserver or manage.py syncdb I get this error from South: Validating models... Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1a67810>> Traceback (most recent call last): File "/home/saul/.virtualenvs/canada/lib/python2.7/site-packages/django/core/management/commands

Django/mod_wsgi OSError: [Errno 13] Permission denied: 'static' when DEBUG = OFF

℡╲_俬逩灬. 提交于 2019-12-19 06:58:11
问题 I have a Django 1.4 application on a Centos 6.2 server (running apache, mysql, php) using mod_wsgi with my project deployed in a virtual env. The application itself is one I've been using for several years on a hosted service and I am now deploying on my own rackspace cloud server. The exact version of the app is running fine elsewhere, so this issue is about how I have deployed it. It's my first python/django deployment - I have set up dozens of LAMP sites previously, so it's my lack of

Does django staticfiles skip the middleware?

那年仲夏 提交于 2019-12-19 05:56:08
问题 I'm running a django 1.4.1 app. I didn't realize that just including django.contrib.staticfiles into INSTALLED_APPS in your settings is enough to get static files served while settings.DEBUG is True, i.e., you don't have to manually add anything to your urls file. I also noticed that this bypasses the django middleware. Does anyone know how or why this happens? I just created a blank new project, my views.py: from django.http import HttpResponse def index(request): html = '<html><body>Logo:

STATIC_ROOT in Django on Server

百般思念 提交于 2019-12-18 12:34:17
问题 I'm 2hours stuck in a issue about STATIC_URL and STATIC_ROOT when I try to make run the webapp on my server at webfactional. when I load the webpage all the requests works well, except by the fact that any link with {{ STATIC_URL}} is working or loading. So a common error that appears on firebug is: GET http://mydomain/static/extras/h5bp/js/libs/modernizr-2.5.3.min.js 500 (Internal Server Error) My setup is: urls.py I did nothing, and there's nothing about static files. settings.py DEBUG =

Django won't refresh staticfiles

≡放荡痞女 提交于 2019-12-17 22:12:22
问题 This is annoying. I have a javascript file referenced on a django template: <script src="{% static 'js/login.js' %} "></script> I made some changes to that js file. Then, I refresh the page and I can't see the changes happen. If I remove the javascript from the file and put it in the HTML, it works correctly, but if I try to do it using the external js file then it doesn't. I have tried closing the server and running runserver several times, I've also tried changing from Firefox to Chrome. It

What's the point of Django's collectstatic?

独自空忆成欢 提交于 2019-12-17 10:18:32
问题 This is probably a stupid question, but it's just not clicking in my head. 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 = 'staticfiles' So when I run the command: python manage.py collectstatic It creates a folder called staticfiles at the

Django 1.4 static file not found error [duplicate]

女生的网名这么多〃 提交于 2019-12-13 22:19:29
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: Trying to serve django static files on development server - not found I just entered the world of Python and django, i am unable to set my URL using the STATIC_URL , i am currently developing locally with django 1.4. I read the django static file doc and seem to have added all what's required, but still get a 404 error. I have read other Q&A on SO related to this, and tried all sorts of things, but could not