Introducing Django JumpToAdmin

Django JumpToAdmin is my new project that enables content administrators to easily access the Django admin interface for any object presented on their sites.

In practice, Django JumpToAdmin displays links to admin change/delete/list pages when specified objects on a page are hovered over with the mouse. Once clicked, these links open the requested Django admin page in an iframe above the current page.

This quick screencast demonstrates how Django JumpToAdmin works when integrated with Djangofriendly Hosts

To accomplish this, a templatetag is passed objects by the template and returns strings used as html classes. An included Javascript file parses these classes and inserts the proper links. Django JumpToAdmin takes into account Django’s admin permission rules, so unauthorized users will never see these links.

Django JumpToAdmin is my first Django app meant to be used by other members of the community. I’ve posted the Django JumpToAdmin code on GitHub along with usage instructions. As this is my first public release (and my first time using Git), the code could certainly use some enhancement. Feel free to fork and contribute back.

As of today, only links for change/delete/list are supported. I’d love for this code to grow to support custom admin actions, or at least gain flexibility for custom links. Thinking more long term, I can see this project growing beyond its admin-in-iframe limitations and into an inline editing tool. But for now that’s just a pipe dream.

In the meantime, check out the Django JumpToAdmin code on GitHub. I hope you find it useful.


Discussion
Link to this comment

Hello Ryan, I have no experience with iframe+ThickBox, so sorry for my dump question:

What is happened if in the edit form is some FK or M2M field, and you clicked on + icon? (so normaly popup window appear, and after save new values FK or M2M field is populated to new value)

Is this functionality retained?

September 10th 2009, 3:43 a.m. by Michal Valoušek
Link to this comment

You know Michal, I hadn't thought to test that previously. Much to my delight, the + icon for an M2M/FK pops up a new window that on save will close and update the admin iframe, exactly as one would expect it to do.

September 10th 2009, 3:59 a.m. by Ryan Berg
Link to this comment

Great! I am looking forward to use your app in some of my Django project. Thank you very much!

September 10th 2009, 4:23 a.m. by Michal Valoušek
Link to this comment

This is much nicer than the approach I just used which was to create a method get_admin_url which went directly to the admin screen. Great idea! I'll definitely use it the next time I require that functionality!

September 10th 2009, 7:15 a.m. by Andrew
Link to this comment

Great project. Unless I missed something, I didn't see what license you're releasing it under. This might be something I'd like to include in Satchmo but just curious about the license.

September 10th 2009, 10:57 a.m. by Chris Moffitt
Link to this comment

Chris, I'm still figuring out what my options are regarding the license. It seems like a bit of a gray area because the package includes some javascript pulled from jQuery Thickbox, which is under a MIT License/GNU License.

Can you provide any input on what I'd be allowed to release this under while the Thickbox code is a part of it?

The code'll definitely need some more testing/revising before you'll want to include it in Satchmo. I know it's working under my conditions, but I'm sure we'll find exceptions. I can definitely see this being a natural enhancement to a Satchmo site though.

September 10th 2009, 11:53 a.m. by Ryan Berg
Link to this comment

Ryan - Satchmo is BSD licensed so an MIT license is preferred. I don't think it's a problem to use jquery under and MIT/BSD license. I'll let you know as I play around with it.

September 10th 2009, 12:18 p.m. by Chris Moffitt
Link to this comment

This seems to be quite useful for using admin with django.

September 15th 2009, 5:28 a.m. by flight
Link to this comment

very cool. It is nice to see the Django community going strong. I would someday like to start doing my client sites with django (using drupal now). Stuff like this brings me one step closer.

September 21st 2009, 6:19 p.m. by Josh

Comments are disabled for this item