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 7734515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:16:09+00:00 2026-06-01T07:16:09+00:00

def register_page(request): if request.method == ‘POST’: form = RegistrationForm(request.POST) if form.is_valid(): user = User.objects.creat_user(

  • 0
def register_page(request):
    if request.method == 'POST':
        form = RegistrationForm(request.POST)
        if form.is_valid():
            user = User.objects.creat_user(
                username=form.clean_data['username'],
                password=form.clean_data['password1'],
                email=form.clean_data['email']
                )
            return HttpResponseRedirect('/accounts/register/success/')
    else:
        form = RegistrationForm()
    variables = RequestContext(request, {'form': form})
    return render_to_response ('registration/register.html',variables)

When I run server, this error appears:

global name 'RegistrationForm' is not defined
Request Method: GET
Request URL:    http://127.0.0.1:8000/accounts/register/
Django Version: 1.4
Exception Type: NameError
Exception Value:    
global name 'RegistrationForm' is not defined
Exception Location: D:\Python\Scripts\littlesite\messageboard\views.py in register_page, line 31
Python Executable:  D:\Python\python.exe
Python Version: 2.7.2

Can anybody tell me what is wrong with it? Thanks.

  • 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-06-01T07:16:11+00:00Added an answer on June 1, 2026 at 7:16 am

    You didn’t import the RegistrationForm. In order to use it, you need to import it into your current namespace.

    In case you’re using django-registration, use the following import:

    from registration.forms import RegistrationForm
    

    If it’s a custom form, import it from where you have defined it.

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

Sidebar

Related Questions

Admin.py class CourseAdmin(admin.ModelAdmin): list_display = ('course_code', 'title', 'short' ) def save_model(self, request, obj, form,
I have a registration form that when the user enters in valid registration data
User registration in my application is performed in steps. After submitting the form, some
I have this: ActiveAdmin.register User do controller do def show @user = User.find(params[:id]) show!
suppose that you have a webpage that uses the post and get method, and
class RegistrationFormPreview(FormPreview): preview_template = 'workshops/workshop_register_preview.html' form_template = 'workshops/workshop_register_form.html' def done(self, request, cleaned_data): # Do
I already have a form with normal HTTP post. Now, I want to rewrite
I have my own templatetag: @register.inclusion_tag('path_to_module.html', takes_context=True) def getmodule(context, token): try: return slow_function(params) except
Trying to solve a problem with templatetags. I have two templatetags: @register.inclusion_tag('directory/_alphabet.html') def alphabet_list(names):
def foo (): x = re.compile('^abc') foo2(x) def foo2(x): How do I get x

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.