Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Parent module adsite.adsiteviews.mainhanlder does not exist

Reply
Thread Tools

Parent module adsite.adsiteviews.mainhanlder does not exist

 
 
Nick Dong
Guest
Posts: n/a
 
      01-18-2013
I created a django project using django 1.4.2. There is one 'app'(adsite) in this project. And It works. But when I copied some 'py' files into the 'app' folder, I got "Parent module adsite.adsiteviews.mainhanlder does not exist." Should I register the new files to __init__ in the 'app'? Did new coped files break the "import" rules?

views.py

from django.http import HttpResponse
from django.template import Context, loader
from adsite.models import UserInfo

def showusers(request):
userlist = UserInfo.objects.all()
c = Context({
'userlist':userlist,
})
t = loader.get_template('users.html')

return HttpResponse(t.render(c))

copied file: adsiteviews.py

class mainhanlder(TemplateView)
def get(self):
""" """
variables = {
'user': self.get_current_user(),
'mchosts' : MCHOSTS,
'servers' : servers}

index_templ = tmpl_lookup.get_template("index.html")
body = index_templ.render(**variables)
self.write(body)

urls.py

urlpatterns = patterns('',
# Examples:
url(r'^$', 'adsite.adsiteviews.mainhandler.as_View()'),
url(r'^users/$', 'adsite.views.showusers'),

I have no clues about this problem. any suggestions would be appreciated. thx for your time.
 
Reply With Quote
 
 
 
 
Jason Friedman
Guest
Posts: n/a
 
      01-20-2013
> I created a django project using django 1.4.2. There is one 'app'(adsite)in this project. And It works. But when I copied some 'py' files into the 'app' folder, I got "Parent module adsite.adsiteviews.mainhanlder does not exist." Should I register the new files to __init__ in the 'app'? Did new coped files break the "import" rules?

I do not know if this is your problem, and I know little about django,
but is "mainhanlder" a typographical error?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
CS0234 Global does not exist ... but it genuinely does Bill Johnson ASP .Net Datagrid Control 0 07-08-2005 06:34 PM
CS0234 Global does not exist ... but it genuinely does Bill Johnson ASP .Net 0 07-08-2005 06:34 PM
What does sender.Parent.Parent.Cells() reference? Frustrating... Roy ASP .Net 2 02-11-2005 09:00 PM
Does my object exist? So why its HWND doesn't exist? That's a question... (CMonthCalCtrl control) LT C++ 7 07-25-2004 07:08 PM



Advertisments