Differences between revisions 1 and 2
Revision 1 as of 2012-12-15 09:10:53
Size: 6046
Editor: terri
Comment:
Revision 2 as of 2012-12-15 09:31:10
Size: 2735
Editor: terri
Comment: formatting improved
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DEV/versions/15564858 #pragma page-filename DEV/versions/15564859
Line 6: Line 6:
=== Macports/Fink instructions ===

Install python 2.7.  The command is something like this for macports:
Line 7: Line 11:
<p>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.&nbsp;This has been tested on Ubuntu 11.04 and OS X 10.8.1.</p>
<h2>Set up your environment</h2>
<p>Install the essentials</p><ac:macro ac:name="code"><ac:parameter ac:name="title">Ubuntu instructions</ac:parameter><ac:parameter ac:name="theme">DJango</ac:parameter><ac:parameter ac:name="language">bash</ac:parameter><ac:plain-text-body><![CDATA[$ sudo apt-get install bzr python-setuptools python-dev build-essential]] ></ac:plain-text-body></ac:macro><ac:macro ac:name="note"><ac:parameter ac:name="title">OS X Users</ac:parameter><ac:rich-text-body><span>The below has you installing &amp; using&nbsp;</span><a href="http://mxcl.github.com/homebrew/">homebrew</a><span>. You may get your python &amp; bazaar some other way, but staying with the system python will cause you problems.</span></ac:rich-text-body></ac:macro><ac:macro ac:name="code"><ac:parameter ac:name="title">OS X (10.8) instructions</ac:parameter><ac:parameter ac:name="theme">DJango</ac:parameter><ac:parameter ac:name="language">bash</ac:parameter><ac:plain-text-body><![CDATA[$ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
port install python27

}}}

And this for fink:

apt-get install python27

Make sure that the python you are using is this new version.  e.g. change the links in /usr/bin, edit your PATH so it comes first, etc.

=== Homebrew setup instructions ===

The below has you installing and using [[http://mxcl.github.com/homebrew/|homebrew]] and virtualenv.  



{{{
$ ruby <(curl -fsSkL [[http://raw.github.com/mxcl/homebrew/go|raw.github.com/mxcl/homebrew/go]])
Line 14: Line 33:
$ pip install distribute]] ></ac:plain-text-body></ac:macro>
<p>Install virtualenv and virtualenvwrapper:</p><ac:macro ac:name="code"><ac:parameter ac:name="theme">DJango</ac:parameter><ac:parameter ac:name="language">bash</ac:parameter><ac:plain-text-body><![CDATA[$ pip install virtualenv
$ pip install distribute}}}

Install virtualenv and virtualenvrapper

{{{
$ pip install virtualenv
Line 20: Line 43:
$ source virtualenvwrapper.sh ]] ></ac:plain-text-body></ac:macro>
<p>Create the postorious virtual environment:</p><ac:macro ac:name="code"><ac:parameter ac:name="theme">DJango</ac:parameter><ac:parameter ac:name="language">bash</ac:parameter><ac:plain-text-body><![CDATA[$ mkvirtualenv postorius
$ source virtualenvwrapper.sh ]] ></ac:plain-text-body>}}}



Create the postortius virtual environment.



{{{
$ mkvirtualenv postorius
Line 30: Line 61:
(postorius) $]] ></ac:plain-text-body></ac:macro>
<p>Now you should see (postorius) before your prompt.</p>
<p>For setup on Windows, and more advanced setup,&nbsp;see the <a href="http://virtualenvwrapper.readthedocs.org/en/latest/install.html">Virtualenvwrapper documentation</a>.</p>
<hr />
<h2>Get the sources</h2><ac:macro ac:name="code"><ac:parameter ac:name="theme">DJango</ac:parameter><ac:parameter ac:name="language">bash</ac:parameter><ac:plain-text-body><![CDATA[(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]] ></ac:plain-text-body></ac:macro>
<p>If you get permission errors on this step, your ssh key is probably not in sync with what is on launchpad.net.</p>
<h2>Install Django</h2><ac:macro ac:name="code"><ac:parameter ac:name="theme">DJango</ac:parameter><ac:parameter ac:name="language">bash</ac:parameter><ac:plain-text-body><![CDATA[(postorius)$ pip install django
(postorius)$ pip install django-social-auth]] ></ac:plain-text-body></ac:macro>
<hr />
<h2>Set up sources</h2>
<h3>GNU Mailman 3</h3><ac:macro ac:name="code"><ac:plain-text-body><![CDATA[(postorius)$ cd mailman 
(postorius)$ python bootstrap.py
(postorius)$ bin/buildout
(postorius)$ bin/test
]] ></ac:plain-text-body></ac:macro>
<p>If you get no errors you can now start Mailman:</p><ac:macro ac:name="code"><ac:plain-text-body><![CDATA[(postorius)$ bin/mailman start
(postorius)$ cd ..
]] ></ac:plain-text-body></ac:macro>
<p>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.</p>
<h3>mailman.client (the Python bindings for Mailman's ReST API)</h3><ac:macro ac:name="code"><ac:plain-text-body><![CDATA[(postorius)$ cd mailman.client
(postorius)$ python setup.py develop
(postorius)$ cd ..]] ></ac:plain-text-body></ac:macro>
<h3>Postorius</h3><ac:macro ac:name="code"><ac:plain-text-body><![CDATA[(postorius)$ cd postorius
(postorius)$ python setup.py develop
(postorius)$ cd ..]] ></ac:plain-text-body></ac:macro>
<h2>Start the development server</h2><ac:macro ac:name="code"><ac:plain-text-body><![CDATA[(postorius)$ cd postorius_standalone
(postorius)$ python manage.py syncdb
(postorius)$ python manage.py runserver
]] ></ac:plain-text-body></ac:macro>
<h2>Profit!</h2>
<p>Now go to&nbsp;<a href="http://localhost:8000">http://localhost:8000</a>&nbsp;to see the web UI for mailman!</p>}}}
(postorius) $}}}



You should now see (postorius) before your prompt.

{{{
For setup on Windows, and more advanced setup, see the Virtualenvwrapper documentation: [[http://virtualenvwrapper.readthedocs.org/en/latest/install.html|http://virtualenvwrapper.readthedocs.org/en/latest/install.html]]}}}

By and large, setting up Mailman on a mac is the same as on linux, and you can use A 5 minute guide to get the Mailman web UI running.

However, the stock version of python does not work.  YOU WILL NEED TO INSTALL PYTHON FROM ANOTHER SOURCE.  Below include the instructions for doing so using homebrew, but you can also use fink, macports, etc.  Just make sure you have a version of python installed other than the mac default, and then make sure that it is the one being used.

Macports/Fink instructions

Install python 2.7.  The command is something like this for macports:

port install python27

And this for fink:

apt-get install python27

Make sure that the python you are using is this new version.  e.g. change the links in /usr/bin, edit your PATH so it comes first, etc.

Homebrew setup instructions

The below has you installing and using homebrew and virtualenv.  

$ ruby <(curl -fsSkL [[http://raw.github.com/mxcl/homebrew/go|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 virtualenvrapper

$ 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 ]] ></ac:plain-text-body>

Create the postortius 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) $

You should now see (postorius) before your prompt.

For setup on Windows, and more advanced setup, see the Virtualenvwrapper documentation: [[http://virtualenvwrapper.readthedocs.org/en/latest/install.html|http://virtualenvwrapper.readthedocs.org/en/latest/install.html]]

MailmanWiki: DEV/Mac Mailman development setup guide (last edited 2013-04-19 22:31:11 by xwuang)