Django URL returns page not found. Django 1.9 -


main site url conf:

from django.conf.urls import patterns, include, url django.contrib import admin django.conf import settings . import views  urlpatterns = [  url(r'^admin/', include (admin.site.urls)),  url(r'^vibeapp/', include('vibeapp.urls')) ] 

vibe app url conf:

from django.conf.urls import patterns, url  vibeapp import views   urlpatterns = patterns['vibeapp.views',   url(r'^$','index', name='index'),   url(r'^homepage/$, homepage, name='index'),   url(r'^vibeapp$', vibeapp, name='index'),   ] 

vibeapp view:

from django.http import httpresponse  def index(request):  return httpresponse("hey!") 

i including wsgi in case problem:

import os

from django.core.wsgi import get_wsgi_application  os.environ.setdefault("django_settings_module", "mysite.settings")  application = get_wsgi_application() 

i working on django 1.9 , have configured main site url , web app url , view. when run url http://127.0.0.1:8000/vibeapp shows page not found.

please find code attached above.

thanks

you not correctly using patterns function in vibe app url conf. using dictionary , should called function. keep in mind patterns deprecated , going disappear in django 1.10. take @ documention.

another issue should not repeat name= of url in same group have done 'index' in:

    ...     url(r'^$','index', name='index'),     url(r'^homepage/$, homepage, name='index'),     url(r'^vibeapp$', vibeapp, name='index'),     ... 

Comments