On 2 nov, 16:05, Sean Brant <brant.s...@gmail.com> wrote: > So i have user profiles at http://domain.com/username. I'd like to > prevent a user from signing up with a username that is the same as a > page on my site (ie: /login/, /blog/, etc). I was thinking I could > inspect my url patterns to determine what pages exist so I can > prevent that from being a username. Although I'm not sure how > expensive that will be. I'd rather not have to maintain a list in my > settings file. Anyone know of a solution for this? Seems like a fairly > common use case.
Not really answering your question, but a couple simple workarounds: - put your user profiles under http://domain.com/profiles/username - move the corresponding url patterns last, so any other "conflicting" url will have precedence FWIW, checking the user's profile url - based on username - won't conflict with an existing one is mostly a sound concern, but (sorry for being that dumb) this will only prevent conflicts with *existing* urls - whenever you add any other url (flatpage anyone ?) at the same level as your user profiles, you have a potential for conflicts... My 2 cents... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---