
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Management Commands &mdash; django-gwo v0.2 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="django-gwo v0.2 documentation" href="index.html" />
    <link rel="next" title="Reference" href="reference/index.html" />
    <link rel="prev" title="Using the weboptimizer gdata Extension" href="using_gwoweboptimizer.html" /> 
  </head>
  <body>
<div id="docstitle">
	<p>django-gwo v0.2 documentation</p>
</div>
<div id="header">
	<div id="title"><h1>Management Commands</h1></div>
	<ul id="headerButtons">
		<li id="toc_button"><div class="headerButton"><a href="#">Table of Contents</a></div></li>
		<li id="page_buttons">
			<div class="headerButton"><a href="genindex.html" title="General Index" accesskey="I">index</a></div>
			<div class="headerButton"><a href="py-modindex.html" title="Python Module Index" >modules</a></div>
			<div class="headerButton"><a href="reference/index.html" title="Reference" accesskey="N">next</a></div>
			<div class="headerButton"><a href="using_gwoweboptimizer.html" title="Using the weboptimizer gdata Extension" accesskey="P">previous</a></div>
		</li>
	</ul>
</div>

<div id="sphinxsidebar">
  <div class="sphinxsidebarwrapper">
	<ul><li class="toctree-l1"><a href="index.html">Main Page</a></li></ul>
	<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="overview.html">Multivariate testing of dynamic pages</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="using_gwoweboptimizer.html">Using the weboptimizer gdata Extension</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Management Commands</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#pull-from-gwo">pull_from_gwo</a></li>
<li class="toctree-l2"><a class="reference internal" href="#generate-variation">generate_variation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
</ul>

    <div id="searchbox" style="display: none">
      
        <form class="search" action="search.html" method="get">
			<div class="search-wrapper">
			<span class="search-left"></span>
			<input class="prettysearch" type="text" name="q" size="18" />
			<span class="search-right">&nbsp;</span>
			</div>
          <input type="submit" value="Search" class="searchbutton" />
          <input type="hidden" name="check_keywords" value="yes" />
          <input type="hidden" name="area" value="default" />
        </form>
        <p class="searchtip" style="font-size: 90%">
        Enter search terms or a module, class or function name.
        </p>
    </div>
    <script type="text/javascript">$('#searchbox').show(0);</script>
  </div>
</div>



    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="management-commands">
<h1>Management Commands<a class="headerlink" href="#management-commands" title="Permalink to this headline">¶</a></h1>
<div class="section" id="pull-from-gwo">
<h2>pull_from_gwo<a class="headerlink" href="#pull-from-gwo" title="Permalink to this headline">¶</a></h2>
<p>Updates the data with the data from Google Website Optimizer. Local versions are deleted and recreated.</p>
<div class="highlight-python"><pre>$ ./manage.py pull_from_gwo
Purging local experiments
Pulling experiments from Google Website Optimizer
 Building experiment Example Experiment
  Pulling sections
  Building section Top Nav
   Pulling variations
   Building variation Original
   Building variation Not Showing
  Building section Bottom Nav
   Pulling variations
   Building variation Original
   Building variation Showing
Done.</pre>
</div>
</div>
<div class="section" id="generate-variation">
<h2>generate_variation<a class="headerlink" href="#generate-variation" title="Permalink to this headline">¶</a></h2>
<p>Prints to the console a template with sections replaced with the variation specified in the combination. This makes it easier to recreate the template(s) after the experiment is finished.</p>
<p>This management command needs the template name and the combination number:</p>
<div class="highlight-python"><pre>$ ./manage.py generate_variation blog/post_detail.html 5</pre>
</div>
<p>and you can put the output to a file by:</p>
<div class="highlight-python"><pre>$ ./manage.py generate_variation blog/post_detail.html 5 &gt; post_detail.html</pre>
</div>
<p><tt class="docutils literal"><span class="pre">generate_variation</span></tt> then requests the combination from Google Website Optimizer. The combination specifies which variation to use with each section. For example, if you had a section in your template specified as:</p>
<div class="highlight-django"><div class="highlight"><pre><span class="cp">{%</span> <span class="k">set_experiment</span> <span class="s2">&quot;Example Experiment&quot;</span> <span class="cp">%}</span><span class="x"></span>
<span class="cp">{{</span> <span class="nv">gwo_experiment.control_script</span><span class="o">|</span><span class="nf">safe</span> <span class="cp">}}</span><span class="x"></span>
<span class="x">  &lt;h2&gt;</span><span class="cp">{{</span> <span class="nv">object.title</span> <span class="cp">}}</span><span class="x">&lt;/h2&gt;</span>
<span class="x">  </span><span class="cp">{%</span> <span class="k">gwo_start_section</span> <span class="s2">&quot;Top Nav&quot;</span> <span class="cp">%}</span><span class="x">&lt;p class=&quot;other_posts&quot;&gt;</span><span class="cp">{%</span> <span class="k">gwo_end_section</span> <span class="s2">&quot;Top Nav&quot;</span> <span class="cp">%}</span><span class="x"></span>
</pre></div>
</div>
<p>depending on the combination specified, the results could look like:</p>
<div class="highlight-django"><div class="highlight"><pre><span class="x">&lt;h2&gt;</span><span class="cp">{{</span> <span class="nv">object.title</span> <span class="cp">}}</span><span class="x">&lt;/h2&gt;</span>
<span class="x">&lt;p class=&quot;other_posts&quot; style=&quot;display: None&quot;&gt;</span>
</pre></div>
</div>
<p>The <tt class="docutils literal"><span class="pre">{%</span> <span class="pre">set_experiment</span> <span class="pre">%}</span></tt> tag and <tt class="docutils literal"><span class="pre">{{</span> <span class="pre">gwo_experiment</span> <span class="pre">}}</span></tt> variables are gone, the <tt class="docutils literal"><span class="pre">{%</span> <span class="pre">gwo_start_section</span> <span class="pre">%}</span></tt> and <tt class="docutils literal"><span class="pre">{%</span> <span class="pre">gwo_stop_section</span> <span class="pre">%}</span></tt> tags are gone, and the contents between them is the value of the variation.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p><strong>Included templates are not touched.</strong></p>
<p class="last">If your experiment included markup on templates that were included with the <tt class="docutils literal"><span class="pre">{%</span> <span class="pre">include</span> <span class="pre">%}</span></tt> tag, this command does not look at them.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p><strong>track_click tags are not removed.</strong></p>
<p class="last">The track_click scripts will work fine without an experiment running. It also saves on adding them back in if a follow-up experiment is run.</p>
</div>
</div>
</div>


          </div> 
        </div>
      </div>
    <div class="footer">
    <p>
      &copy; Copyright 2010, The Washington Times.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.6.
	</p>
    </div>
      <div class="clearer"></div>
    </div>
	<div id="breadcrumbs">
		Management Commands
		</ul>
	</div>
	<script type="text/javascript" charset="utf-8" src="_static/toc.js"></script>
  </body>
</html>