diff options
Diffstat (limited to 'docs/_build/html/install.html')
-rw-r--r-- | docs/_build/html/install.html | 389 |
1 files changed, 389 insertions, 0 deletions
diff --git a/docs/_build/html/install.html b/docs/_build/html/install.html new file mode 100644 index 0000000..6f74a04 --- /dev/null +++ b/docs/_build/html/install.html @@ -0,0 +1,389 @@ + + +<!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>Installation — Chimère 2.0 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: '2.0', + 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="Chimère 2.0 documentation" href="index.html" /> + <link rel="next" title="Upgrade" href="upgrade.html" /> + <link rel="prev" title="Welcome to Chimère’s documentation!" href="index.html" /> + </head> + <body> + <div class="related"> + <h3>Navigation</h3> + <ul> + <li class="right" style="margin-right: 10px"> + <a href="genindex.html" title="General Index" + accesskey="I">index</a></li> + <li class="right" > + <a href="upgrade.html" title="Upgrade" + accesskey="N">next</a> |</li> + <li class="right" > + <a href="index.html" title="Welcome to Chimère’s documentation!" + accesskey="P">previous</a> |</li> + <li><a href="index.html">Chimère 2.0 documentation</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body"> + + <div class="section" id="installation"> +<h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Author:</th><td class="field-body">Étienne Loks</td> +</tr> +<tr class="field-even field"><th class="field-name">date:</th><td class="field-body">2012-10-08</td> +</tr> +<tr class="field-odd field"><th class="field-name">Copyright:</th><td class="field-body">CC-BY 3.0</td> +</tr> +</tbody> +</table> +<p>This documents presents the installation of Chimère. +The version has been updated for version 2.0.0.</p> +<div class="section" id="prerequisites"> +<h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h2> +<blockquote> +<div><ul class="simple"> +<li><a class="reference external" href="http://www.apache.org/">apache</a> version 2.x</li> +<li><a class="reference external" href="http://www.python.org/">python</a> versions 2.6 or 2.7</li> +<li><a class="reference external" href="http://www.djangoproject.com/">django</a> >= version 1.4</li> +<li><a class="reference external" href="http://south.aeracode.org/">south</a></li> +<li><a class="reference external" href="http://www.postgresql.org/">postgres</a> >= version 8.x</li> +<li><a class="reference external" href="http://www.gnu.org/software/gettext/">gettext</a></li> +<li><a class="reference external" href="http://freshmeat.net/projects/psycopg/">psycopg2</a></li> +<li><a class="reference external" href="http://www.pythonware.com/products/pil/">Python Imaging Library</a></li> +<li><a class="reference external" href="http://tilloy.net/dev/pyexiv2/">pyexiv2</a></li> +<li><a class="reference external" href="http://www.crummy.com/software/BeautifulSoup/">Beautiful Soup</a></li> +<li>python-simplejson</li> +<li>python-gdal</li> +<li><a href="#id1"><span class="problematic" id="id2">`</span></a>unidecode <<a class="reference external" href="http://pypi.python.org/pypi/Unidecode">http://pypi.python.org/pypi/Unidecode</a>>_</li> +<li><a class="reference external" href="http://lxml.de/">lxml</a></li> +<li><a class="reference external" href="http://jquery.com/">jquery</a> version 1.7.1 or better</li> +<li><a class="reference external" href="http://jqueryui.com/">jquery-ui</a></li> +<li><a class="reference external" href="https://code.google.com/p/feedparser/">Universal Feed Parser</a></li> +</ul> +</div></blockquote> +<p>geodjango is a part of django since version 1.0 but it has some specific +(geographically related) additional dependencies:</p> +<blockquote> +<div><ul class="simple"> +<li><a class="reference external" href="http://trac.osgeo.org/geos/">geos</a> 3.0.x</li> +<li><a class="reference external" href="http://trac.osgeo.org/proj/">proj.4</a> 4.4 to 4.6</li> +<li><a class="reference external" href="http://postgis.refractions.net/">posgis</a> versions 1.2.1 or 1.3.x</li> +<li><a class="reference external" href="http://www.gdal.org/">gdal</a></li> +</ul> +</div></blockquote> +<p>Optionaly (but recommanded):</p> +<blockquote> +<div><ul class="simple"> +<li><a class="reference external" href="http://tinymce.moxiecode.com/">tinymce</a></li> +<li><a class="reference external" href="http://www.gpsbabel.org/">gpsbabel</a></li> +<li>django-celery if you want to manage large imports</li> +</ul> +</div></blockquote> +<p>The simpliest way to obtain these packages is to get them from your favorite +Linux distribution repositories. For instance on Debian Wheezy:</p> +<div class="highlight-python"><pre>apt-get install python python-django python-django-south \ + python-beautifulsoup tinymce apache2 libgeos-3.3.3 proj-bin gdal-bin \ + python-gdal python-lxml python-psycopg2 python-imaging gettext \ + postgresql-9.1 postgresql-9.1-postgis libjs-jquery libjs-jquery-ui \ + python-django-celery python-simplejson gpsbabel \ + python-pyexiv2 python-feedparser javascript-common</pre> +</div> +<p>On Debian Squeeze (you need to activate backports):</p> +<div class="highlight-python"><pre>apt-get install -t squeeze-backports python-django + +apt-get install python python-django-south python-beautifulsoup tinymce \ + apache2 libgeos-3.2.0 proj-bin gdal-bin python-gdal python-lxml \ + python-psycopg2 python-imaging gettext postgresql-8.4 \ + postgresql-8.4-postgis libjs-jquery libjs-jquery-ui python-simplejson \ + gpsbabel python-pyexiv2 python-feedparser javascript-common</pre> +</div> +<p>If these packages do not exist in your distribution’s repository, please refer +to the applications’ websites.</p> +</div> +<div class="section" id="database-configuration"> +<h2>Database configuration<a class="headerlink" href="#database-configuration" title="Permalink to this headline">¶</a></h2> +<p>Now that postgres and postgis are installed, you need to create a new user for +chimere:</p> +<div class="highlight-python"><pre>su postgres +createuser --echo --adduser --createdb --encrypted --pwprompt chimere-user</pre> +</div> +<p>Then, you have to create the database and initialize the geographic types (adapt +the paths accordingly to your needs):</p> +<div class="highlight-python"><pre>PG_VERSION=9.1 # 8.4 for debian Squeeze +createdb --echo --owner chimere-user --encoding UNICODE chimere "My Chimère database" +createlang plpgsql chimere # only necessary on Debian Squeeze +psql -d chimere -f /usr/share/postgresql/$PG_VERSION/contrib/postgis-1.5/postgis.sql +psql -d chimere -f /usr/share/postgresql/$PG_VERSION/contrib/postgis-1.5/spatial_ref_sys.sql</pre> +</div> +</div> +<div class="section" id="install-the-sources"> +<h2>Install the sources<a class="headerlink" href="#install-the-sources" title="Permalink to this headline">¶</a></h2> +<p>Choose a path to install your Chimère:</p> +<div class="highlight-python"><pre>INSTALL_PATH=/var/local/django +mkdir $INSTALL_PATH</pre> +</div> +<div class="section" id="from-an-archive"> +<h3>From an archive<a class="headerlink" href="#from-an-archive" title="Permalink to this headline">¶</a></h3> +<p>The last “stable” version is available in this <a class="reference external" href="http://www.peacefrogs.net/download/chimere/">directory</a>. +Take care of getting the last version in the desired X.Y branch (for instance +the last version for the 1.0 branch is version 1.0.2. +Extract it to the desired destination path:</p> +<div class="highlight-python"><pre>wget http://www.peacefrogs.net/download/chimere -q -O -| html2text +(...) +[[ ]] chimere-1.0.0.tar.bz2 17-Nov-2010 16:51 53K +[[ ]] chimere-1.0.1.tar.bz2 17-Nov-2010 16:51 53K +[[ ]] chimere-1.0.2.tar.bz2 17-Nov-2010 16:51 53K +(...) + +wget http://www.peacefrogs.net/download/chimere/chimere-1.0.2.tar.bz2</pre> +</div> +<p>Download, unpack and move the files in an apache user (www-data for Debian) +readable directory:</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH +tar xvjf chimere-last.tar.bz2 +chown -R myusername:www-data chimere</pre> +</div> +</div> +<div class="section" id="from-the-git-repository"> +<h3>From the git repository<a class="headerlink" href="#from-the-git-repository" title="Permalink to this headline">¶</a></h3> +<p>Another solution is to get the last git version:</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH +git clone git://www.peacefrogs.net/git/chimere +cd chimere +git tag -l # list tagged versions +git checkout v2.0 # checkout the desired version</pre> +</div> +</div> +</div> +<div class="section" id="create-a-custom-project-template"> +<h2>Create a custom project template<a class="headerlink" href="#create-a-custom-project-template" title="Permalink to this headline">¶</a></h2> +<p>There a default project provided “example_project”. Copy and modify it (or +get another project based on Chimere):</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH/chimere +cp -ra example_project mychimere_project</pre> +</div> +<p>Your project name is used for the name of the Python package of your template. +As a Python package it should follow the rule of Python variable name: +it must be at least one letter and can have a string of numbers, letters and +“_” to any length. Don’t begin the name by “_” because it has special +significance in Python.</p> +<p>In your chimere application directory create local_settings.py to fit to your +configuration. +A base template is provided (local_settings.py.example) and short descriptions of +the more relevant fields are given below (at least check them). Most of theses +settings are initialized in settings.py.</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH/chimere/mychimere_project +cp local_settings.py.sample local_settings.py +vim local_settings.py</pre> +</div> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Fields:</th><td class="field-body"><ul class="first last simple"> +<li>DATABASES: parameters for the database</li> +<li>PROJECT_NAME: name of the project</li> +<li>SECRET_KEY: a secret key for a particular Django installation. This is +used to provide cryptographic signing, and should be set to a unique, +unpredictable value. Change it!</li> +<li>ROOT_URLCONF: url configuration for your project something like: +‘mychimere_project.urls’</li> +<li>EMAIL_HOST: smtp of an email server to send emails</li> +<li>TINYMCE_URL: url to tinymce path (default is appropriate for a Debian +installation with tinymce activated)</li> +<li>JQUERY_JS_URLS: list of Jquery and Jquery-ui urls (default is appropriate +for a Debian installation with Jquery and Jquery-ui activated)</li> +<li>JQUERY_CSS_URLS: list of Jquery and Jquery-ui urls (default is appropriate +for a Debian installation with Jquery and Jquery-ui activated)</li> +<li>GPSBABEL: path to gpsbabel (default is appropriate for a Debian +installation with gpsbabel installed)</li> +<li>TIME_ZONE: local time zone for this installation</li> +<li>LANGUAGE_CODE: language code for this installation</li> +</ul> +</td> +</tr> +</tbody> +</table> +<p>Manage media path permission:</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH/chimere/mychimere_project +chown -R user:www-data media +chmod -R g+w media</pre> +</div> +<p>Create log file:</p> +<div class="highlight-python"><pre>mkdir /var/log/django +touch /var/log/django/chimere.log +chown -R root:www-data /var/log/django/ +chmod -R g+w /var/log/django/</pre> +</div> +<p>Regroup static files in one path:</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH/chimere/mychimere_project +./manage.py collectstatic</pre> +</div> +</div> +<div class="section" id="compiling-languages"> +<h2>Compiling languages<a class="headerlink" href="#compiling-languages" title="Permalink to this headline">¶</a></h2> +<p>If your language is available in the locale directory of chimere, you will just +need to get it compiled. This can be done with (here, <strong>fr</strong> stands for french). +Replace it with the appropriate language code):</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH/chimere/chimere/ +django-admin compilemessages</pre> +</div> +<p>If your language is not available, feel free to create the default po files and +to submit it, contributions are well appreciated. Procedure is as follows:</p> +<p>You first need to create the default po file (of course, replace <strong>fr</strong> +according to the language you choose to create):</p> +<div class="highlight-python"><pre>django-admin makemessages -l fr</pre> +</div> +<p>There should now be a <em>django.po</em> file in <em>locale/fr/LC_MESSAGES</em>. Complete it +with your translation.</p> +<p>Now that the translation file is completed, just compile it the same way you +would have if the language file was already available.</p> +</div> +<div class="section" id="database-initialisation"> +<h2>Database initialisation<a class="headerlink" href="#database-initialisation" title="Permalink to this headline">¶</a></h2> +<p>Create the appropriate tables (still being in chimère application directory):</p> +<div class="highlight-python"><pre>cd $INSTALL_PATH/chimere/mychimere_project +./manage.py syncdb</pre> +</div> +<p>You will be prompted for the creation of an administrator account +(administration can be found at: <a class="reference external" href="http://where_is_chimere/admin">http://where_is_chimere/admin</a>). Then you have +to create tables managed with south:</p> +<div class="highlight-python"><pre>./manage.py migrate</pre> +</div> +<p>The database is set, congratulations!</p> +<p>If you want to populate your installation with default data (don’t do this on +an already populated instance!):</p> +<div class="highlight-python"><pre>./manage.py loaddata ../chimere/fixtures/default_data.json</pre> +</div> +</div> +<div class="section" id="webserver-configuration"> +<h2>Webserver configuration<a class="headerlink" href="#webserver-configuration" title="Permalink to this headline">¶</a></h2> +<div class="section" id="apache-configuration-with-mod-wsgi"> +<h3>Apache configuration with mod_wsgi<a class="headerlink" href="#apache-configuration-with-mod-wsgi" title="Permalink to this headline">¶</a></h3> +<p>Install mod_wsgi for apache:</p> +<div class="highlight-python"><pre>apt-get install libapache2-mod-wsgi</pre> +</div> +<p>TODO: adapt apache-wsgi.conf +Create and edit a configuration for Chimère:</p> +<div class="highlight-python"><pre>cp $INSTALL_PATH/chimere/apache/django.wsgi \ + $INSTALL_PATH/chimere/apache/mydjango.wsgi +vim $INSTALL_PATH/chimere/apache/mydjango.wsgi +cp $INSTALL_PATH/chimere/apache/apache-wsgi.conf /etc/apache2/sites-available/chimere +vim /etc/apache2/sites-available/chimere +# create log dir +mkdir /var/log/apache2/chimere/</pre> +</div> +<p>Adapt the files <em>mydjango.wsgi</em> (with the correct sys path) and Apache <em>chimere</em>.</p> +<p>To activate the website reload apache:</p> +<div class="highlight-python"><pre>a2ensite chimere +/etc/init.d/apache2 reload</pre> +</div> +</div> +</div> +</div> + + + </div> + </div> + </div> + <div class="sphinxsidebar"> + <div class="sphinxsidebarwrapper"> + <h3><a href="index.html">Table Of Contents</a></h3> + <ul> +<li><a class="reference internal" href="#">Installation</a><ul> +<li><a class="reference internal" href="#prerequisites">Prerequisites</a></li> +<li><a class="reference internal" href="#database-configuration">Database configuration</a></li> +<li><a class="reference internal" href="#install-the-sources">Install the sources</a><ul> +<li><a class="reference internal" href="#from-an-archive">From an archive</a></li> +<li><a class="reference internal" href="#from-the-git-repository">From the git repository</a></li> +</ul> +</li> +<li><a class="reference internal" href="#create-a-custom-project-template">Create a custom project template</a></li> +<li><a class="reference internal" href="#compiling-languages">Compiling languages</a></li> +<li><a class="reference internal" href="#database-initialisation">Database initialisation</a></li> +<li><a class="reference internal" href="#webserver-configuration">Webserver configuration</a><ul> +<li><a class="reference internal" href="#apache-configuration-with-mod-wsgi">Apache configuration with mod_wsgi</a></li> +</ul> +</li> +</ul> +</li> +</ul> + + <h4>Previous topic</h4> + <p class="topless"><a href="index.html" + title="previous chapter">Welcome to Chimère’s documentation!</a></p> + <h4>Next topic</h4> + <p class="topless"><a href="upgrade.html" + title="next chapter">Upgrade</a></p> + <h3>This Page</h3> + <ul class="this-page-menu"> + <li><a href="_sources/install.txt" + rel="nofollow">Show Source</a></li> + </ul> +<div id="searchbox" style="display: none"> + <h3>Quick search</h3> + <form class="search" action="search.html" method="get"> + <input type="text" name="q" /> + <input type="submit" value="Go" /> + <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="clearer"></div> + </div> + <div class="related"> + <h3>Navigation</h3> + <ul> + <li class="right" style="margin-right: 10px"> + <a href="genindex.html" title="General Index" + >index</a></li> + <li class="right" > + <a href="upgrade.html" title="Upgrade" + >next</a> |</li> + <li class="right" > + <a href="index.html" title="Welcome to Chimère’s documentation!" + >previous</a> |</li> + <li><a href="index.html">Chimère 2.0 documentation</a> »</li> + </ul> + </div> + <div class="footer"> + © Copyright 2012, Étienne Loks. + Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. + </div> + </body> +</html>
\ No newline at end of file |