Django - how to write users and profiles handling in best way?
Posted
by SpankMe
on Stack Overflow
See other posts from Stack Overflow
or by SpankMe
Published on 2010-04-16T16:43:19Z
Indexed on
2010/04/16
16:53 UTC
Read the original article
Hit count: 323
Hey,
I am writing simple site that requires users and profiles to be handled. The first initial thought is to use django's build in user handling, but then the user model is too narrow and does not contain fields that I need. The documentation mentions user profiles, but user profiles section has been removed from djangobook covering django 1.0 (ideally, the solution should work with django 1.2), and the Internet is full of different solutions, not making the choice easier (like user model inheritance, user profiles and django signals, and so on).
I would like to know, how to write this in good, modern, fast and secure way. Should I try to extend django builtin user model, or maybe should I create my own user model wide enough to keep all the information I need? Below you may find some specifications and expectations from the working solution:
- users should be able to register and authenticate
- every user should have profile (or model with all required fields)
- users dont need django builtin admin panel, but they need to edit their profiles/models via simple web form
Please, let me know how do you solve those issues in your applications, and what is the best current way to handle users with django. Any links to articles/blogs or code examples are highly appreciated!
© Stack Overflow or respective owner