root/trunk/djedna/urls.py

Revision 466, 2.9 kB (checked in by thomas, 7 months ago)

More catalog2 tests, first djedna generic view, and the start of the new default djedna template set called "marlowe"

  • Property svn:executable set to *
Line 
1 # (c) Copyright 2008 Thomas Bohmbach, Jr.
2 #
3 # This file is part of DJ Edna.
4 #
5 # DJ Edna is free software: you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option)
8 # any later version.
9 #
10 # DJ Edna is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13 # more details.
14 #
15 # You should have received a copy of the GNU General Public License along with
16 # DJ Edna.  If not, see <http://www.gnu.org/licenses/>.
17
18 import urlparse
19
20 from django.conf import settings
21 from django.conf.urls.defaults import *
22
23 urlpatterns = patterns('',
24     (r'^$', 'django.views.generic.simple.redirect_to', {'url' : '/catalog/'}),
25
26     (r'^catalog/', include('djedna.catalog.urls')),
27     (r'^catalog2/', include('djedna.catalog2.urls')),
28    
29     url(r'^accounts/activate/(?P<activation_key>\w+)/$',
30         'djedna.accounts.views.activate',
31         name='registration_activate'),
32     url(r'^accounts/register/$',
33         'djedna.accounts.views.register',
34         name='registration_register'),
35    
36     (r'^redeem/$', 'djedna.catalog.views.redeem_code', {}, "catalog_redeem"),
37     (r'^redeem/(?P<code>[\w]+)/$', 'djedna.catalog.views.redeem_code', {}, "catalog_redeem_code"),
38     (r'^redeem_success/(?P<code>[\w]+)/$', 'djedna.catalog.views.redeem_success', {}, "catalog_redeem_success"),
39 )
40
41 if settings.SATCHMO:
42     from satchmo.shop.views.sitemaps import sitemaps
43     if settings.SHOP_BASE == '':
44         shopregex = '^'
45     else:
46         shopregex = '^' + settings.SHOP_BASE[1:] + '/'
47     urlpatterns += patterns('',
48         (r'^admin/print/(?P<doc>[-\w]+)/(?P<id>\d+)', 'satchmo.shipping.views.displayDoc'),
49         (r'^admin/product/configurableproduct/(?P<id>\d+)/getoptions/', 'satchmo.product.views.getConfigurableProductOptions'),
50         (r'^admin/$', 'satchmo.shop.views.admin-portal.home'),
51         (r'^accounts/', include('satchmo.accounts.urls')),
52         (shopregex, include('satchmo.shop.urls')),
53         (r'sitemap.xml', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
54         (r'settings/', include('satchmo.configuration.urls')),
55         (r'cache/', include('satchmo.caching.urls')),
56     )
57
58 #Add contrib admin after satchmo (if applicable)
59 urlpatterns += patterns('',
60     (r'^admin/', include('django.contrib.admin.urls')),
61     (r'^accounts/', include('registration.urls')),
62 )
63
64 #Just for development.  These static dirs should be configured and served by apache
65 # zipregex = '^%s/%s/(?P<path>.*)$' % (settings.MEDIA_NAME, settings.ZIP_DIRNAME)
66 mediaregex = '^%s/(?P<path>.*)$' % settings.MEDIA_NAME
67 urlpatterns += patterns('',
68         # (zipregex, 'djedna.catalog.views.serve_zip_file'),
69         (mediaregex, 'djedna.mediaserver.views.serve', {'document_root':  settings.MEDIA_ROOT}),
70 )
Note: See TracBrowser for help on using the browser.