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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:04:01+00:00 2026-06-09T18:04:01+00:00

I was trying to implement a rating system that receives the information that a

  • 0

I was trying to implement a rating system that receives the information that a user submits.
But I was just wondering if it’s possible to have two classes in one models file and get Could not import myapp.comments.views.stars. View does not exist in module myapp.comments.views.

In my models file, I have

class CommentWithRating(Comment):
    rating = models.IntegerField()

    def save(self, *args, **kwargs):
        self.content_object.rating.add(score=self.rating, user=self.user, ip_address=self.ip_address)
        super(CommentWithRating, self).save(*args, **kwargs)

class Rating(models.Model):
    first_name = models.charField(maxlength=30)
    last_name = models.charField(maxlength=30)
    department = models.charField(maxlength=30)
    comment = models.charField(maxlength=10000)
    communi_rating = models.IntegerField()
    prepar_rating = models.IntegerField()
    interact_rating = models.IntegerField()
    help_rating = models.IntegerField()

By the way, stars is a html file. Any ideas?

This is my views,

from django.shortcuts import render_to_response, render
from django.http import HttpResponse
from models import CommentWithRating
def stars(request):
    return render(request, 'star.html', {'score': ''})

My error message is simply,

Could not import myapp.comments.views.stars. View does not exist in module
myapp.comments.views.

My traceback is,

Environment:
Request Method: GET

Django Version: 1.4

Python Version: 2.7.2

Installed Applications:

(‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.sites’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘registration’,
‘django.contrib.admin’,
‘djangoratings’)
Installed Middleware:
(‘django.middleware.common.CommonMiddleware’,
‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.contrib.messages.middleware.MessageMiddleware’)

Traceback:
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py” in get_response
101. request.path_info)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py” in resolve
300. sub_match = pattern.resolve(new_path)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py” in resolve
209. return ResolverMatch(self.callback, args, kwargs, self.name)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py” in callback
216. self._callback = get_callable(self._callback_str)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py” in wrapper
27. result = func(*args)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py” in get_callable
101. (lookup_view, mod_name))

Exception Type: ViewDoesNotExist at /rating/
Exception Value: Could not import myapp.comments.views.stars. View does not exist in module >myapp.comments.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-09T18:04:03+00:00Added an answer on June 9, 2026 at 6:04 pm

    Yeah, that’s definitely possible.

    Try doing a

    python ./manage.py shell
    

    and then importing the model or view that is giving you the problem. That might end up giving you more useful debugging information.

    (from Django views does not exist or could not import)

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

Sidebar

Related Questions

I am trying to implement a rating system where I keep the following two
Trying to implement a rating system of users and postings. What is the best
Trying to implement what I thought was a simple concept. I have a user
Just trying to implement mobFox into my app, but having trouble to make it
Trying to implement a timer for my game that I'm making. I have a
Trying to implement a simple print in SL4. I have a DataGrid that I
Trying to implement something similar to qtip, but using a table that compares the
Trying to implement 3-layer (not: tier, I just want to separate my project logically,
Trying to implement some nested loops that are spitting out good old nested html
Trying to implement a function that will return a list of ints the represent

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.