Opened 11 years ago

Closed 5 years ago

#116 closed Uncategorized (worksforme)

Default admin media doesn't display for 'django-admin runserver'

Reported by: espen@… Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Vsevolod Novikov Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The default css and java scripts (located in '/usr/lib/python2.4/site-packages/django/conf/admin_media/') for the admin site does not work by default when I use 'django-admin.py runserver'.

Attachments (1)

django-admin-media-log.patch (865 bytes) - added by Vsevolod Novikov 5 years ago.
I've made a simple patch which allows to setup admin media logging easy. It adds optional ADMIN_MEDIA_LOG setting, and developer can see admin media requests if this settings is set to True

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by Adrian Holovaty

A few questions:

Which browser are you running? Does the rest of the site work (logging in, etc.)? If you point your browser directly to an admin media file, such as an image, what error do you get?

comment:2 Changed 11 years ago by Adrian Holovaty

Summary: Default admin mediaDefault admin media doesn't display for 'django-admin runserver'

comment:3 Changed 11 years ago by espen@…

I use Firefox 1.0.4, and everything else works, it is just everyting that is in the "media" folder.

If I try for example to open "admin/media/css/base.css" (same with "media/css/base.css") I get

There's been an error:

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 184, in get_response
    callback, param_dict = resolver.resolve(path)

  File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 85, in resolve
    raise Http404, "Tried all URL patterns but didn't find a match for %r" % app_path

Http404: Tried all URL patterns but didn't find a match for 'admin/media/css/base.css'

comment:4 Changed 11 years ago by Adrian Holovaty

Ah, the problem is that your ADMIN_MEDIA_PREFIX is set to "/admin/media", and Django handles everything under "/admin/". Set it to something like "/admin_media/", and it should work. I'll leave this ticket open, though, so we can fix this potential problem in the code -- by displaying a helpful error message or something.

comment:5 Changed 11 years ago by Espen Grindhaug

Resolution: worksforme
Status: newclosed

I got it to work now, with apache.

Changed 5 years ago by Vsevolod Novikov

I've made a simple patch which allows to setup admin media logging easy. It adds optional ADMIN_MEDIA_LOG setting, and developer can see admin media requests if this settings is set to True

comment:6 Changed 5 years ago by Vsevolod Novikov

Cc: Vsevolod Novikov added
Easy pickings: unset
Has patch: set
Needs documentation: set
Needs tests: set
Resolution: worksforme
Status: closedreopened
Type: defectUncategorized
UI/UX: unset

The issue has been reopened for django developers who can apply the patch to the source

comment:7 Changed 5 years ago by Jannis Leidel

Needs documentation: unset
Needs tests: unset
Resolution: worksforme
Status: reopenedclosed

Please don't reopen tickets that have been closed as WORKSFORME.

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