Source

satchmo / docs / configuration.txt

Basic Configuration
===================

Store Settings
--------------

.. index::
   single: settings; SHOP_BASE
   single: settings; LOCAL_DEV
   
If you followed the installation steps, you should have a basic store to start using.  There are a
number of places you might want to configure.

1. In the settings.py (or local_settings.py) file, there are a number of general Django settings.  However, there are a
   few that are specific to Satchmo. These default Satchmo settings can be overridden by adding them to a ``SATCHMO_SETTINGS`` 
   tuple like so::

        SATCHMO_SETTINGS = {
        SHOP_BASE: '/shop',
        MULTISHOP: False,
        CUSTOM_PRODUCT_MODULES: ['myshop.custom.product.model'],
        CUSTOM_PAYMENT_MODULES: ['myshop.custom.payments'],
        }

The following settings are available to be added to the SATCHMO_SETTINGS dictionary:
    
    - ``SHOP_BASE`` - used as the prefix for your store.  In the default setting, your store is located at www.yourname.com/shop.  If you would like to change this setting, this is the place to do it.  If you would like your store to be at the root of the url, set ``SHOP_BASE = ""``
    - ``SHOP_URLS`` documentation needed.
    - ``MULTISHOP`` - a boolean used to enable to disable multi store capability.
    - ``CUSTOM_NEWSLETTER_MODULES`` - a list of custom newsletters.
    - ``CUSTOM_PAYMENT_MODULES`` - a list of custom payment modules outside of the standard Satchmo distribution.
    - ``CUSTOM_SHIPPING_MODULES`` - a list of custom shipping modules outside of the standard Satchmo distribution.
    - ``CUSTOM_PRODUCT_MODULES`` - - a list of custom product modules outside of the standard Satchmo distribution.
    - ``CUSTOM_TAX_MODULES`` - a list of custom tax modules outside of the standard Satchmo distribution.

2. In addition to the Satchmo specific settings, there are some Django settings you will want to make sure are properly set:
    
    - Make sure that your ``DATABASE_ENGINE`` variable is also set correctly.
    - You should ensure that all of your paths are setup correctly.  Key ones to look at are:
        
        + ``MEDIA_ROOT`` (this is where images will be stored)
        + ``MEDIA_URL``
        + ``ADMIN_MEDIA_PREFIX``
        + ``TEMPLATE_DIRS``
        
Site Settings
-------------

The majority of the store configuration is done through the admin interface. Satchmo has a flexible Site Settings capability that can be accessed through the admin interface or through the url: /settings

All of the configuration settings have detailed help notes. They also default to sensible configurations so your initial store should work fine without changing any values.

Base Settings
^^^^^^^^^^^^^

These items are used for general store configuration and include:

    - Account verification options
    - Default currency symbol
    - Enable/disable product ratings
    - Controlling display of featured products
    - Controlling quality of thumbnail creating

.. index::
   single: Google; analytics
   single: Google; adwords

Google Settings
^^^^^^^^^^^^^^^

This section allows you to enable or disable google analytics and conversion tracking for adwords.

Language Settings
^^^^^^^^^^^^^^^^^

Allows the user to manually choose their language they would like to see.

Payment Settings
^^^^^^^^^^^^^^^^

Satchmo can handle multiple ways of accepting payment.  By default, you have a dummy processor that does nothing but accept payments.  Obviously, you'll want to enable one of the other modules before going live.

Each payment module will have it's own configuration items. These items apply universally to all payment modules.

    - Accept real payments
    - Allow URL access for cron rebilling of subscriptions
    - Force ship to and bill to countries to match during checkout
    - Cron passkey to allow subscription rebilling
    - Enable/disable ssl for the checkout process
    - Enable specific payment modules.
    
.. Note::
    If you add a new payment module, you will need to save the changes in order for the new payment module configuration items to appear.
    
.. Warning::
    After saving changes to your payment processor, you will need to restart your server for the changes to take effect.
        
.. index::
   single: Product types; enabling

Product Settings
^^^^^^^^^^^^^^^^

Before you use any of the products, you need to enable them in this section. The following products are available here:

    - Configurable Products
    - Product Variations
    - Custom Orders
    - Subscription Products
    - Downloadable Products
    - Gift Certificates
    
In this section you can also configure:

    - Protected directory to be used for downloadable products
    - Whether or not images should be renamed
    - Specific directory where images should be uploaded

.. index::
   single: Shipping; enabling
   
Shipping Settings
^^^^^^^^^^^^^^^^^

This section allows you to choose which shipping modules you want to make available to users when they check out.

Once you select the modules you would like to use, you will be given an option to enter any additional information required for that module.

.. index::
   single: Tax; enabling

Tax Settings
^^^^^^^^^^^^

Satchmo allows different tax configurations. This section allows you to choose the active tax module and configure it for your store.

.. index::
   single: Newsletters; enabling

.. _newsletter:

Newsletters
^^^^^^^^^^^

Satchmo has two methods for handling newsletter subscriptions.  By default, you have an "ignore it" processor enabled.
To enable handling, first add "satchmo.newsletter" to your list of installed modules in your settings file.

Next, choose the way you want to handle the subscriptions.  Currently we have two working newsletter plugins:

	- ``satchmo.newsletter.simple``  - This just tracks subscriptions in a database table for your querying pleasure.  You can then export that list to whatever mailing manager you want to use.
	- ``satchmo.newsletter.mailman`` - This is an integration module which works with Gnu Mailman (http://www.gnu.org/software/mailman/).  This is particularly convenient if you have a Cpanel VPS system, since Mailman is installed by default on most such systems. To use this, you need to make sure Mailman is on your PYTHONPATH and you should have already set up a mailing list as an announce-only list (http://www.modwest.com/help/kb13-195.html). You'll need to enter the name of the list in your local settings file.

.. index::
   single: SSL
   
SSL
^^^

SSL Security can be set on any url in your store.  In order for SSL to work,
make sure that it is enabled in the middleware section of your settings.py::

    MIDDLEWARE_CLASSES = (
        "django.middleware.common.CommonMiddleware",
        "django.contrib.sessions.middleware.SessionMiddleware",
        "django.middleware.locale.LocaleMiddleware",
        "django.contrib.auth.middleware.AuthenticationMiddleware",
        "django.middleware.doc.XViewMiddleware",
        "satchmo.shop.SSLMiddleware.SSLRedirect"
			    )

In order to support a fully encrypted page, you also need to make sure you provide a secure url for the media.  This url
will automatically be used in pages served by SSL, but only if you specify it in your settings.py::

    MEDIA_SECURE_URL = 'https://secure.example.com/static/'

Then, enable it for the specific urls you would like to be protected by adding
{'SSL': True} to each url.  Here's an example which would enable SSL for login::

	(r'^accounts/login/$', 'login', {'SSL': True, 'template_name': 'login.html'}, 'satchmo_login'),

SSL for Payments works slightly differently.  Since the urls for Payments are configured automatically, you can 
have SSL applied automatically as well.  To have all checkout pages enabled for SSL, just set 
``CHECKOUT_SSL=True`` in your local_settings file.

If you only want to enable SSL for some payment modules, enable SSL for payments as described above
and then check ``SSL=True`` in the payment module configuration setting for the module you want to have SSL enabled.
This may be useful if you accept both PayPal and Authorize.net payments, for example.  PayPal wouldn't need
to be SSL enabled, but Authorize.net should be.

Disabling the Live Settings System
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Once your store is live, you may want to disable the admin ability to edit the site configuration.  To do this, edit your settings.py file and add a new entry "LIVESETTINGS_OPTIONS" with the settings you want to lock into place.

The LIVESETTINGS_OPTIONS must be formatted as follows::


	LIVESETTINGS_OPTIONS = {
	        1 : {
	                'DB' : [True/False],
	                'SETTINGS' : {
	                    'GROUPKEY' : {'KEY', val, 'KEY2', val},
	                    'GROUPKEY2' : {'KEY', val, 'KEY2', val},
	                }
	            }
	        }

In the settings dict above, the "1" is a site index, allowing you to have different settings for different sites.  
The "val" entries must exactly match the format stored in the database for a setting.  For example, do not use a 
literal True or an integer, it needs to be the string representation of them.

If ``DB`` is False, then editting the settings via the admin will be disabled. All configuration must then be done
through the settings file.

The easiest way to do this is to query the database for livesettings_setting and livesettings_longsetting, and convert to a Python dictionary manually.

.. _Authorize.net: http://www.authorize.net/
.. _Mailman: http://www.gnu.org/software/mailman/