From 5d1b26d4f7e5d1d28e5a28696fb90560029ea3e8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 May 2015 17:15:20 +0200 Subject: [PATCH] add first view to digital.glarus Signed-off-by: Nico Schottelius --- digital_glarus/migrations/0001_initial.py | 24 +++++++++++++++++++++++ digital_glarus/urls.py | 7 +++++++ digital_glarus/views.py | 5 ++++- dynamicweb/urls.py | 1 + 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 digital_glarus/migrations/0001_initial.py create mode 100644 digital_glarus/urls.py diff --git a/digital_glarus/migrations/0001_initial.py b/digital_glarus/migrations/0001_initial.py new file mode 100644 index 00000000..3b0eef5e --- /dev/null +++ b/digital_glarus/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Message', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, primary_key=True, auto_created=True)), + ('name', models.CharField(max_length=200)), + ('email', models.EmailField(max_length=254)), + ('phone_number', models.CharField(max_length=200)), + ('message', models.TextField()), + ('received_date', models.DateTimeField(verbose_name='date received')), + ], + ), + ] diff --git a/digital_glarus/urls.py b/digital_glarus/urls.py new file mode 100644 index 00000000..a3780aa2 --- /dev/null +++ b/digital_glarus/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^$', views.index, name='index'), +] diff --git a/digital_glarus/views.py b/digital_glarus/views.py index 91ea44a2..65ed4fcc 100644 --- a/digital_glarus/views.py +++ b/digital_glarus/views.py @@ -1,3 +1,6 @@ from django.shortcuts import render -# Create your views here. +from django.http import HttpResponse + +def index(request): + return HttpResponse("Hello, world. You're at the polls index.") diff --git a/dynamicweb/urls.py b/dynamicweb/urls.py index 4def052b..dfb7a04b 100644 --- a/dynamicweb/urls.py +++ b/dynamicweb/urls.py @@ -7,4 +7,5 @@ urlpatterns = [ # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), + url(r'^digital.glarus/', include('digital_glarus.urls')), ]