"""Base urls used by Satchmo. Split out from urls.py to allow much easier overriding and integration with larger apps. """ from django.conf.urls import patterns, include from satchmo_utils.signals import collect_urls from product.urls.base import adminpatterns as prodpatterns from shipping.urls import adminpatterns as shippatterns import logging import satchmo_store log = logging.getLogger('shop.urls') urlpatterns = patterns('', (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^accounts/', include('satchmo_store.accounts.urls')), (r'^settings/', include('livesettings.urls')), (r'^cache/', include('keyedcache.urls')), ) + prodpatterns + shippatterns collect_urls.send(sender=satchmo_store, patterns=urlpatterns)
(r'^register/$', 'register', {}, 'registration_register'), (r'^secure/login/$', 'emaillogin', {'SSL' : True, 'template_name': 'registration/login.html'}, 'auth_secure_login'), ) verify = (config_value('SHOP', 'ACCOUNT_VERIFICATION') == 'EMAIL') urlpatterns += patterns('django.views.generic', (r'^register/complete/$', 'simple.direct_to_template', {'template': 'registration/registration_complete.html', 'extra_context': {'verify': verify }}, 'registration_complete'), ) #Dictionary for authentication views password_reset_dict = { 'template_name': 'registration/password_reset_form.html', 'email_template_name': 'registration/password_reset.txt', } # the "from email" in password reset is problematic... it is hard coded as None urlpatterns += patterns('django.contrib.auth.views', (r'^password_reset/$', 'password_reset', password_reset_dict, 'auth_password_reset'), (r'^password_reset/done/$', 'password_reset_done', {'template_name':'registration/password_reset_done.html'}, 'auth_password_reset_done'), (r'^password_change/$', 'password_change', {'template_name':'registration/password_change_form.html'}, 'auth_password_change'), (r'^password_change/done/$', 'password_change_done', {'template_name':'registration/password_change_done.html'}, 'auth_change_done'), (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'password_reset_confirm'), (r'^reset/done/$', 'password_reset_complete'), ) collect_urls.send(sender=accounts, patterns=urlpatterns)
(r'^cart/accept/$', 'cart.agree_terms', {}, 'satchmo_cart_accept_terms'), (r'^cart/add/$', 'cart.add', {}, 'satchmo_cart_add'), (r'^cart/add/ajax/$', 'cart.add_ajax', {}, 'satchmo_cart_add_ajax'), (r'^cart/qty/$', 'cart.set_quantity', {}, 'satchmo_cart_set_qty'), (r'^cart/qty/ajax/$', 'cart.set_quantity_ajax', {}, 'satchmo_cart_set_qty_ajax'), (r'^cart/remove/$', 'cart.remove', {}, 'satchmo_cart_remove'), (r'^cart/remove/ajax/$', 'cart.remove_ajax', {}, 'satchmo_cart_remove_ajax'), (r'^checkout/', include('payment.urls')), (r'^contact/$', 'contact.form', {}, 'satchmo_contact'), (r'^history/$', 'orders.order_history', {}, 'satchmo_order_history'), (r'^quickorder/$', 'cart.add_multiple', {}, 'satchmo_quick_order'), (r'^tracking/(?P<order_id>\d+)/$', 'orders.order_tracking', {}, 'satchmo_order_tracking'), (r'^search/$', 'search.search_view', {}, 'satchmo_search'), ) # here we add product patterns directly into the root url urlpatterns += productpatterns urlpatterns += patterns('', (r'^contact/thankyou/$', TemplateView.as_view(template_name='shop/contact_thanks.html'), {}, 'satchmo_contact_thanks'), (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}, 'satchmo_sitemap_xml'), ) # here we are sending a signal to add patterns to the base of the shop. collect_urls.send(sender=shop, patterns=urlpatterns)
from category import urlpatterns as catpatterns from django.conf.urls import url, include from products import urlpatterns as prodpatterns import product from satchmo_utils.signals import collect_urls from satchmo_store.shop import get_satchmo_setting catbase = r'^' + get_satchmo_setting('CATEGORY_SLUG') + '/' prodbase = r'^' + get_satchmo_setting('PRODUCT_SLUG') + '/' urlpatterns = [ url(prodbase, include('product.urls.products')), url(catbase, include('product.urls.category')), ] collect_urls.send(product, section="__init__", patterns = urlpatterns)
(r'^cart/qty/$', 'cart.set_quantity', {}, 'satchmo_cart_set_qty'), (r'^cart/qty/ajax/$', 'cart.set_quantity_ajax', {}, 'satchmo_cart_set_qty_ajax'), (r'^cart/remove/$', 'cart.remove', {}, 'satchmo_cart_remove'), (r'^cart/remove/ajax/$', 'cart.remove_ajax', {}, 'satchmo_cart_remove_ajax'), (r'^checkout/', include('payment.urls')), (r'^contact/$', 'contact.form', {}, 'satchmo_contact'), (r'^history/$', 'orders.order_history', {}, 'satchmo_order_history'), (r'^quickorder/$', 'cart.add_multiple', {}, 'satchmo_quick_order'), (r'^tracking/(?P<order_id>\d+)/$', 'orders.order_tracking', {}, 'satchmo_order_tracking'), (r'^search/$', 'search.search_view', {}, 'satchmo_search'), ) # here we add product patterns directly into the root url urlpatterns += productpatterns urlpatterns += patterns( '', (r'^contact/thankyou/$', TemplateView.as_view(template_name='shop/contact_thanks.html'), {}, 'satchmo_contact_thanks'), (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', { 'sitemaps': sitemaps }, 'satchmo_sitemap_xml'), ) # here we are sending a signal to add patterns to the base of the shop. collect_urls.send(sender=shop, patterns=urlpatterns)
template_name='registration/registration_complete.html'), {}, 'registration_complete'), ) #Dictionary for authentication views password_reset_dict = { 'template_name': 'registration/password_reset_form.html', 'email_template_name': 'registration/password_reset.txt', } # the "from email" in password reset is problematic... it is hard coded as None urlpatterns += patterns( 'django.contrib.auth.views', (r'^password_reset/$', 'password_reset', password_reset_dict, 'auth_password_reset'), (r'^password_reset/done/$', 'password_reset_done', { 'template_name': 'registration/password_reset_done.html' }, 'auth_password_reset_done'), (r'^password_change/$', 'password_change', { 'template_name': 'registration/password_change_form.html' }, 'auth_password_change'), (r'^password_change/done/$', 'password_change_done', { 'template_name': 'registration/password_change_done.html' }, 'auth_change_done'), (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'password_reset_confirm'), (r'^reset/done/$', 'password_reset_complete'), ) collect_urls.send(sender=accounts, patterns=urlpatterns)
from django.conf.urls import * import product from satchmo_utils.signals import collect_urls urlpatterns = patterns('product.views', (r'^(?P<product_slug>[-\w]+)/$', 'get_product', {}, 'satchmo_product'), (r'^(?P<product_slug>[-\w]+)/prices/$', 'get_price', {}, 'satchmo_product_prices'), (r'^(?P<product_slug>[-\w]+)/price_detail/$', 'get_price_detail', {}, 'satchmo_product_price_detail'), ) urlpatterns += patterns('product.views.filters', (r'^view/recent/$', 'display_recent', {}, 'satchmo_product_recently_added'), (r'^view/bestsellers/$', 'display_bestsellers', {}, 'satchmo_product_best_selling'), ) # here we are sending a signal to add patterns to the base of the shop. collect_urls.send(sender=product, patterns=urlpatterns, section="product")
from category import urlpatterns as catpatterns from django.conf.urls.defaults import * from livesettings import config_value from product import urlpatterns as prodpatterns import product from satchmo_utils.signals import collect_urls catbase = r'^' + config_value('PRODUCT','CATEGORY_SLUG') + '/' prodbase = r'^' + config_value('PRODUCT','PRODUCT_SLUG') + '/' urlpatterns = patterns('', (prodbase, include('product.urls.product')), (catbase, include('product.urls.category')), ) collect_urls.send(product, section="__init__", patterns = urlpatterns)
""" URLConf for Satchmo Contacts. """ from django.conf.urls import patterns from satchmo_utils.signals import collect_urls from satchmo_store import contact from satchmo_store.shop.satchmo_settings import get_satchmo_setting ssl = get_satchmo_setting('SSL', default_value=False) urlpatterns = patterns('satchmo_store.contact.views', (r'^$', 'view', {}, 'satchmo_account_info'), (r'^update/$', 'update', {}, 'satchmo_profile_update'), (r'^address/create/$', 'address_create_edit',{},'satchmo_address_create'), (r'^address/edit/(?P<id>\d+)/$','address_create_edit',{},'satchmo_address_edit'), (r'^address/delete/(?P<id>\d+)/$','address_delete',{},'satchmo_address_delete'), (r'^ajax_state/$', 'ajax_get_state', {'SSL': ssl}, 'satchmo_contact_ajax_state'), ) collect_urls.send(sender=contact, patterns=urlpatterns)
from django.conf.urls import url import product from satchmo_utils.signals import collect_urls from product.views.filters import RecentListView, BestsellersListView urlpatterns = [ url(r'^(?P<product_slug>[-\w]+)/$', product.views.get_product, name='satchmo_product'), url(r'^(?P<product_slug>[-\w]+)/prices/$', product.views.get_price, name='satchmo_product_prices'), url(r'^(?P<product_slug>[-\w]+)/price_detail/$', product.views.get_price_detail, name='satchmo_product_price_detail'), ] urlpatterns += [ url(r'^view/recent/$', RecentListView.as_view(), name='satchmo_product_recently_added'), url(r'^view/bestsellers/$', BestsellersListView.as_view(), name='satchmo_product_best_selling'), ] # here we are sending a signal to add patterns to the base of the shop. collect_urls.send(sender=product, patterns=urlpatterns, section="product")