Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 675439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:49:05+00:00 2026-05-14T00:49:05+00:00

I have a requirement where I have to register users first via email. So,

  • 0

I have a requirement where I have to register users first via email. So, I went with django-registraton and I managed to integrate tat module into my django project.
After a successful login, the page redirects to ‘registration/profile.html’.
I need to get access to the user object which was used in the authentication.
I need this object to make changes to a model which holds custom profile information about my users. I have already defined this in my models.py

Here is the URL I am using to re-direct to my template..

url(r'^profile/$',direct_to_template,{'template':'registration/profile.html'}),

So my question is this… after login, the user has to be taken to a profile page that needs to be filled up.
Any thoughts on how I can achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:49:06+00:00Added an answer on May 14, 2026 at 12:49 am

    I have set up something similar earlier. In my case I defined new users via the admin interface but the basic problem was the same. I needed to show certain page (ie. user settings) on first log in.

    I ended up adding a flag (first_log_in, BooleanField) in the UserProfile model. I set up a check for it at the view function of my frontpage that handles the routing. Here’s the crude idea.

    views.py:

    def get_user_profile(request):
        # this creates user profile and attaches it to an user
        # if one is not found already
        try:
            user_profile = request.user.get_profile()
        except:
            user_profile = UserProfile(user=request.user)
            user_profile.save()
    
        return user_profile
    
    # route from your urls.py to this view function! rename if needed
    def frontpage(request):
        # just some auth stuff. it's probably nicer to handle this elsewhere
        # (use decorator or some other solution :) )
        if not request.user.is_authenticated():
            return HttpResponseRedirect('/login/')
    
        user_profile = get_user_profile(request)
    
        if user_profile.first_log_in:
            user_profile.first_log_in = False
            user_profile.save()
    
            return HttpResponseRedirect('/profile/')
    
        return HttpResponseRedirect('/frontpage'')
    

    models.py:

    from django.db import models
    
    class UserProfile(models.Model):
        first_log_in = models.BooleanField(default=True, editable=False)
        ... # add the rest of your user settings here
    

    It is important that you set AUTH_PROFILE_MODULE at your setting.py to point to the model. Ie.

    AUTH_PROFILE_MODULE = 'your_app.UserProfile'
    

    should work.

    Take a look at this article for further reference about UserProfile. I hope that helps. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i have requirement to process large number of files via multithreading in java.
I have requirement where some times I would like to load children as well
I have requirement to disable copy/paste/cut operations on a textbox. For this purpose I
I have requirement, wherein I have to calculate totals for cash and credit cards
I have requirement of specifying web part connections in onet.xml. So when site is
I have requirement like, suppose I have a 'property' table which has 'ListingKey' field
I have requirement as following like showing ABPeoplePickerNavigationController in tabbar based application. I researched
I have requirement to get Facebook friends list with their images. How can I
In our project we have requirement that, after receiving sms message from third party
I have a web application which is used by lots of non-technical users. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.