I filed a ticked [1] and added a patch. The solution I came up with
allows `AUTH_USER_URL` to be fairly flexible, here are some examples:
AUTH_USER_URL = '/accounts/%(username)s/'
AUTH_USER_URL = '/users/%(last_name)s_%(first_name)s/'
AUTH_USER_URL = '/users/%(id)s/'
Any ``User`` object attribute can be defined.
http://www.djangoproject.com/documentation/settings/#absolute-url-overrides
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
I must have passed over that one a hundred times without seeing it
once...
On Oct 19, 2:12 pm, "James Bennett" <ubernost...@gmail.com> wrote:
> On 10/19/07, wnielson <wniel...@gmail.com> wrote:
>
> > I needed the ability to set a custom url for the User model, so I
> > modified the User model's `get_absolute_url` to allow endusers to
> > define an attribute, `AUTH_USER_URL`, in their settings file. `/users/
> > <username>/` is still the default, but can simply be overwritten.
>
> http://www.djangoproject.com/documentation/settings/#absolute-url-ove...
At some point I'd like to see the get_absolute_url() method on the
User model rewritten to use the permalink() decorator, which would do
away with the need to override on a per-install basis. I'm not sure
exactly how that'd work, though, since we'd have to decide on a naming
scheme for the auth URLs.
I've thought for a while that it might be useful to be able to imply a
name URL pattern based on the view itself. True, generic views and
similar need disambiguation-- but it seems to me that it should be at
least optional to have the URL mapping to auth.login magically named
auth-login, etc.