Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2600 closed defect (fixed)

[patch] Development server doesn't serve custom admin media

Reported by: adurdin@… Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If the ADMIN_MEDIA_PREFIX is set to a relative path containing customised files, and the urls.py configured to serve static files from that path, the development server (django-admin runserver) will still serve the standard admin media from django/contrib/admin/media/

The attached patch adds a setting SERVE_DEFAULT_ADMIN_MEDIA (default True), which if False will prevent this behaviour.

Attachments (2)

SERVE_DEFAULT_ADMIN_MEDIA.diff (1.9 KB) - added by adurdin@… 9 years ago.
patch
admin_media_path.diff (3.2 KB) - added by adurdin@… 9 years ago.
patch that adds --adminmediapath setting to manage.py

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by adurdin@…

patch

comment:1 Changed 9 years ago by adrian

  • Summary changed from [patch] Development server doesn't serve custom admin media to Development server doesn't serve custom admin media

Hmmm, I think introducing a setting for this would be overkill, because it's such an edge case. I would be more comfortable with an option to manage.py runserver, such as manage.py runserver --no-admin-media or something. Would you be willing to contribute a patch that does that?

(Removing the [patch] designation.)

Changed 9 years ago by adurdin@…

patch that adds --adminmediapath setting to manage.py

comment:2 Changed 9 years ago by adurdin@…

  • Summary changed from Development server doesn't serve custom admin media to [patch] Development server doesn't serve custom admin media

Apart from not using a 'settings' setting, this patch has different semantics: the option lets you specify the path to use instead of the default.

comment:3 Changed 9 years ago by mtredinnick

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

(In [3811]) Fixed #2600 -- Added an option to allow serving admin media from a custom path
with dev server. Thanks, adurdin@….

comment:4 Changed 9 years ago by mtredinnick

(In [3812]) Documented the change in r3811. Refs #2600.

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