I have a django 1.3 based frontend and it serves all the static files from Amazon S3. I am wishing to upgrade to Django 1.4. It seems that Django has changed the way admin static files are rendered. I have the following configuration:
settings.py: I have the app django.contrib.staticfiles in INSTALLED_APPS (in both 'dev' and 'prod' settings). The static content is live on Amazon S3.
I am testing changes on my dev machine (DEBUG=True), but the /admin page is not able to render the static files and icons. That is because it is trying to pull stuff from S3 (because django.contrib.staticfiles is installed), but not pulling in from the dev django folders. Is there a way in which I can force the content out from dev folders when DEBUG = True rather than pulling in from S3?
Try setting STATIC_URL
based on DEBUG
:
if DEBUG:
STATIC_URL = "/static/"
else:
STATIC_URL = "http://external.domain.com/"
Then make sure you've added the static files url patterns to your url config