Replacing the Satchmo homepage by overriding URLs

You can override URLs used by Satchmo by using the built-in urlhelper.

So my project urls.py looks a bit like this:

from django.conf.urls.defaults import *

from satchmo_store.urls import urlpatterns

from django.conf import settings
from satchmo_utils import urlhelper

urlpatterns += patterns('',
    #add my normal urls here
    (r'^blog/index/$', 'myblog.views.blogindex'),
    (r'^photos/', include('photoapp.urls')),
)

urlhelper.replace_urlpatterns(
    urlpatterns,
    [
        #add override urls here (match the name from satchmo's url files)
        url(r'^$', 'myblog.views.homepage', {}, name='satchmo_shop_home'),
    ]
)
This entry was posted in Projects and tagged . Bookmark the permalink.