Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36975
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-01-17 21:25 -0800 |
| Message-ID | <1795aead-8260-4f68-9597-a6aa488f6513@googlegroups.com> (permalink) |
| Subject | Parent module adsite.adsiteviews.mainhanlder does not exist |
| From | Nick Dong <double.620@gmail.com> |
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.
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Parent module adsite.adsiteviews.mainhanlder does not exist Nick Dong <double.620@gmail.com> - 2013-01-17 21:25 -0800 Re: Parent module adsite.adsiteviews.mainhanlder does not exist Jason Friedman <jason@powerpull.net> - 2013-01-20 07:49 -0700
csiph-web