Allow shop to be at base of url, not just a subdirectory

Issue #40 resolved
Former user created an issue

Currently, satchmo/urls.py assumes that you always want to put the shop under a subdirectory. If you want to put it at the base of the site, it just doesn't work properly.

In settings.py, if you have "SHOP_BASE='/shop'", then the url resolves to: http://yourshop.com/shop

if you have "SHOP_BASE='/'" then the url resolves to: http://yourshop.com// AND the url includes don't work.

This patch makes the Satchmo app "do the right thing" if SHOP_BASE is empty or "/" by simply including the satchmo/shop/urls into the base patterns in that case.

Reported by bkroeze

Comments (2)

  1. Former user Account Deleted

    I don't think that SHOP_BASE of "/" is valid, since Satchmo seems to assume that it can safely add a trailing slash (which is implied in the SHOP_BASE comment). I think that the comment in local_settings-customize.py should be changed to make it obvious which to use:

    #### Satchmo unique variables ####
    #This is the base url for the shop.  Only include a leading slash
    -#examples: '/shop' or '/mystore'
    +#examples: '/shop' or ''
    

    BR I'm attaching a diff that does the same thing as your patch, but with less logic and only for SHOP_BASE="".

  2. Log in to comment