Monday, January 7, 2013

strangle url error in django with google app engine

Hi all.
   I use djangoappengine http://www.allbuttonspressed.com/projects/djangoappengine#zip-packages to manage google app engine.
   I test a very simple project:
   url.py:
   from django.conf.urls.defaults import *
from shape_practice.views import introduction
handler500 = 'djangotoolbox.errorviews.server_error'

urlpatterns = patterns('',
    ('^_ah/warmup$', 'djangoappengine.views.warmup'),  
     (r'^introduction/$', introduction),   
)

views.py:

from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
from django.template import loader, Context, RequestContext

def introduction(request):
    t = loader.get_template('introduction.html')   
    c = Context({})
    return HttpResponse(t.render(c))

but when I type http://127.0.0.1:8000/introduction/ . The browser doesn't show "introduction.html", but another "html", let's say A.html. But A.html can't be found in the urlpatterns. Anywhere else can set .html file?
Another strange thing is that: in the url.py file, I can use "from shape_practice.views import introduction", but I can't use shape_practice.views.introduction which has an "shape_practice undefined error"

Thanks.


   

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment