I’m a beginner in Django. I need to setup a website, where each user has a profile page. I’ve seen django admin. The profile page for users, should store some information which can be edited by the user only. Can anyone point me out how that is possible?. Any tutorial links would be really helpful. Also, are there any modules for django, which can be used for setting up user page.
Share
You would just need to create a view that’s available to an authenticated user and return a profile editing form if they’re creating a
GETrequest or update the user’s profile data if they’re creating aPOSTrequest.Most of the work is already done for you because there are generic views for editing models, such as the UpdateView. What you need to expand that with is checking for authenticated users and providing it with the object that you want to provide editing for. That’s the view component in the MTV triad that provides the behavior for editing a user’s profile–the
Profilemodel will define the user profile and the template will provide the presentation discretely.So here’s some behavior to throw at you as a simple solution: