Differences between revisions 1 and 20 (spanning 19 versions)
Revision 1 as of 2011-11-14 08:26:59
Size: 3217
Editor: f@state-of-mind
Comment:
Revision 20 as of 2012-09-05 08:59:35
Size: 3761
Editor: mindlace
Comment: Added os x note
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DEV/versions/13303879
This is a quick guide to setup a development environment to work on Mailman 3's web ui. If all goes as planned, you should be done within ~5 minutes. It has been tested on Ubuntu 11.04.
#pragma page-filename DEV/versions/15564855
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.
Line 4: Line 4:
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 ==
Line 6: Line 6:
== GNU Mailman 3 ==
First download the latest revision of Mailman 3 from launchpad.
Install the essentials

{{{$ sudo apt-get install bzr python-setuptools python-dev build-essential}}}

{{{#!wiki caution

OS X Users

The below has you installing & using [[http://mxcl.github.com/homebrew/|homebrew]]. You may get your python & bazaar some other way, but staying with the system python will cause you problems.
}}}
Line 10: Line 18:
$ bzr branch lp:mailman
}}}
$ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
$ brew install python
$ echo "export PATH=/usr/local/share/python:$PATH" >> ~/.bash_profile
$ source ~/.bash_profile
$ brew install bazaar
$ pip install distribute}}}
Line 13: Line 25:
Install and test: Install virtualenv and virtualenvwrapper:
Line 16: Line 28:
$ cd mailman 
$ python bootstrap.py
$ bin/mailman
$ bin/test
$ 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 [[http://virtualenvwrapper.readthedocs.org/en/latest/install.html|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
Line 25: Line 85:
$ bin/mailman start
$ cd ..
(postorius)$ bin/mailman start
(postorius)$ cd ..
Line 29: Line 89:
At this point Mailman will not send nor receive any real emails.&nbsp;But that's fine as long as you only want to work on the components&nbsp;related to the ReST client or the web ui. 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.
Line 31: Line 91:
== mailman.client (the Python bindings for Mailman's ReST API) ==
Download from launchpad:
=== mailman.client (the Python bindings for Mailman's ReST API) ===
Line 35: Line 94:
$ bzr branch lp:mailman.client (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
Line 38: Line 113:
Install in development mode to be able to change the code&nbsp;without working directly on the PYTHONPATH. == Profit! ==
Line 40: Line 115:
{{{
$ cd mailman.client
$ (sudo) python setup.py develop
$ cd ..
}}}

== Django >= 1.3 ==
The web ui is a pluggable Django application. Therefore you need to have&nbsp;Django (at least version 1.3) installed.

{{{
$ wget http://www.djangoproject.com/download/1.3.1/tarball/ -O Django-1.3.1.tar.gz
$ tar xzf Django-1.3.1.tar.gz
$ cd Django-1.3.1
$ python setup.py install
$ cd ..
}}}

== mailman-django ==
This Django app contains the code for the web ui.&nbsp;Thanks go out to Anna Granudd and Benedict Stein who started this app&nbsp;as part of their Google Summer of Code projects in 2010 and 2011.

We're currently transitioning the code from the branches we used for&nbsp;GSoC to an 'official' web ui location on launchpad to continue the work there.&nbsp;For now the latest working code can be found here (this will change within the next days...):

{{{
$ bzr branch lp:~flo-fuchs/mailmanwebgsoc2011/transition
}}}

Install it, also in development mode:

{{{
$ cd transition
$ (sudo) python setup.py develop
$ cd ..
}}}

== Setup a simple Django project to host the web ui ==
The last thing you need to set up is a Django site to host the web ui&nbsp;application. This sample project contains all necessary settings to get&nbsp;the application up and running using Django's development server:

{{{
$ bzr branch lp:~flo-fuchs/mailmanweb/django_dev_setup
}}}

Now change to the branch dir, let Django create a db file and start the&nbsp;dev server:

{{{
$ cd django_dev_setup
$ python manage.py syncdb
$ python manage.py runserver
}}}

Now direct your browser to: [[http://localhost:8000]]

== Logging in ==
Authentication against the ReST API is not yet implemented, but there's&nbsp;a dummy AuthBackend in mailman-django that mimics auth behaviour. To&nbsp;login use the credentials hard-coded in:

{{{
./transition/src/mailman_django/auth/restbackend.py
}}}
Now go to [[http://localhost:8000|http://localhost:8000]] to see the web UI for mailman!

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.

Set up your environment

Install the essentials

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

OS X Users

The below has you installing & using homebrew. You may get your python & bazaar some other way, but staying with the system python will cause you problems.

$ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
$ brew install python
$ echo "export PATH=/usr/local/share/python:$PATH" >> ~/.bash_profile
$ source ~/.bash_profile
$ brew install bazaar
$ 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)