Sunday, September 21, 2014

trying to load a view

my application named polls
in polls/views.py
i have:

from django.http import HttpResponse
import datetime

def hello(request):
    now = datetime.datetime.now()
    html = "<html><body>It is now %s.</body></html>" % now
    return HttpResponse(html)


my project call restaurants
restaurants/urls.py:

from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
import polls.views
urlpatterns = patterns('',
    url(r'^hello/$', include(polls.views.hello)),
    url(r'^admin/', include(admin.site.urls)),
)

and i get this error.
Request URL:http://127.0.0.1:8000/hello/
Django Version:1.7
Exception Type:ImproperlyConfigured
Exception Value:
The included urlconf '<function hello at 0x031DDB70>' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.

all the tutorials and webpages mention this tutorials, saying that should work, any ideas what might be?

thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/205e4901-a436-4260-8d08-aff06cd3ca3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment