changeset 6391

0 views
Skip to first unread message

Gary Wilson

unread,
Sep 20, 2007, 5:17:51 PM9/20/07
to Django developers
So last night I checked in changeset 6391, and this morning it hit me that
this breaks things for anyone using the admin application at more than one URL
since the url tag cannot handle cases where multiple instances of an
application are being used. This may not be as big an issue for the current
trunk since having multiple instances of the admin application doesn't make
too much sense, but it is one of the features touted for newforms-admin.

On the plus side, the change removes quite a bit of duplication in the
templates. This means there are less templates to override if you wanted to
customize the user links. It also address the issue that the ticket owner was
having that the relative links break if you have custom admin pages at
different URL depths than the templates being overridden.

I just wanted to see what others feel about 6391. I think the real issue here
is that Django currently has some deficiencies running multiple instances of
an application (and I plan on bringing them up as a separate thread on the
list), but the relative links that were is place before 6391 did work in
multiple instances as long as you didn't customize too much.

Does 6391 break anybody's setup?

Gary

Joseph Kocherhans

unread,
Sep 20, 2007, 5:28:24 PM9/20/07
to django-d...@googlegroups.com
On 9/20/07, Gary Wilson <gary....@gmail.com> wrote:
>
> So last night I checked in changeset 6391, and this morning it hit me that
> this breaks things for anyone using the admin application at more than one URL
> since the url tag cannot handle cases where multiple instances of an
> application are being used. This may not be as big an issue for the current
> trunk since having multiple instances of the admin application doesn't make
> too much sense, but it is one of the features touted for newforms-admin.

Making better use of the url tag in the admin templates was on my long
term todo list. That changeset just gives me motivation to figure it
out earlier since I'll need to do so next time I merge changes from
trunk into the newforms-admin branch. I guess I could just *not*
integrate that particular changeset, but I would feel dirty if I
didn't. :)

Joseph

Russell Keith-Magee

unread,
Sep 20, 2007, 9:07:50 PM9/20/07
to django-d...@googlegroups.com
On 9/21/07, Gary Wilson <gary....@gmail.com> wrote:
>
> I just wanted to see what others feel about 6391. I think the real issue here
> is that Django currently has some deficiencies running multiple instances of
> an application (and I plan on bringing them up as a separate thread on the
> list), but the relative links that were is place before 6391 did work in
> multiple instances as long as you didn't customize too much.

Personally, I'm not deploying multiple instances of any application in
a project, but I can see that it is the sort of thing that people
might want to do.

I can't say I have any particular problem with the patch from [6391].
It looks like a clean refactor to me, and like you said, there isn't
much point in making multiple deployments of the trunk admin app. On
top of that, if you do need to deploy multiple instances for some
wierd reason, you could always override the base templates to restore
the old template structure.

However, I would probably err on the side of caution and mention the
potential problem on the backwards incompatibilities wiki page.

This does open a bigger can of worms, though. There is a bit of an
inherent incompatibility between deploying multiple instances of
generic apps and the use of {% url %} in templates. This problem
warrants some discussion before we back ourselves into a corner by
openly advocating multiple deployment of apps like newforms-admin.

My initial reaction to the problem was to think about adding an 'app
prefix' when you deploy an app, much like a form prefix, that is
injected into the template context to affect the resolution of {% url
%} tags. However, thinking about the implementation and consequences
of such a change this early on a Friday morning is making my brain
hurt.

Yours,
Russ Magee %-)

Joseph Kocherhans

unread,
Sep 24, 2007, 2:08:01 PM9/24/07
to django-d...@googlegroups.com
On 9/20/07, Russell Keith-Magee <freakb...@gmail.com> wrote:
>
> My initial reaction to the problem was to think about adding an 'app
> prefix' when you deploy an app, much like a form prefix, that is
> injected into the template context to affect the resolution of {% url
> %} tags. However, thinking about the implementation and consequences
> of such a change this early on a Friday morning is making my brain
> hurt.

*Sigh* after thinking about it briefly, I don't see any obvious or
easy solutions either. I think I'm going to file a ticket about the
url tag and multiple sites, and when I merge newforms-admin next, I'm
not going to integrate this particular changeset. If anyone sees any
possible alternatives that can be implemented quickly (and thus, not
hold up a merge) please speak up.

Joseph

Reply all
Reply to author
Forward
0 new messages