views:

40

answers:

2

I've recently inherited a django project and I'm facing a serious amount of bugs/issues and ...quirks that need to be fixed. As I'm coming from a php background (don't ask), I'm having a ...challenging time.

In terms of the Django admin, It will not accept any email address as a username. However, IN our front-end - the previous developer designed the system in such a way that the application used an email address as the username. This is fine in the frontend, but we can't save any changes we make to a user in the admin section ¬.¬

Is there any way to fix this WITHOUT updating our django installation to v1.2 (NOT an option) and WITHOUT modifiying any of the Django.contrib files?

I've heard good things about extending these classes/method, but I'm very unsure how to proceed.

Looking at websites online, they suggest writing a custom backend, etc...? Is the the right way to go about it? I'm not too confident a djanog programmer though, and considering this is to do with User Logins, I'd be VERY unconfident about any solution I could write.

Is there an easy way I can simply override the username validation method to accept an @ and be over 30 chars?

+1  A: 

This snippet might be helpful:

ars
A: 

If you use django1.2.1 there is no problem: http://docs.djangoproject.com/en/1.2/topics/auth/#fields

diegueus9
If you read my question correctly, You would have seen that updating to 1.2 is NOT an option. We have a production server with several... legacy packages and dependencies that will not work with a version of django greater than what we have at the moment. (v1.0).
once_functional
then hack the login process changing '@' by '__' or something
diegueus9
Once again, reading the question would inform you that I cannot modify the django.contrib files. This includes the django.contrib.auth files (used for authorisation). Considering this is a commercial product, is 'hacking' a login process really a good idea? I'd prefer to extend or override a method than to directly hack or change one.
once_functional
I mean, you can change the user's email when they register in your site an change the character '@', i think the view of register and login is your own.
diegueus9