1đź‘Ť
This is what the “static” app is for. You should do manage.py collectstatic
on deployment, and this collects all your static content – both for your apps and for the built-in/contrib ones – into one place, which is where you point your Apache alias to.
But if you really want to hard code it, STATIC_URL + admin just means exactly that: the value of STATIC_URL, suffixed with “admin”, so Alias /static/admin
.
0đź‘Ť
This is the code that finally works:
Alias /static/admin "C:/Python27/Lib/site-packages/django/contrib/admin/static/admin/"
<Directory "C:/Python27/Lib/site-packages/django/contrib/admin/static/admin">
Require all granted
</Directory>
Alias /static/ "C:/mysite/polls/static/"
<Directory "C:/mysite/polls/static">
Require all granted
</Directory>
Note that ORDER matters greatly. I have to Alias the admin static BEFORE aliasing the site static. Sounds like a cascading type issue and makes sense the more specific gets precedent.
Also I had my link incorrect for the admin. It was ending in ../admin/static/
. It should go deeper into ../admin/static/admin/
.
Finally 2 areas working to serve static files. The admin comes first and then the site static 2nd.
Thanks to all and this should be really documented and might be a pitfall for some.
- [Answer]-Order by float field in Django not working
- [Answer]-Django Template view class not working
- [Answer]-How to set the default value for existing entries when adding a new column?
- [Answer]-[django+mysql]MySQLdb.connect works well, but cannot connect mysql via settings.py
- [Answer]-How to delete all django media so I can start fresh?