Differences between revisions 16 and 18 (spanning 2 versions)
Revision 16 as of 2012-09-05 08:05:20
Size: 3009
Editor: mindlace
Comment: Changed instructions to not require root access
Revision 18 as of 2012-09-05 08:46:33
Size: 3611
Editor: mindlace
Comment: formatting cleanup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DEV/versions/15171649 #pragma page-filename DEV/versions/15171653
Line 6: Line 6:
== Set up your environment with virtualenv == == Set up your environment ==
Line 8: Line 8:
If you're not already set up to develop with virtualenv, you should do so: Install the essentials
Line 10: Line 10:
{{{{#!table
'''Ubuntu'''
|| '''OS X'''
==
Line 16: Line 12:
|| {{{ {{{
Line 18: Line 14:
Line 21: Line 16:
$ pip install distribute }}}
}}}}
$ pip install distribute}}}
Line 24: Line 18:
You're almost there - just get virtualenv: Install virtualenv and virtualenvwrapper:
Line 26: Line 20:
{{{$ pip install virtualenv}}} {{{
$ pip install virtualenv
$ pip install virtualenvwrapper
$ echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bash_profile
$ echo "source `which virtualenvwrapper.sh`" >> ~/.bash_profile
$ export WORKON_HOME=$HOME/.virtualenvs
$ source virtualenvwrapper.sh }}}
Line 28: Line 28:
{{{#!wiki important Create the postorious virtual environment:
Line 30: Line 30:
You may wish to install [[http://virtualenvwrapper.readthedocs.org/en/latest/index.html|Virtualenvwrapper]] as well for managing your environment with ease.
}}}

For the remaining bit, we're going to assume your virtual environment is called "postorius". You would initialize and activate it as follows:

{{{{#!table
'''virtualenv only'''
|| '''with virtualenvwrapper'''
==
{{{$ virtualenv postorius}}}
{{{$ source postorius/bin/activate}}}

|| {{{$ mkvirtualenv postorius}}}
}}}}
{{{
$ mkvirtualenv postorius
New python executable in postorius/bin/python
Installing setuptools............done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/predeactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/postdeactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/preactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/postactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/get_env_details
(postorius) $}}}
Line 46: Line 43:

For setup on Windows, and more advanced setup, see the [[http://virtualenvwrapper.readthedocs.org/en/latest/install.html|Virtualenvwrapper documentation]].
Line 55: Line 55:
If you get permission errors on this step, your ssh key is probably not in sync with what is on launchpad.net.
Line 61: Line 63:
== Get everything set up ==
== Set up sources ==
Line 64: Line 67:

Install and test:
Line 90: Line 91:
== Postorius == === Postorius ===
Line 95: Line 96:
Line 106: Line 106:
== Profit! ==

This is a quick guide to setup a development environment to work on Postorius, Mailman 3's web ui. If all goes as planned, you should be done within ~5 minutes. This has been tested on Ubuntu 11.04 and OS X 10.8.1.

In order to download the components necessary you need to have the Bazaar VCS installed on your system. Mailman and mailman.client need at least Python version 2.6.

Set up your environment

Install the essentials

$ sudo apt-get install python-setuptools python-dev build-essential

$ brew install python
$ echo "export PATH=/usr/local/share/python:$PATH" >> ~/.bash_profile
$ source ~/.bash_profile
$ pip install distribute

Install virtualenv and virtualenvwrapper:

$ pip install virtualenv
$ pip install virtualenvwrapper
$ echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bash_profile
$ echo "source `which virtualenvwrapper.sh`" >> ~/.bash_profile
$ export WORKON_HOME=$HOME/.virtualenvs
$ source virtualenvwrapper.sh 

Create the postorious virtual environment:

$ mkvirtualenv postorius
New python executable in postorius/bin/python
Installing setuptools............done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/predeactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/postdeactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/preactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/postactivate
virtualenvwrapper.user_scripts creating {your_home_directory}/.virtualenvs/postorius/bin/get_env_details
(postorius) $

Now you should see (postorius) before your prompt.

For setup on Windows, and more advanced setup, see the Virtualenvwrapper documentation.

Get the sources

(postorius)$ bzr branch lp:mailman
(postorius)$ bzr branch lp:mailman.client
(postorius)$ bzr branch lp:postorius
(postorius)$ bzr branch lp:~mailman-coders/postorius/postorius_standalone

If you get permission errors on this step, your ssh key is probably not in sync with what is on launchpad.net.

Install Django

(postorius)$ pip install django
(postorius)$ pip install django-social-auth

Set up sources

GNU Mailman 3

(postorius)$ cd mailman 
(postorius)$ python bootstrap.py
(postorius)$ bin/buildout
(postorius)$ bin/test

If you get no errors you can now start Mailman:

(postorius)$ bin/mailman start
(postorius)$ cd ..

At this point Mailman will not send nor receive any real emails. But that's fine as long as you only want to work on the components related to the ReST client or the web ui.

mailman.client (the Python bindings for Mailman's ReST API)

(postorius)$ cd mailman.client
(postorius)$ python setup.py develop
(postorius)$ cd ..

Postorius

(postorius)$ cd postorius
(postorius)$ python setup.py develop
(postorius)$ cd ..

Start the development server

(postorius)$ cd postorius_standalone
(postorius)$ python manage.py syncdb
(postorius)$ python manage.py runserver

Profit!

Now go to http://localhost:8000 to see the web UI for mailman!



Comments

Máirín Duffy

It looks like bootstrap.py was removed in late July, marked as obsolete. I followed these instructions to get mailman and postorious running, except I replaced the bootstrap.py step with the following:

virtualenv --system-site-packages /path/to/your/installation
$ source /path/to/your/installation/bin/activate
$ python setup.py install

Now, if you get weird errors, remove the --system-site-packages from your virtualenv and try again. I guess depending on how your system is setup, it may or may not work with that option.

Máirín Duffy

I wrote up a guide on how to get hyperkitty up and running for development, and it includes the full modified steps I ran based on this document to get mailman 3 working. That guide is here:

https://fedorahosted.org/hyperkitty/wiki/DevelopmentSetupGuide

maxking

MailmanWiki: DEV/A 5 minute guide to get the Mailman web UI running (last edited 2018-04-20 06:16:05 by maxking)