I am new to Django and trying to figure out how URLs work in Django.
My urls.py application
from django.conf.urls import url, patterns import views urlpatterns = patterns('', url(r'^$', views.index, name='index'))
Urls.py project
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^app/', include('app.urls')), )
APPEND_SLASH = True installed in settings.py , and the application is included in INSTALLED_APPS .
I get a page not found when I go to localhost:8000/app .
Now I also canβt go to localhost:8000/admin .
RuntimeError at /admin/ maximum recursion depth exceeded
app views.py
from django.http import HttpResponse def index(request): return HttpResponse("This is Hello")
Settings.py
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) APPEND_SLASH = True # Quick-start development settings - unsuitable for production # See https:
What am I doing wrong. Please, help.
python django
ajkumar25
source share