-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathurls.py
28 lines (23 loc) · 923 Bytes
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-
"""
hijax.app
~~~~~~~~~
This demo is a proof of concept for the hijax technique, with Django
Based on the example found at http://duganchen.ca/single-page-web-app-architecture-done-right
More about Hijax: http://en.wikipedia.org/wiki/Hijax
:autor: 2011 by Marc Puig ([email protected]).
"""
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import redirect_to
from django.conf import settings
urlpatterns = patterns('',
('^$', redirect_to, {'url': '/items'}),
('^items$', 'items.views.items'),
('^edit/1$', 'items.views.edit'),
('^ajax/items$', 'items.views.items_ajax'),
('^ajax/edit$', 'items.views.edit_ajax'),
)
if settings.DEBUG:
urlpatterns+= patterns('',
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT, 'show_items': True})
)