Opened 10 years ago

Closed 4 years ago

#116 closed Uncategorized (worksforme)

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

Reported by: espen@… Owned by: adrian
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: nnseva 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 nnseva 4 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 10 years ago by adrian

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 10 years ago by adrian

  • Summary changed from Default admin media to Default admin media doesn't display for 'django-admin runserver'

comment:3 Changed 10 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 10 years ago by adrian

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 10 years ago by Espen Grindhaug

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

I got it to work now, with apache.

Changed 4 years ago by nnseva

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 4 years ago by nnseva

  • Cc nnseva added
  • Easy pickings unset
  • Has patch set
  • Needs documentation set
  • Needs tests set
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Type changed from defect to Uncategorized
  • UI/UX unset

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

comment:7 Changed 4 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Resolution set to worksforme
  • Status changed from reopened to closed

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

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