Skip to content

Commit 96d095e

Browse files
author
Kenneth Reitz
committed
single view
1 parent 84e9761 commit 96d095e

7 files changed

Lines changed: 22 additions & 0 deletions

File tree

gettingstarted/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
'django.contrib.sessions',
4040
'django.contrib.messages',
4141
'django.contrib.staticfiles',
42+
'hello'
4243
)
4344

4445
MIDDLEWARE_CLASSES = (

gettingstarted/urls.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
from django.contrib import admin
44
admin.autodiscover()
55

6+
import hello.views
7+
68
urlpatterns = patterns('',
79
# Examples:
810
# url(r'^$', 'gettingstarted.views.home', name='home'),
911
# url(r'^blog/', include('blog.urls')),
1012

13+
url(r'^$', hello.views.index, name='index'),
1114
url(r'^admin/', include(admin.site.urls)),
15+
1216
)

hello/__init__.py

Whitespace-only changes.

hello/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

hello/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.db import models
2+
3+
# Create your models here.
4+
class Greeting(models.Model):
5+
when = models.DateTimeField('date created', auto_now_add=True)

hello/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

hello/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.shortcuts import render
2+
from django.http import HttpResponse
3+
4+
# Create your views here.
5+
def index(request):
6+
return HttpResponse('Hello from Python!')

0 commit comments

Comments
 (0)