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

  • SEARCH
  • Home
  • 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 1006597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:29:11+00:00 2026-05-16T08:29:11+00:00

This is something I’ve wondered about in a couple of frameworks that I’ve messed

  • 0

This is something I’ve wondered about in a couple of frameworks that I’ve messed around with. Assuming I don’t want to automatically log a user in when they register (I want them to activate) how can I make it so a user can’t just visit the “register-success” page? Right now, here’s what I have:

def register(request):
    if request.method == 'POST':
        rf = forms.RegisterForm(request.POST)#register form
        pf = forms.ProfileForm(request.POST)#profile form (additional info)
        lf = forms.LoginForm()#login form is also on this page but is empty when registering
        if rf.is_valid() and pf.is_valid():
            newuser = User(username=rf.cleaned_data['username'],email=rf.cleaned_data['email'])
            newuser.set_password(rf.cleaned_data['password'])
            newuser.save()
            #need to mark newuser as inactive still
            profile = pf.save(commit=False)
            profile.user = newuser
            profile.save()
            return HttpResponseRedirect("/register-success/")
        return render_to_response("authentication/index.html", {'rform': rf, 'pform':pf,'lform':lf})
    return main(request)

def register_success(request):
    return render_to_response("authentication/register-success.html")

My url-conf:

(r'^register-success/$','register_success'),

The other way I thought to do it was to just render_to_response(“authentication/register-success.html”) and not do the redirect. The benefit is, no one can access the register-success.html page, the downside is if the user refreshes the page it will try and resubmit the POST. What’s the best practice?

  • 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-16T08:29:12+00:00Added an answer on May 16, 2026 at 8:29 am

    I would stick with the redirect, getting duplicate users is a fairly large risk. What is the risk of someone seeing your register success page who hasn’t registered? If there is a risk, you could always generate a random token, put it in session and pass it to your register-success page and then in your view check that the token matches. But that seems like a lot of work for what typical success pages are.

    My recommendation would be to not worry about people being able to get to that page without registering. If it is just static HTML, there can’t be any risk with showing to to everybody, right?

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

Sidebar

Related Questions

I want to search with grep for a string that looks like this: something
I need to break apart a string that always looks like this: something --
This is something that's been bugging me with PHP for a while now and
This is something that's been bugging me for many years: why most online services
Is this something that can be used for highly secure information or should it
if url contains like this and I want to if segment1 equals something then
I want to learn C language (is this something good ?) and i didn't
Can someone explain why everything in WPF is blurry? Is this something that can
I have about 500+ memory warnings after running the static analyzer. Is this something
Is this something that can be done more efficiently than with a vertex array?

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.