diff options
author | 2009-08-07 09:28:47 +0200 | |
---|---|---|
committer | 2009-08-07 09:28:47 +0200 | |
commit | 3742e8979826ac9ec65255726b51b4b6f9d26de5 (patch) | |
tree | e1dc5221ad8736c8b42d3a654cb342085874f795 | |
parent | Add basic web presentation structure (diff) | |
download | collagen-3742e8979826ac9ec65255726b51b4b6f9d26de5.tar.gz collagen-3742e8979826ac9ec65255726b51b4b6f9d26de5.tar.bz2 collagen-3742e8979826ac9ec65255726b51b4b6f9d26de5.zip |
Prepared urls and settings for templates
-rw-r--r-- | web/@medzi | 0 | ||||
-rw-r--r-- | web/collagen/urls.py | 6 | ||||
-rw-r--r-- | web/collagen/views.py | 7 | ||||
-rw-r--r-- | web/settings.py | 1 | ||||
-rw-r--r-- | web/urls.py | 2 |
5 files changed, 15 insertions, 1 deletions
diff --git a/web/@medzi b/web/@medzi deleted file mode 100644 index e69de29..0000000 --- a/web/@medzi +++ /dev/null diff --git a/web/collagen/urls.py b/web/collagen/urls.py new file mode 100644 index 0000000..5ac48ed --- /dev/null +++ b/web/collagen/urls.py @@ -0,0 +1,6 @@ +from django.conf.urls.defaults import * + + +urlpatterns = patterns('web.collagen.views', + (r'^$', 'index'), +) diff --git a/web/collagen/views.py b/web/collagen/views.py index 60f00ef..9c231bd 100644 --- a/web/collagen/views.py +++ b/web/collagen/views.py @@ -1 +1,8 @@ # Create your views here. + +from django.shortcuts import render_to_response +from web.collagen.models import Package + +def index(request): + last_pkgs = Package.objects.all().order_by('-id')[:5] + return render_to_response('index.html', {'latest_packages': last_pkgs}) diff --git a/web/settings.py b/web/settings.py index a732c73..abc2473 100644 --- a/web/settings.py +++ b/web/settings.py @@ -69,6 +69,7 @@ TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. + '/home/w0rm/Projects/GSoC/collagen/web/templates' ) INSTALLED_APPS = ( diff --git a/web/urls.py b/web/urls.py index e643225..044e341 100644 --- a/web/urls.py +++ b/web/urls.py @@ -6,7 +6,7 @@ admin.autodiscover() urlpatterns = patterns('', # Example: - # (r'^web/', include('web.foo.urls')), + (r'^collagen/', include('web.collagen.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: |