diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2011-03-19 22:15:12 +0200 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2011-03-19 22:15:12 +0200 |
| commit | b454a79d106d256f7eea8d0e23567e613928bab5 (patch) | |
| tree | 34972655b02eefc9a0be7bbf22da8ff632e2ea92 | |
| parent | df5544cfe638bc2246f6821e6089dec7c1ad2494 (diff) | |
and it worked
| -rw-r--r-- | demo/main/__init__.py | 0 | ||||
| -rw-r--r-- | demo/main/models.py | 3 | ||||
| -rw-r--r-- | demo/main/tests.py | 23 | ||||
| -rw-r--r-- | demo/main/views.py | 5 | ||||
| -rw-r--r-- | demo/urls.py | 2 | ||||
| -rw-r--r-- | fb/context_processors.py | 4 |
6 files changed, 34 insertions, 3 deletions
diff --git a/demo/main/__init__.py b/demo/main/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/demo/main/__init__.py diff --git a/demo/main/models.py b/demo/main/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/demo/main/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/demo/main/tests.py b/demo/main/tests.py new file mode 100644 index 0000000..2247054 --- /dev/null +++ b/demo/main/tests.py @@ -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 +"""} + diff --git a/demo/main/views.py b/demo/main/views.py new file mode 100644 index 0000000..8e71fa8 --- /dev/null +++ b/demo/main/views.py @@ -0,0 +1,5 @@ +from django.shortcuts import render_to_response +from django.template import RequestContext + +def index(request): + return render_to_response('main.html', {}, context_instance=RequestContext(request))
\ No newline at end of file diff --git a/demo/urls.py b/demo/urls.py index 5b3c71e..29533a2 100644 --- a/demo/urls.py +++ b/demo/urls.py @@ -7,7 +7,7 @@ from django.template import Context, loader admin.autodiscover() urlpatterns = patterns('', - (r'^$', lambda r: HttpResponse(loader.get_template('main.html').render(Context({})))), + (r'^$', 'demo.main.views.index'), (r'^fb/', include('fb.urls')), (r'^admin/doc/', include('django.contrib.admindocs.urls')), diff --git a/fb/context_processors.py b/fb/context_processors.py index 92a9a0a..82e4d4f 100644 --- a/fb/context_processors.py +++ b/fb/context_processors.py @@ -1,5 +1,5 @@ from django.conf import settings def fb_app_id(request): - print 'bla' - return { settings.FACEBOOK_APP_ID }
\ No newline at end of file + """Add the Facebook app id to template context""" + return { 'FACEBOOK_APP_ID' : settings.FACEBOOK_APP_ID }
\ No newline at end of file |
