Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
single view
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Aug 14, 2014
1 parent 84e9761 commit 96d095e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions gettingstarted/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'hello'
)

MIDDLEWARE_CLASSES = (
Expand Down
4 changes: 4 additions & 0 deletions gettingstarted/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
from django.contrib import admin
admin.autodiscover()

import hello.views

urlpatterns = patterns('',
# Examples:
# url(r'^$', 'gettingstarted.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),

url(r'^$', hello.views.index, name='index'),
url(r'^admin/', include(admin.site.urls)),

)
Empty file added hello/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions hello/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions hello/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.db import models

# Create your models here.
class Greeting(models.Model):
when = models.DateTimeField('date created', auto_now_add=True)
3 changes: 3 additions & 0 deletions hello/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
6 changes: 6 additions & 0 deletions hello/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.shortcuts import render
from django.http import HttpResponse

# Create your views here.
def index(request):
return HttpResponse('Hello from Python!')

0 comments on commit 96d095e

Please sign in to comment.