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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:50:20+00:00 2026-06-08T23:50:20+00:00

I am getting the following error Django Version: 1.4 Exception Type: ViewDoesNotExist Exception Value:

  • 0

I am getting the following error

Django Version:     1.4
Exception Type:     ViewDoesNotExist
Exception Value:    

Could not import ratings.views.HotelRating. View does not exist in module ratings.views.

but here is my views.py

from django.http import HttpResponseRedirect
from django.contrib.auth.models import User
from django.shortcuts import render_to_response
from ratings.models import Hotel_Rating, Restaurant_Rating, Cafe_Rating, Pastry_Rating
from services.models import *
from ratings.forms import Hotel_Rating_From
from django.template import RequestContext

def HotelRating(request):
    if request.method == 'POST':
        form = Hotel_Rating_From(request.POST)
        if form.is_valid():
            user_id = form.cleaned_data['user_id']
            hotel_id = form.cleaned_data['hotel_id']
            user = User.objects.get(id = user_id)
            hotel = Hotel.objects.get(id = hotel_id)
            review = Hotel_Rating(hotel_id = hotel.id, user_id = user.id, overall_rating = form.cleaned_data['overall_rating'], service = form.cleaned_data['service'], cleanliness = form.cleaned_data['cleanliness'], location = form.cleaned_data['location'], rooms = form.cleaned_data['rooms'], restaurant = form.cleaned_data['restaurant'], room_service = form.cleaned_data['room_service'], price = form.cleaned['price'], comment = form.cleaned_data['comment'])
            review.save()
            return HttpResponseRedirect('/')
        else:
            form = Hotel_Rating_From(request.POST)
            return render_to_response('hotelreview.html', {'form': form}, context_instance = RequestContext(request))

and here is my urls.py file

urlpatterns = patterns('',

    url(r'^admin/', include(admin.site.urls)),
    (r'^register/$', 'reviewers.views.ReviewerRegistration'),
    (r'^hotelrating/$', 'ratings.views.HotelRating'),
    (r'^login/$', 'reviewers.views.LoginRequest'),

)

I dont know what i did wrong, I have added the ratings app in the INSTALLED_APPS in settings.py.

  • 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-08T23:50:22+00:00Added an answer on June 8, 2026 at 11:50 pm

    You probably have a circular import. Move your import statement inside your def to see if that helps.

    def HotelRating(request):
        from ratings.models import Hotel_Rating
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just updated my django to 1.4. But I am getting the following error
Am getting following error message on calling WCF service: The formatter threw an exception
I'm getting the following error: Template error In template /home/mo/python/django/templates/yoga/index.html, error at line 1
Weirdly, it has worked before and now it doesn't: getting the following error: Exception
I've updated my Django version to the latest nightly, and I'm getting the following
I am getting the error Exception Value:No module named index . i have __init__.py
I'm getting the following error when I try to deploy my django 1.3 app
I'm getting the following error when trying to create a simple db with Django.
I am Getting following error on exporting the video using [exportSession exportAsynchronouslyWithCompletionHandler:^ Error: -[TiBlob
I am getting following error while installing the application on my device. before running

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.