Skip to content

Commit

Permalink
basic build
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Kingshott committed May 15, 2010
1 parent 5358fa9 commit 7a0aece
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion techmeetup/blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.template.defaultfilters import slugify
import datetime

class Post():
class Post(models.Model):
author = models.ForeignKey(User, related_name='posts')
title = models.CharField(max_length=200)
slug = models.CharField(max_length=200)
Expand Down
Empty file added techmeetup/front/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions techmeetup/front/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
23 changes: 23 additions & 0 deletions techmeetup/front/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""

from django.test import TestCase

class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.failUnlessEqual(1 + 1, 2)

__test__ = {"doctest": """
Another way to test that 1 + 1 is equal to 2.
>>> 1 + 1 == 2
True
"""}

8 changes: 8 additions & 0 deletions techmeetup/front/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.conf.urls.defaults import *
from django.conf import settings

urlpatterns = patterns('',
url(r'^$',
"front.views.front",
name='front'),
)
4 changes: 4 additions & 0 deletions techmeetup/front/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.shortcuts import render_to_response

def front(request):
return render_to_response('front/base.html')
1 change: 1 addition & 0 deletions techmeetup/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'front',
'blog',
)

Expand Down
25 changes: 25 additions & 0 deletions techmeetup/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% block title %}{% endblock %}</title>

{% block head %}{% endblock head %}

</head>

<body>
<h1>Techmeetup.co.uk</h1>
<div id="topnav">
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Videos</a></li>
<li><a href="#">Speakers</a></li>
<li><a href="#">Calendar</a></li>
</ul>
</div>
{% block content %}
{% endblock content %}
</body>

</html>
Empty file.
11 changes: 11 additions & 0 deletions techmeetup/templates/blog/post_detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "base.html" %}

{% if object %}

<h1>{{ object.title }}</h1>

<p>{{ object.created }}</p>

<div class="blog_body">
{{ object.body }}
</div>
3 changes: 3 additions & 0 deletions techmeetup/templates/front/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% extends "base.html" %}


1 change: 1 addition & 0 deletions techmeetup/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
admin.autodiscover()

urlpatterns = patterns('',
(r'^$', include('front.urls')),
(r'^blog/', include('blog.urls')),

# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
Expand Down

0 comments on commit 7a0aece

Please sign in to comment.