localwiki/sapling — Issue #4: Improving installation
Author: philipn
Created: 2011-11-24 09:48:34+00:00
State: open
Labels: task

First off, we should collaborate w/ the [http://openblock.org OpenBlock] guys on all this. They are trying to do the same thing.

We can create a {{{setup.py}}} file which installs a global {{{sapling}}} module. Look at how [http://trac.edgewall.org/wiki/TracInstall trac does this].

In particular:

This will byte-compile the python source code and install it as an .egg file or folder in the site-packages directory of your Python installation. The .egg will also contain all other resources needed by standard Trac, such as htdocs and templates.

The script will also install the trac-admin command-line tool, used to create and maintain project environments, as well as the tracd standalone server.

So we could install a global {{{sapling-manage}}} command that's just a {{{manage.py}}} wrapper.

Ideally someone can just do:

1. Install system requirements.
2. pip install -e
3. sapling-manage create_config

{{{create_config}}} would prompt for necessary things (db info, etc) a'la trac's admin creation command. Then it would generate a new localsettings.py file and tell the user where it's located. Or we could skip this step and just have people edit the config.

4. sapling-manage deploy. This creates a .wsgi file (if they want WSGI) in a specificed location and runs collectstatic.
5. Tell them to add necessary apache config.

Look at how trac does it. How other projects do it.

Then the next step is making a .deb that does all the platform-specific stuff and even sets up apache.