Can anyone help me with this issue. When I try to access I get the following error.
Request Method: GET
Request URL:
Using the URLconf defined in myproject.urls, Django tried these URL patterns, in this order:
^admin/
^myproject/$ [name='home']
The current URL, , didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
#url(r'^$', 'myproject.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^booking/$', 'booking.views.home', name ='home'),
)
views.py
from django.shortcuts import render
#..
# Create your views here.
def index(request):
return render("Hello, guesthouse!!")
settings.py
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'booking',
)
ROOT_URLCONF = 'myproject.urls'
WSGI_APPLICATION = 'myproject.wsgi.application'
admin.py
from django.contrib import admin
from booking.models import Bookings
# Register your models here.
admin.site.register(Bookings)
Thank you, Rads