ImportError Exception Value: No module named forms
I've went through most of the similar questions here on SO and so far
haven't found one to help me narrow this down.
I'm running into this error and haven't been able to solve it yet. I
originally had to fight with a few files for mixing tabs and spaces. Now
that I have got rid of that error, I now get this error, if anyone could
point me in the right direction that would be great.
ImportError at /
No module named forms
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.5.2
Exception Type: ImportError
Exception Value:
No module named forms
Exception Location: /home/chad/newssite/links/views.py in <module>,
line 3
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:
['/home/chad/newssite',
'/usr/local/lib/python2.7/dist-packages/django_registration-1.0-py2.7.egg',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PIL',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
'/usr/lib/python2.7/dist-packages/ubuntuone-couch',
'/usr/lib/python2.7/dist-packages/ubuntuone-installer',
'/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
Server time: Sun, 25 Aug 2013 20:29:20 -0500
views.py file
from django.views.generic import ListView, DetailView
from .models import Link, UserProfile
from .forms import UserProfileForm
from django.contrib.auth import get_user_model
from django.views.generic.edit import UpdateView
from django.core.urlresolvers import reverse
class LinkListView(ListView):
model = Link
queryset = Link.with_votes.all()
paginate_by = 5
class UserProfileDetailView(DetailView):
model = get_user_model()
slug_field = "username"
template_name = "user_detail.html"
def get_object(self, queryset=None):
user = super(UserProfileDetailView, self).get_object(queryset)
UserProfile.objects.get_or_create(user=user)
return user
class UserProfileEditView(UpdateView):
model = UserProfile
form_class = UserProfileForm
template_name = "edit_profile.html"
def get_object(self, queryset=None):
return UserProfile.objects.get_or_create(user=self.request.user)[0]
def get_success_url(self):
return reverse("profile", kwargs={"slug": self.request.user})
No comments:
Post a Comment