Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#16050 closed Cleanup/optimization (fixed)

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

Reported by: EvilDMP 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 Changed 4 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by jezdez

  • Has patch set
  • Needs documentation set
  • Needs tests set

comment:4 Changed 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

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 follow-up: Changed 4 years ago by 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.

comment:6 in reply to: ↑ 5 Changed 4 years ago by carljm

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