Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#16050 closed Cleanup/optimization (fixed)

media directory still lives on in /django/contrib/admin

Reported by: Daniele Procida Owned by: nobody
Component: contrib.admin Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Shouldn't that go into /static now?

If it does, http://code.djangoproject.com/browser/django/trunk/django/contrib/staticfiles/storage.py#L47 won't be required any longer.

Change History (6)

comment:1 by Jannis Leidel, 13 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Jannis Leidel, 13 years ago

Has patch: set
Needs documentation: set
Needs tests: set

comment:4 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: newclosed

In [16487]:

Fixed #16050 -- BACKWARDS-INCOMPATIBLE CHANGE: Moved static files of the admin to conventional file system location.

This also removes the need for ADMIN_MEDIA_PREFIX and replaces it with the convention to find admin's static files at STATIC_URL + 'admin/'.

Thanks to Jacob for the review and general help.

comment:5 by anonymous, 12 years ago

If you are using Apache to proxy to the Django admin interface (to enable the admin interface to be served under a different HTTPS host, for example), what do you suggest doing now that ADMIN_MEDIA_PREFIX has been removed?

e.g. https://secure.example.org/net-admin/ proxies internally to http://example.net/admin/ (and /admin/ is restricted to internal IPs only). STATIC_URL is set to /static/ so that it works fine for everything on the front end, but this then does not work as secure.example.org/static/ does not exist. If STATIC_URL is set to an absolute value of http://example.net/static/, then the admin will correctly give mixed HTTPS/HTTP warnings. There appear to be a lot of templates that would need overriding, so that doesn't seem like a good way to go. We use this set up on a number of sites, so it would be good if there was a simple way it could be continued.

in reply to:  5 comment:6 by Carl Meyer, 12 years ago

Replying to anonymous:

If you are using Apache to proxy to the Django admin interface (to enable the admin interface to be served under a different HTTPS host, for example), what do you suggest doing now that ADMIN_MEDIA_PREFIX has been removed?

e.g. https://secure.example.org/net-admin/ proxies internally to http://example.net/admin/ (and /admin/ is restricted to internal IPs only). STATIC_URL is set to /static/ so that it works fine for everything on the front end, but this then does not work as secure.example.org/static/ does not exist. If STATIC_URL is set to an absolute value of http://example.net/static/, then the admin will correctly give mixed HTTPS/HTTP warnings. There appear to be a lot of templates that would need overriding, so that doesn't seem like a good way to go. We use this set up on a number of sites, so it would be good if there was a simple way it could be continued.

Seems like the solution is to set up your front-end proxy to also proxy the admin static assets under https://secure.example.org/net-admin/static/admin/.

In any case, this question should be discussed on the django-users mailing list, not on a closed ticket.

Note: See TracTickets for help on using tickets.
Back to Top