<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GoSatchmo&#187; satchmo</title>
	<atom:link href="http://gosatchmo.com/tag/satchmo/feed/" rel="self" type="application/rss+xml" />
	<link>http://gosatchmo.com</link>
	<description>Helping you to make the sale</description>
	<lastBuildDate>Wed, 28 Jul 2010 15:59:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Starting a new store &#8211; real world project layout</title>
		<link>http://gosatchmo.com/2010/starting-a-new-store-real-world-project-layout/</link>
		<comments>http://gosatchmo.com/2010/starting-a-new-store-real-world-project-layout/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 13:24:46 +0000</pubDate>
		<dc:creator>Bruce Kroeze</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[directories]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[satchmo]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://gosatchmo.kroozio.com/?p=71</guid>
		<description><![CDATA[Updated 10 July 2010 The official Installation Instructions are accurate, and will definitely work to get a store running. However, I think that many developers would like some advice about how to best lay out the directories for ease of maintenance. Go read those docs, but then come back here for a suggested layout. Read [...]]]></description>
			<content:encoded><![CDATA[<p><i>Updated 10 July 2010</i></p>
<p>The official <a href="http://satchmoproject.com/docs/dev/new_installation.html">Installation Instructions</a> are accurate, and will definitely work to get a store running. However, I think that many developers would like some advice about how to best lay out the directories for ease of maintenance.</p>
<p><span id="more-71"></span></p>
<p>Go read those docs, but then come back here for a suggested layout.</p>
<h2>Read it? Good, let&#8217;s get to my layout.</h2>
<p>First, you need to make a basic project structure. I make one like so:</p>
<pre><code>
storename/
  __init__.py
  settings_local.py
  manage.py
  settings.py
bin/
  (here are various scripts you may use for testing or whatever)
etc/
   init.d/
       storename
       sysconfig/
           storename
fixtures/
localsite/
    __init__.py
    models.py
    templatetags/
        __init__.py
media/
    css/
    images/
    js/
templates/
    storename/
</code></pre>
<p>I don&#8217;t use any &#8220;manage.py&#8221; commands to make this outline. I just make the directories, copy the default satchmo settings.py and local_settings.py (renaming to settings_local.py, so that they sort nicely) to the base directory, and then use &#8220;touch&#8221; to make empty files for all the other files.</p>
<h2>Configuring your urls</h2>
<p>In your settings file, make your base urls file be the one in your localsite app. Like so:</p>
<p>ROOT_URLCONF = &#8216;storename.localsite.urls&#8217;</p>
<p>Then, in your storename/localsite/urls.py file, just import the base store urls like so:</p>
<pre>
<code>from django.conf.urls.defaults import *
from satchmo.urls import urlpatterns
</code>
</pre>
<p>For now, that&#8217;s all you have to do, but later you&#8217;ll be able to add your own special site urls without any hassle or reconfiguration.</p>
<h2>Configuring your templates</h2>
<p>It is <em>particularly important</em> not to simply copy all of Satchmo&#8217;s templates into your template directory. I think that is the single biggest mistake beginning Satchmo developers make. Why? Because if we later upgrade Satchmo or change the templatetags, you won&#8217;t get the benefit of those changes.</p>
<p>Instead, simply copy the templates you need to override into your template directory, leaving all the rest to be found by Django&#8217;s template resolution functionality.  See my article <a href="http://gosatchmo.com/2008/how-to-skin-a-satchmo-store-overriding-templates/" title="How to Skin a Satchmo Store &#8211; Overriding Templates">How to Skin a Satchmo Store &#8211; Overriding Templates</a> for more details.</p>
<h2>Install the localsite app</h2>
<p>Having a custom app for any store is a great thing to do.</p>
<ul>
<li>It will allow you to have custom urls with ease</li>
<li>You can add your own templatetags which are only useful for the particular store</li>
<li>It provides a convenient place to register custom listeners for Satchmo signals.</li>
</ul>
<p>Adding the &#8220;localsite&#8221; app is merely a matter of making the three files &#8220;__init__.py&#8221;, &#8220;models.py&#8221;, and &#8220;urls.py&#8221;, and then adding it to your INSTALLED_APPS in settings.py:</p>
<pre><code>
INSTALLED_APPS = (
    [...]
    storename.localsite #should usually be last
)</code>
</pre>
<h2>Now you are ready</h2>
<p>Now you are ready to continue with the official Satchmo install instructions, but your store will be much more flexible and ready to handle the real world.</p>
<h2>Other tutorials</h2>
<ul>
<li><a href="http://www.saltycrane.com/blog/2008/12/card-store-project-2-installing-satchmo-django-postgresql-and-apache-ubuntu-slicehost/">SaltyCrane&#8217;s Satchmo Installation Notes</a></li>
</ul>
<h2>Updates</h2>
<p>This article was written in 2008, but I am trying to keep this up to date, please comment below if you find something wrong or or which no longer makes sense.</p>
<p>10 July 2010: Updated, changing a few directory names, and updating links.</p>
]]></content:encoded>
			<wfw:commentRss>http://gosatchmo.com/2010/starting-a-new-store-real-world-project-layout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding an “Accept Terms” Requirement to Satchmo Checkout</title>
		<link>http://gosatchmo.com/2008/adding-an-accept-terms-requirement-to-satchmo-checkout/</link>
		<comments>http://gosatchmo.com/2008/adding-an-accept-terms-requirement-to-satchmo-checkout/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 12:42:38 +0000</pubDate>
		<dc:creator>Bruce Kroeze</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[checkout]]></category>
		<category><![CDATA[satchmo]]></category>

		<guid isPermaLink="false">http://gosatchmo.kroozio.com/?p=53</guid>
		<description><![CDATA[Many stores require that you formally accept their terms and conditions of sale before checking out. How do you pull this off in Satchmo? It is easy, dead easy, and requires just three lines of code and absolutely no hacking of the Satchmo core. It is all done through the magic of Django Signals. In [...]]]></description>
			<content:encoded><![CDATA[<p>Many stores require that you formally accept their terms and conditions of sale before checking out. How do you pull this off in Satchmo?</p>
<p>It is easy, dead easy, and requires just three lines of code and absolutely no hacking of the Satchmo core. It is all done through the magic of Django Signals.</p>
<p>In my <a href="http://gosatchmo.com/2008/satchmo-video-presentation/" title="Satchmo Video Presentation">Satchmo Video Presentation</a>, I claimed that signals and templatetags were the key to extending Satchmo without having to build everything into the base store code. This is an example of doing just that.</p>
<p><span id="more-53"></span></p>
<h2>The Signal</h2>
<p>Satchmo sends a &#8220;<code>satchmo.payment.signals.payment_form_init</code>&#8221; signal when it is initializing payment forms. This gives any interested party the ability to modify the form before it ever gets sent to the template.</p>
<p>This signal can be used for all sorts of interesting purposes. For example, perhaps you want to removed &#8220;required&#8221; from some of the fields which are required by default. Or perhaps you want to hide certain fields (see <code>payment.listeners.shipping_hide_if_one</code> for an example of this). This signal is the key to doing anything like that.</p>
<p><span style="font-size: 18px; font-weight: bold;">The Listener</span></p>
<p>It isn&#8217;t a standard Django term, &#8220;listener,&#8221; but in Satchmo we generally call packages of functions which work with signals &#8220;listeners.&#8221; It makes sense, there is a signal, and a function who is interested in listening for that signal and acting upon it.</p>
<p>In <code>satchmo.payment.listeners</code> there is a function called &#8220;<code>form_terms_listener</code>.&#8221; This handy little function will add a new required &#8220;terms&#8221; field to any form. Exactly what we need!</p>
<p>Take a look at the function. It does require that you have a &#8220;shop_terms&#8221; named url somewhere in your urlconf. That&#8217;s the only prerequisite for its use.</p>
<p><span style="font-size: 18px; font-weight: bold;">Wiring them up</span></p>
<p>In my <a href="http://gosatchmo.com/starting-a-new-store-real-world-project-layout">project layout</a> article, I advise that you set up a &#8220;site&#8221; application for your shop. This is the most convenient place to wire custom signals to listeners. In your storename/site/models.py file, add the following:</p>
<pre>
<code>from satchmo.payment.forms import SimplePayShipFormfrom satchmo.payment.listeners import form_terms_listenerfrom satchmo.payment.signals import payment_form_init

payment_form_init.connect(form_terms_listener, sender=SimplePayShipForm)
</code>
</pre>
<p><span style="font-size: 18px; font-weight: bold;">Adding the checkbox to the template</span></p>
<p>You&#8217;ll need to override the page where you are adding the checkbox. Refer to my <a href="http://gosatchmo.com/how-to-skin-a-satchmo-store-overriding-templates">how to skin a store</a> article if you are unclear how to do this.</p>
<p>In your overridden form template, add the checkbox markup. Something like this:</p>
<pre>
<code>{{ form.terms }} {{ form.terms.label }}{% if form.terms.error %}&lt;br/&gt;**{{ form.terms.error }}{% endif %}</code>
</pre>
<p>Done!</p>
<p>Updated 10 July 2010: corrected imports for latest Satchmo</p>
]]></content:encoded>
			<wfw:commentRss>http://gosatchmo.com/2008/adding-an-accept-terms-requirement-to-satchmo-checkout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Skin a Satchmo Store &#8211; Overriding Templates</title>
		<link>http://gosatchmo.com/2008/how-to-skin-a-satchmo-store-overriding-templates/</link>
		<comments>http://gosatchmo.com/2008/how-to-skin-a-satchmo-store-overriding-templates/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 12:57:40 +0000</pubDate>
		<dc:creator>Bruce Kroeze</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[satchmo]]></category>
		<category><![CDATA[skin]]></category>

		<guid isPermaLink="false">http://gosatchmo.kroozio.com/?p=61</guid>
		<description><![CDATA[So you&#8217;re setting up a Satchmo store, but you don&#8217;t like how the default store pages look. Possibly you just want to override the layout of the product detail page, how do you do that without having to edit the Satchmo files themselves? Basic Skinning If you refer to my project layout article, you&#8217;ll see [...]]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;re setting up a Satchmo store, but you don&#8217;t like how the default store pages look. Possibly you just want to override the layout of the product detail page, how do you do that without having to edit the Satchmo files themselves?</p>
<p><span id="more-61"></span></p>
<h2>Basic Skinning</h2>
<p>If you refer to my <a href="http://gosatchmo.com/starting-a-new-store-real-world-project-layout">project layout</a> article, you&#8217;ll see that I strongly suggest you set up a project directory with a &#8220;templates&#8221; directory in it. If you do that, then the key step is to make that directory the first priority when looking for a template file.</p>
<p><span style="font-family: -webkit-monospace; white-space: pre;">DIRNAME = os.path.dirname(__file__)</span></p>
<pre>
<code>SATCHMO_DIRNAME = '/opt/framework/satchmo'TEMPLATE_DIRS = (os.path.join(DIRNAME, "templates"),os.path.join(SATCHMO_DIRNAME, "templates"),)</code>
</pre>
<p><span style="font-size: 18px; font-weight: bold;">How it works</span></p>
<p>The way this works is that when Django goes looking for a template file, it looks in the template directories in the order you&#8217;ve given in that setting. Let&#8217;s say for example that you have two files: &#8220;product/product.html&#8221; and &#8220;base.html.&#8221;</p>
<p>If you have a project set up like this:</p>
<pre>
<code>storename/templates/  (empty) satchmo/templates/  base.html  product/product.html</code>
</pre>
<p>Django will look for product/product.html first at storename/templates/product. Since it isn&#8217;t there, it will look in satchmo/templates/product.html and find it. The product.html template extends base.html, so once again Django will look first in storename/templates, then successfully in satchmo/templates.</p>
<p><span style="font-size: 18px; font-weight: bold;">Overriding</span></p>
<p>Overriding the product template then becomes obvious. Just copy it to storename/templates/product and edit as you desire.</p>
<pre>
<code>storename/templates/product/ product.htmlsatchmo/templates/  base.html  base_product.html</code>
</pre>
<p>Once you&#8217;ve done this, Django will look in storename/templates/product and find product.html. It also needs base.html, and it will find it in satchmo/templates.</p>
<p>This works the same in every case. If you wanted to override the base account profile page, then you&#8217;d make a directory &#8220;contact&#8221; and copy or modify the default Satchmo file &#8220;contact/view_profile.html.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://gosatchmo.com/2008/how-to-skin-a-satchmo-store-overriding-templates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Satchmo at DjangoCon 2008</title>
		<link>http://gosatchmo.com/2008/satchmo-at-djangocon-2008/</link>
		<comments>http://gosatchmo.com/2008/satchmo-at-djangocon-2008/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 13:38:32 +0000</pubDate>
		<dc:creator>Bruce Kroeze</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[djangocon]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[satchmo]]></category>

		<guid isPermaLink="false">http://gosatchmo.kroozio.com/?p=77</guid>
		<description><![CDATA[DjangoCon 2008 wrapped up yesterday, and it was a great weekend for Django and for Django&#8217;s leading e-commerce system, Satchmo. Chris Moffitt and I made a technical presentation (view as a PDF) about Satchmo to a group of 50-70 developers on Saturday. It was videotaped for upload to YouTube, but doesn&#8217;t that the Google staff [...]]]></description>
			<content:encoded><![CDATA[<p>DjangoCon 2008 wrapped up yesterday, and it was a great weekend for Django and for Django&#8217;s leading e-commerce system, Satchmo.</p>
<p>Chris Moffitt and I made a technical presentation (<a href="http://www.satchmoproject.com/docs/satchmo-djangocon.pdf" title="view as a PDF">view as a PDF</a>) about Satchmo to a group of 50-70 developers on Saturday. It was videotaped for upload to YouTube, but doesn&#8217;t that the Google staff have uploaded it yet. I&#8217;ll be sure to make a post when that happens. (Update: <a href="http://gosatchmo.com/2008/satchmo-video-presentation/" title="Satchmo Video Presentation">Satchmo Video Presentation</a>)</p>
<p><span id="more-77"></span></p>
<h2>First Core Meeting</h2>
<p>For the first time ever, the Satchmo core development team actually met face-to-face. The panels and discussions at DjangoCon made it completely worth my time and money to attend the convention, but even had they not been so useful, the trip would have been worth it just for the chance to meet and hang out with my fellow core developers.</p>
<p>We decided on our &#8220;Road to 0.8 release&#8221; strategy. We&#8217;re going to clean up the code &amp; docs, closing as many tickets as possible in the next two or three weeks. In the meantime, Jag is going to be testing his shiny new Order Admin screens. When he&#8217;s ready, we&#8217;ll release!</p>
<p>The 0.8 release will be pinned to Django 1.0, making it much easier for us to tell people what version of Django to use. It is getting quite old to have to repeatedly specify &#8220;rev such-and-such&#8221; to new users on the Satchmo-Users list.</p>
<h2>Initial 1.0 Discussion</h2>
<p>Following 0.8, we&#8217;re going to work on a six-month release cycle, trying to fairly closely follow the Django Project&#8217;s newly announced intention to start doing timed releases.</p>
<p>We came up with quite a list of new or modified functionality we&#8217;d like to see in 1.0, but the primary driving force is going to be a very thorough and exciting <a href="http://en.wikipedia.org/wiki/Refactoring" title="Refactoring is great, learn about it here">refactor</a> of the Product Model. Our intention is to make it much easier to allow store owners and developers to create products which exactly fit the specific needs of their store.</p>
]]></content:encoded>
			<wfw:commentRss>http://gosatchmo.com/2008/satchmo-at-djangocon-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

