From 4560c925fc26dcb698ff42a7858b2ea8626b0d82 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 1 Oct 2013 23:40:42 +0200 Subject: [PATCH] Moved "static" pages to the basics app --- basics/__init__.py | 0 basics/templates/basics/disclaimer.html | 12 ++++++++++++ basics/tests.py | 16 ++++++++++++++++ basics/urls.py | 8 ++++++++ basics/views.py | 10 ++++++++++ blog/urls.py | 3 --- blog/views.py | 8 -------- .../static/images/komodomedia_azure_16.png | Bin 0 -> 643 bytes .../templates/front_base.html | 6 +++--- gergelypolonkai_django/urls.py | 10 ++++------ 10 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 basics/__init__.py create mode 100644 basics/templates/basics/disclaimer.html create mode 100644 basics/tests.py create mode 100644 basics/urls.py create mode 100644 basics/views.py create mode 100755 gergelypolonkai_django/static/images/komodomedia_azure_16.png diff --git a/basics/__init__.py b/basics/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/basics/templates/basics/disclaimer.html b/basics/templates/basics/disclaimer.html new file mode 100644 index 0000000..ebf1ce7 --- /dev/null +++ b/basics/templates/basics/disclaimer.html @@ -0,0 +1,12 @@ +{% extends "front_base.html" %} + +{% load static from staticfiles %} + +{% block title %} - Disclaimer{% endblock %} + +{% block content %} +

Disclaimer

+

The articles and thoughts on this site all originate from me, unless otherwise stated. Please use them with this statement in your mind. If you use anything, please put a backlink on your site to the given article(s) or the main page.

+

The social media icons on the right are from komodomedia.com komodomedia.com.

+

Some design ideas, like the arrows under the menu items are from a friend, Judit Pásti. +{% endblock content %} diff --git a/basics/tests.py b/basics/tests.py new file mode 100644 index 0000000..501deb7 --- /dev/null +++ b/basics/tests.py @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this 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.assertEqual(1 + 1, 2) diff --git a/basics/urls.py b/basics/urls.py new file mode 100644 index 0000000..0c55d21 --- /dev/null +++ b/basics/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls import patterns, url +from basics import views + +urlpatterns = patterns('', + url(r'^resume', views.resume, name='resume'), + url(r'^about', views.about, name='about'), + url(r'^disclaimer', views.disclaimer, name='disclaimer'), +) diff --git a/basics/views.py b/basics/views.py new file mode 100644 index 0000000..45df0be --- /dev/null +++ b/basics/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render + +def resume(request): + return render(request, 'resume.html', {}) + +def about(request): + return render(request, 'basics/about.html', {}) + +def disclaimer(request): + return render(request, 'basics/disclaimer.html', {}) diff --git a/blog/urls.py b/blog/urls.py index a0f8588..b11cbac 100644 --- a/blog/urls.py +++ b/blog/urls.py @@ -6,7 +6,4 @@ urlpatterns = patterns('', url(r'^feed$', views.feed, name='feed'), url(r'^tag/(?P.*)$', views.taglist, name='taglist'), url(r'^(?P\d+)/(?P\d+)/(?P\d+)/(?P[^/]+)$', views.read, name='read'), - url(r'^resume', views.resume, name='resume'), - url(r'^about', views.resume, name='about'), - url(r'^disclaimer', views.resume, name='disclaimer'), ) diff --git a/blog/views.py b/blog/views.py index 4dd6b2b..5d0b1d5 100644 --- a/blog/views.py +++ b/blog/views.py @@ -21,11 +21,3 @@ def taglist(request, tag): def feed(request): return render(request, 'blog/feed.xml', {}) -def resume(request): - return render(request, 'resume.html', {}) - -def about(request): - return renden(request, 'about.html', {}) - -def disclaimer(request): - return renden(request, 'disclaimer.html', {}) diff --git a/gergelypolonkai_django/static/images/komodomedia_azure_16.png b/gergelypolonkai_django/static/images/komodomedia_azure_16.png new file mode 100755 index 0000000000000000000000000000000000000000..02b1d8229d1021745a8f132bf62505dbed6c120e GIT binary patch literal 643 zcmV-}0(||6P)6?8>dbVG7wVRUJ4ZXi@?ZDjyAFETeTFgZd4&$$2q0o+MM zK~y-6m6E@2(?A@>KXxoNCJJ%V7Kx>a7(h$}wruUzp#uwLjSxS?0O|%a@Ha4$OiT<6 zL4v6uwIBu>p(+vs5^+@tlm;huNbI|FYz8Y-5sP!uTb}Ow?tR}qjhC-Vm}ZMirp6*? zI{k$2Zy9Jti-J{SwFH`$Za9wN#HkUemO&ULFMqceGC&~@VN^2^0#2O8h9Q{|0t2BS z8$#y?_yR7iLHeG>O{o46>^{Cj zwS1l{C2L;5m*@xyD*SJ~#{F$7#j`YSUB}906EcjFyE6!hj-O=E?GNV!hJm2lA25vL zQ!iCK>nwW0t}D


@@ -62,7 +62,7 @@
- :: Copyright © 2012, Gergely Polonkai :: Disclaimer :: + :: Copyright © 2012, Gergely Polonkai :: Disclaimer ::
Fork me on GitHub diff --git a/gergelypolonkai_django/urls.py b/gergelypolonkai_django/urls.py index bdd3eb2..8ce18e7 100644 --- a/gergelypolonkai_django/urls.py +++ b/gergelypolonkai_django/urls.py @@ -5,12 +5,10 @@ admin.autodiscover() urlpatterns = patterns('', # Examples: - url(r'^$', 'blog.views.mainpage', name='home'), - # url(r'^$', 'gergelypolonkai_django.views.home', name='home'), - url(r'^blog/', include('blog.urls', namespace='blog')), - + url(r'^$', 'blog.views.mainpage', name='home'), + url(r'^blog/', include('blog.urls', namespace='blog')), # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - - url(r'^admin/', include(admin.site.urls)), + url(r'^admin/', include(admin.site.urls)), + url(r'^', include('basics.urls', namespace='basics')), )