I have a Django app. Recently I have transferred my static files to Rackspace Cloud Files and serving from that. To do this I have changed the static url in settings.py as follows
STATIC_URL = 'https://somekey.ssl.cf2.rackcdn.com/static/'
And it is working file.
The problem is that now the admin static files are also served from the above (rackspace) url. How can I change to the earlier i.e. /static/admin/ ?
Basically I want the app static files to be served from cdn and admin files from my site.
My environment:
Python 2.7.3
Django 1.4.2
Since the location of static files in personal apps and the django admin frontend all use the value of the STATIC_URL variable, I’d guess it is not possible to serve static content from two different sources.
May I suggest that you upload the static files of your admin frontend to your Rackspace instance? Assuming your Django install is located PATH, all you have to do is upload the content of
PATH/lib/python2.6/site-packages/django/contrib/admin/statictohttps://somekey.ssl.cf2.rackcdn.com/static/.Another solution would be to not change the value of STATIC_URL: set it to “/static”, for instance, and then configure your Apache server to redirect requests to your Rackspace instance: