Clone wiki

satchmo / InstallationHints

Installation Hints

This place is a location for people to consolidate tips and tricks they learn while installing Satchmo. We'll try to incorporate them into the documentation.


URL Resolver Errors

Sometimes, you'll get a "!NoReverseMatch" of other url error that is difficult to diagnose. Here's one hint to learn more about where the error is coming from:

$ ./ shell

Python ...
>> from django.core import urlresolvers
>> urlresolvers.reverse('satchmo_product', None, {'product_slug' : 'foo'})

(The following is obsoleted with Django 1.0 or later:
Another user posted a solution here - In your django/contrib/comments/ folder, remove or rename the urls folder. It isn't needed anymore. That's how I solved a similar problem.)

SSL Redirect Errors

Every once in a while, people have trouble with the ssl redirects not working correctly. This thread describes a situation with Nginx. The solution in this case was to set the nginx config this way

For anybody else who runs into this, here's what that nginx config would look like:

location  ~ ^/shop/checkout {
                rewrite ^/(.*)$1 permanent;

SSL Redirect Error - Nginx

Here are some more thoughts on this issue. It comes from ticket #755:

In your nginx.conf file you need to have:

proxy_set_header X-Url-Scheme $scheme;

While your WSGI wrapper looks something like this:

import os, sys 

apache_configuration= os.path.dirname(__file__) 
project = os.path.dirname(apache_configuration) 
workspace = os.path.dirname(project) 

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' 

import django.core.handlers.wsgi 

_application = django.core.handlers.wsgi.WSGIHandler() 

def application(environ, start_response): 
    environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http') 
    return _application(environ, start_response)

Bad settings.LANGUAGE_CODE

This thread describes the issue

The following command will generate the locale on Unix systems.

sudo locale-gen en_US 

On Windows systems, make sure the LANGUAGE_CODE in your and files is set like this:


On one system, the problem was ISO-8859-1 vs. UTF-8. I had UTF-8 but not ISO-8859. Here's what I did to generate it and make everyone happy -

sudo localedef -i en_US -f ISO-8859-1 en_US

Customizing the home page view

Most people will want to customize the objects displayed on the home page. The easiest way to do this is override the urls in your file:

URLS = patterns('',
    (r'^search/$', '', {}, 'satchmo_search'),
    (r'^accounts/login/', 'sss_auth.views.login_signup_address', {}, 'auth_login'),
    (r'^$','', {}, 'oohga_home'),

Fixing Category Assignment

From the Coder's Eye blog Fixing category assigned with itself as parent

/opt/webapps/mystore $ ./ dbshell
mysql> update product_category set parent_id=null where id=parent_id;
mysql> quit

'comment_utils' is not a valid tag library

Here's the solution James Bennett posted in the mailing list

You most likely installed a very recent SVN checkout of comment_utils,
where that tag library has been renamed to avoid an import conflict: 

Checking out revision 86 worked for me.

Another way to get this working is to load moderated_comments instead of comment_utils in mystore/templates/_product_ratings.html. Don't know if there are any other places this should go.

SettingNotSet Error

Here is a discussion and fix for this error on google groups

IntegrityError in Live Settings

Here is a discussion and fix for this error on google groups

Apache 2 Virtual Host Config

This is what I've used to get Satchmo working with mod_python. It's based on the instructions at [].

Note the following locations:

  • Project directory: /var/www/mysatchmo
  • Django installation: /usr/src/django_src
<VirtualHost *>
        DocumentRoot /var/www/mysatchmo/htdocs
        ErrorLog /var/www/mysatchmo/logs/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        PythonDebug On

        CustomLog /var/www/mysatchmo/logs/access.log combined

        <Location "/">
                SetHandler python-program
                PythonHandler django.core.handlers.modpython
                PythonPath "['/var/www/']+sys.path"
                SetEnv DJANGO_SETTINGS_MODULE mysatchmo.settings
        Alias /media "/usr/src/django_src/django/contrib/admin/media"
        <Location /media>
                SetHandler None

        Alias /static "/var/www/mysatchmo/static"
        <Location /static>
                SetHandler None

        <LocationMatch "\.(jpg|gif|png)$">
                SetHandler None


Using the right owner and group and permissions for your file

Otherwise you will have to face to permissions problems, for example with Apache mod_python ([ERRNO 13])

# With Apache group = ""
chown -R yourusername.www-data /path/to/your/djangoproject
chmod -R g+w /path/to/your/djangoproject

Quick Satchmo

There is an attempt to provide a quick and easy installation. (It looks like it was completely integrated into Satchmo with improvments before 0.9 release.)

Just put your DB settins in qs_settings and run The script will create the default store provided in the official documentation.

Getting the i18n context

You'll need to add this line in your TEMPLATE_CONTEXT_PROCESSORS (in


An example of this is to populate the LANGUAGE_CODE tag in Satchmo's templates, base.html in particular on line 3:

<html xmlns=""
lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" 
{% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>

Otherwhise it will stay blank, and not validate.

Make the switch from local development to server production easy

Make a re-use of the LOCAL_DEV and DIRNAME variables in

DIRNAME = os.path.abspath(os.path.dirname(__file__))

# Assuming you are usig a file based database such as sqlite3
# and you want to store it at the root of your project
DATABASE_NAME = os.path.join(DIRNAME, 'mysite.db') # Or path to database file if using sqlite3.

    MEDIA_URL = ''
    MEDIA_URL = ''

# Assuming you made a copy of the locale path into your project directory
LOCALE_PATHS = "os.path.join(DIRNAME, 'locale')"

Then you will just have to switch LOCAL_DEV to False on the production server. Don't forget to configure your production server correctly. See notes above if you are an Apache user.