aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2012-12-04 14:52:04 -0500
committerMike Crute <mcrute@gmail.com>2012-12-11 15:27:46 -0500
commit39850fe5e8a23b402610167e33540ee615aed3ab (patch)
tree255afc8b221d34c2cd087da89b4411653fb629d5
parent95c903cf3596cbd8f8dd1115d17fc080dd6b27d9 (diff)
downloaddjango-precompiler-39850fe5e8a23b402610167e33540ee615aed3ab.tar.bz2
django-precompiler-39850fe5e8a23b402610167e33540ee615aed3ab.tar.xz
django-precompiler-39850fe5e8a23b402610167e33540ee615aed3ab.zip
Create home page
-rw-r--r--codemash/settings.py5
-rw-r--r--codemash/urls.py2
-rw-r--r--pages/views.py8
-rw-r--r--templates/index.html13
4 files changed, 26 insertions, 2 deletions
diff --git a/codemash/settings.py b/codemash/settings.py
index 0e609fd..3bf0f6a 100644
--- a/codemash/settings.py
+++ b/codemash/settings.py
@@ -1,5 +1,7 @@
1# Django settings for codemash project. 1# Django settings for codemash project.
2 2
3import os
4
3DEBUG = True 5DEBUG = True
4TEMPLATE_DEBUG = DEBUG 6TEMPLATE_DEBUG = DEBUG
5 7
@@ -21,6 +23,8 @@ DATABASES = {
21 } 23 }
22} 24}
23 25
26PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
27
24# Local time zone for this installation. Choices can be found here: 28# Local time zone for this installation. Choices can be found here:
25# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 29# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
26# although not all choices may be available on all operating systems. 30# although not all choices may be available on all operating systems.
@@ -107,6 +111,7 @@ TEMPLATE_DIRS = (
107 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". 111 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
108 # Always use forward slashes, even on Windows. 112 # Always use forward slashes, even on Windows.
109 # Don't forget to use absolute paths, not relative paths. 113 # Don't forget to use absolute paths, not relative paths.
114 os.path.join(PROJECT_ROOT, "templates"),
110) 115)
111 116
112INSTALLED_APPS = ( 117INSTALLED_APPS = (
diff --git a/codemash/urls.py b/codemash/urls.py
index 153db34..2fae4f3 100644
--- a/codemash/urls.py
+++ b/codemash/urls.py
@@ -6,7 +6,7 @@ from django.conf.urls import patterns, include, url
6 6
7urlpatterns = patterns('', 7urlpatterns = patterns('',
8 # Examples: 8 # Examples:
9 # url(r'^$', 'pages.views.home', name='home'), 9 url(r'^$', 'pages.views.home', name='home'),
10 # url(r'^codemash/', include('codemash.foo.urls')), 10 # url(r'^codemash/', include('codemash.foo.urls')),
11 11
12 # Uncomment the admin/doc line below to enable admin documentation: 12 # Uncomment the admin/doc line below to enable admin documentation:
diff --git a/pages/views.py b/pages/views.py
index 60f00ef..b656b34 100644
--- a/pages/views.py
+++ b/pages/views.py
@@ -1 +1,7 @@
1# Create your views here. 1from django.shortcuts import render
2
3
4def home(request):
5 """The home page view
6 """
7 return render(request, "index.html")
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..a522fbd
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,13 @@
1<!DOCTYPE html>
2<html>
3 <head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6 <title>Hello Codemash</title>
7 <meta name="viewport" content="width=device-width">
8 </head>
9 <body>
10 <h1>Hello Codemash</h1>
11 <p>You've just created your first Django page. Pretty cool, eh?</p>
12 </body>
13</html>