Instead of default page display some message using django

In the login app do these to make default page to some message,,,,





url.py
====
from django.conf.urls import include, url
from django.contrib import admin
from login.views import home
#from . import views

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),

    url(r'^$', 'login.views.home', name='home'),

]



views.py
=====

from django.http import HttpResponse
#from django.shortcuts import render



def home(request):
    return HttpResponse("Hello, world. You're at the polls index.")




setting.py
======



INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'login',
)


$python manage.py runserver


o/p
===



Hello, world. You're at the polls index.

No comments:

Post a Comment