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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:07:40+00:00 2026-06-12T10:07:40+00:00

I’m running Django 1.4 with Python 2.7 on Kubuntu 12.04. I here is my

  • 0

I’m running Django 1.4 with Python 2.7 on Kubuntu 12.04.

I here is my views.py

from __future__ import unicode_literals
from django.shortcuts import render_to_response
from django.core.context_processors import csrf
from rsb.forms import RegisterForm

def index(request):
    return render_to_response("index.html")

def services(request):
    return render_to_response("services.html")

def login(request):
    return render_to_response("login.html")

def contact(request):
    return render_to_response("contact.html")

def about(request):
    return render_to_response("about.html")

def registerUser(request):
    form = RegisterForm()
    data = {}
    data.update(csrf(request))
    data.update({ 'form' : form })
    return render_to_response("register.html", data)

def addUser(request):
    return render_to_response("added_user.html")

Here is my urls.py

from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^services/', 'rsb.views.services'),
    url(r'^login/', 'rsb.views.login'),
    url(r'^register/', 'rsb.views.registerUser'),
    url(r'^contact/', 'rsb.views.contact'),
    url(r'^about/', 'rsb.views.about'),
    url(r'^addUser/', 'rsb.views.addUser'),

    url(r'^admin/', include(admin.site.urls)),

)

Here is my forms.py

class RegisterForm(forms.Form):
    client_type = ('Personal', 'Company')
    countries = Countries.objects.all()
    unitedStates = UnitedStates.objects.all()

    country_choices = []
    for item in countries:
        country_choices.append(countries.name)

    state_choices = []
    for item in unitedStates:
        state_choices.append(unitedStates.name)

    rsb_client_type = forms.ChoiceField(widget = forms.Select(), choices = client_type, required = True)
    rsb_first_name = forms.CharField(max_length = 25, required = True)
    rsb_last_name = forms.CharField(max_length = 25, required = True)
    rsb_company_name = forms.CharField(max_length = 25)
    rsb_address1 = forms.CharField(max_length = 50, required = True)
    rsb_address2 = forms.CharField(max_length = 50)
    rsb_city = forms.CharField(max_length = 50, required = True)
    rsb_country = forms.ChoiceField(widget = forms.Select(), choices = country_choices, required = True)

    if (rsb_country == 'United States'):
        rsb_state = forms.ChoiceField(widget = forms.Select(), choices = state_choices, required = True)
    else:
        rsb_state = forms.CharField(max_length = 50, required = True)

    rsb_zip_code = forms.CharField(max_length = 25, required = True)
    rsb_phone_number = USPhoneNumberField(label = "Phone", widget = USPhoneNumberMultiWidget(), required = True)
    rsb_email = forms.EmailField(required = True)

Please note that this is far from polished. I’m just simply having trouble accessing my views. I ran python manage.py runserver and tried http://127.0.0.1:8000/register/ and received the following error:

Could not import rsb.views.registerUser. View does not exist in module rsb.views.

I receive a similar error regardless of which view I try and access.

Please help.

EDIT1:

Sorry, here is the traceback:

Traceback:
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/handlers/base.py" in get_response
  101.                             request.path_info)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py" in resolve
  300.                     sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py" in resolve
  209.             return ResolverMatch(self.callback, args, kwargs, self.name)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py" in callback
  216.         self._callback = get_callable(self._callback_str)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/utils/functional.py" in wrapper
  27.         result = func(*args)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py" in get_callable
  101.                     (lookup_view, mod_name))

Exception Type: ViewDoesNotExist at /register/
Exception Value: Could not import rsb.views.registerUser. View does not exist in module rsb.views.
  • 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-12T10:07:42+00:00Added an answer on June 12, 2026 at 10:07 am

    Rename rsb.views.registerUser to rsb.views.register_user according to the PEP 8:

    Function names should be lowercase, with words separated by
    underscores as necessary to improve readability.

    Now to the problem. You have:

    country_choices = []
    for item in countries:
        country_choices.append(countries.name)
    
    state_choices = []
    for item in unitedStates:
        state_choices.append(unitedStates.name)
    

    which should be:

    country_choices = []
    for item in countries:
        country_choices.append(item.name)
    
    state_choices = []
    for item in unitedStates:
        state_choices.append(item.name)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I have a view passing on information from a database: def serve_article(request, id): served_article

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.