Commit c8b76f3a authored by Florian Fuchs's avatar Florian Fuchs

- removed outdated installation instructions

- added draft for new installation guide
parent 4f49b83d
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: cca8bccba816f1a79080c55d505c09f8
config: b7c499bf02394c05c2168ae495bae526
tags: fbb0d17656682115ca4d033fb2f83ba1
.. mailman_django documentation master file, created by
sphinx-quickstart on Wed Aug 17 15:43:10 2011.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to mailman_django's documentation!
==========================================
Postorius - The New Mailman Web UI
==================================
Contents:
......
......@@ -20,6 +20,15 @@ You should have received a copy of the GNU Lesser General Public License
along with postorius. If not, see <http://www.gnu.org/licenses/>.
1.0 alpha 2
===========
(2012-XX-XX)
* dev setup fix for Django 1.4 contributed by Rohan Jain
* missing csrf tokens in templates contributed by Richard Wackerbarth (LP: 996658)
* moderation: fixed typo in success message call
1.0 alpha 1 -- "Space Farm"
===========================
(2012-03-23)
......
Installation
============
.. warning::
This installation guide is outdated and needs to be updated.
Please use the following resources instead:
To install GNU Mailman follow the instructions in the documentation:
http://packages.python.org/mailman/
A description how to run postorius on Django's dev server, can be found in
the GNU Mailman wiki:
http://wiki.list.org/display/DEV/A+5+minute+guide+to+get+the+Mailman+web+UI+running
You can also find a guide how to run postorius using the Apache web server
on the Mailman wiki:
http://wiki.list.org/display/DEV/How+to+get+Postorius+running+on+Apache+and+mod_wsgi
Mailman3 - a7
-------------
* Check Dependecys
.. note::
This might differ on different systems - I was testing Ubuntu 11.04 natty and needed to install Postfix before running the installation.
* Download or branch Mailman3a7 from http://launchpad.net/mailman/3.0/3.0.0a7/+download/mailman-3.0.0a7.tar.gz and unpack it.
* Change into the unpacked DIR which might be named "mailman-3.0.0a7"
.. note::
Please be aware that the following steps only work if you're really in that DIR. If you consider adding a subfolder name to the commands those woun't work !
* Run the Installation from a Shell (not Python)
.. code-block:: bash
$ python bootstrap.py
$ bin/buildout
* Vertify that everything was setup correclty and your branch fullfills the version requirements by running it's own test module
.. code-block:: bash
$ bin/test
* Now you're able to run mailman using
.. code-block:: bash
$ bin/mailman
Mailman Client / REST Api
-------------------------
Next thing you need to do is installing the Plugin used for communication with non-mailman-code parts like our WebUI. Within the Client Branch we've put both, Classes to access the Core which are run as a Plugin and some Python Bindings.
The Python Bindings were used later on within our Django Application to access the Server. Failing to install the Client would result in an offline version of WebUI
Once again start by branching the code which is on Launchpad
.. code-block:: bash
$ bzr branch lp:mailman.client
.. note::
We've successfully tested our functionality with Revision 16 - In case the Client gets updated which it surely will in future we can't guarentee that it is compatible anymore.
As you only want to run the Client and not modify it's code you're fine with running the install command from within the directory. At the moment this requires Sudo Priveledges as files will copied to the Python Site-Packages Directory which is available to all users.
.. code-block:: bash
$ sudo python setup.py install
.. note::
If you want to change parts of the Client you can use the development option which will create a Symlink instead of a Hardcopy of all files:
.. code-block:: bash
$ sudo python setup.py develop
All changes will apply once you restart Mailman itself.
Django 1.3
----------
During our development we started a Django Site based on the 1.2 Version which is included into Ubuntu's repositorys. This made the installation easy but we ended up having some points which would get a much better code when using some elements introducing in 1.3.
As Mailman is supposed to be long-time stable - or however you call it - we decided that we should stick to the latest stable version right away. For this reason you're required to install Django 1.3+ which is descriped on their Website. (https://www.djangoproject.com/download/)
.. note::
Please be Aware that it's not recommended to run both 1.2 and 1.3 at the same time
In Django you've got 3 different levels of data.
- Django Installation Files
- Django Site
- Django Apps
usually you don't see the Installation as it's hidden somewhere within the System and the Apps are simply included into The Site Directory.
As we wanted to have the possibility to include the App into any Django Site which might already exist we decided to keep Site and App seperated.
This installation guide covers Postorius, the web user interface for
GNU Mailman 3. To install GNU Mailman follow the instructions in the documentation:
http://packages.python.org/mailman/
During GSoC we've used different branches for this:
- lp:mailmanwebgsoc2011
- lp:mailmanwebgsoc2011/django-site-0.1
Django Site Installation
------------------------
We've created this branch for quick development - everyone is free to use his own Django site, but this one already includes a couple of modifications we've made that will allow running the Development Server just a few seconds after Branching both Site and App.
As far as I know at the moment we've made the following alignments: (All of these are in the settings.py file of the Django Site)
REST_SERVER = 'localhost:8001'
API_USER = 'restadmin'
API_PASS = 'restpass'
.. note::
These are the default values used by the Mailman Client we've installed earlier. Feel free to modify the password and username if you need to.
MAILMAN_TEST_BINDIR = '/home/benste/Projects/Gsoc_mailman/mailman-3.0.0a7/bin'
#/home/florian/Development/mailman/bin'
.. note:: Running the test modules requires to launch a special version of mailman with it's own testing DB otherwise you'd destroy you're sites content during testing. This Path needs to point to YOUR own installation of mailman.
MAILMAN_THEME = "default"
.. note::
We decided to allow simple Appearance Modifications, to use a custom CSS you could simply add a Directory within the media directory of the app and Link it's name here. All HTML Pages will use the Styles from the Directory mentioned in here
Installing for Development
--------------------------
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.join(os.path.split(PROJECT_PATH)[0], "mailman_django/media/mailman_django/")
.. note::
Absolute path to the directory that holds media.
Example: "/home/media/media.lawrence.com/"
MEDIA_URL = '/mailman_media/'
.. note::
URL that handles the media served from MEDIA_ROOT. Make sure to use a trailing slash if there is a path component (optional in other cases).Examples: "http://media.lawrence.com", "http://example.com/media/"
AUTHENTICATION_BACKENDS = (
'mailman_django.auth.restbackend.RESTBackend',
'django.contrib.auth.backends.ModelBackend'
)
.. note::
This creates a connection in between Djangos Login and Permission Decorators which we use for authentification and a custom Backend which we created in Preparation to work together with the REST API or an upcoming Middleware.
You need to keep the Django one for testing fallback.
TEMPLATE_CONTEXT_PROCESSORS=(
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.csrf",
"django.contrib.messages.context_processors.messages",
"mailman_django.context_processors.lists_of_domain",
"mailman_django.context_processors.render_MAILMAN_THEME",
"mailman_django.context_processors.extend_ajax"
.. note::
We're using Context Processors to easily render value which we need in nearly every view.
ROOT_URLCONF = 'mailman_django.urls'
.. warning::
You should use the development server only locally. While it's possible to
make the dev server available publicly, you should never do that in a
production environment.
.. note::
This is where our URL Config is - if you run your own site with other Apps as well you might want to adjust this to your urls.py which includes our file.
TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, "mailman_django/templates"),
Apache and mod_Wsgi
-------------------
.. note::
Adds our own Templates
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'mailman_django',
.. note::
Makes sure that Django knows about our directory as an App and creates needed Tables () when running
.. code-block:: bash
$ python manage.py syncdb
Now that you know about all these you might start the development server. As usual in Django this is done by running
.. code-block:: bash
$ python manage.py runserver
within the Django Site Directory - as usual the default address is localhost:8000
Of course it will only be able to start once our app is in place as well.
Django Application
------------------
First get the files, and make sure you paste them into your Project directory and adjust it's name to the appropriate configuration you've made earlier in the Django Site. Remeber our default is mailman_django
.. code-block:: bash
$ bzr branch lp:mailmanwebgsoc2011
.. note::
We've tested Revision 172
.. note::
We're planning to ease up installation by creating an egg
......@@ -79,6 +79,14 @@ div.sphinxsidebar input {
font-size: 1em;
}
div.sphinxsidebar input[type="text"] {
width: 170px;
}
div.sphinxsidebar input[type="submit"] {
width: 30px;
}
img {
border: 0;
}
......@@ -236,7 +244,6 @@ img.align-center, .figure.align-center, object.align-center {
}
.align-center {
clear: both;
text-align: center;
}
......@@ -440,6 +447,11 @@ dl.glossary dt {
font-style: oblique;
}
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
}
/* -- code displays --------------------------------------------------------- */
pre {
......@@ -525,4 +537,4 @@ span.eqno {
#top-link {
display: none;
}
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilties for all documentation.
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
......@@ -185,9 +185,9 @@ var Documentation = {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<li class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></li>')
.appendTo($('.sidebar .this-page-menu'));
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
}
},
......@@ -213,7 +213,7 @@ var Documentation = {
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('.sidebar .this-page-menu li.highlight-link').fadeOut(300);
$('#searchbox .highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},
......
/*
* searchtools.js
* ~~~~~~~~~~~~~~
* searchtools.js_t
* ~~~~~~~~~~~~~~~~
*
* Sphinx JavaScript utilties for the full-text search.
*
......@@ -36,10 +36,11 @@ jQuery.makeSearchSummary = function(text, keywords, hlwords) {
return rv;
}
/**
* Porter Stemmer
*/
var PorterStemmer = function() {
var Stemmer = function() {
var step2list = {
ational: 'ate',
......@@ -300,20 +301,20 @@ var Search = {
},
query : function(query) {
var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in',
'if', 'for', 'no', 'there', 'their', 'was', 'is',
'be', 'to', 'that', 'but', 'they', 'not', 'such',
'with', 'by', 'a', 'on', 'these', 'of', 'will',
'this', 'near', 'the', 'or', 'at'];
// stem the searchterms and add them to the correct list
var stemmer = new PorterStemmer();
var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"];
// Stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = query.split(/\s+/);
var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null;
var objectterms = [];
for (var i = 0; i < tmp.length; i++) {
if (tmp[i] != "") {
objectterms.push(tmp[i].toLowerCase());
}
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] == "") {
// skip this "word"
......@@ -344,9 +345,6 @@ var Search = {
var filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms;
var objects = this._index.objects;
var objtypes = this._index.objtypes;
var objnames = this._index.objnames;
var fileMap = {};
var files = null;
// different result priorities
......@@ -357,40 +355,19 @@ var Search = {
$('#search-progress').empty();
// lookup as object
if (object != null) {
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
match = objects[prefix][name];
descr = objnames[match[1]] + _(', in ') + titles[match[0]];
// XXX the generated anchors are not generally correct
// XXX there may be custom prefixes
result = [filenames[match[0]], fullname, '#'+fullname, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
}
}
}
}
for (var i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0,i),
objectterms.slice(i+1, objectterms.length))
var results = this.performObjectSearch(objectterms[i], others);
// Assume first word is most likely to be the object,
// other words more likely to be in description.
// Therefore put matches for earlier words first.
// (Results are eventually used in reverse order).
objectResults = results[0].concat(objectResults);
importantResults = results[1].concat(importantResults);
unimportantResults = results[2].concat(unimportantResults);
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
// perform the search on the required terms
for (var i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
......@@ -489,7 +466,7 @@ var Search = {
listItem.slideDown(5, function() {
displayNextItem();
});
});
}, "text");
} else {
// no source available, just display title
Search.output.append(listItem);
......@@ -510,9 +487,74 @@ var Search = {
}
}
displayNextItem();
},
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
var importantResults = [];
var objectResults = [];
var unimportantResults = [];
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
var match = objects[prefix][name];
var objname = objnames[match[1]][2];
var title = titles[match[0]];
// If more than one term searched for, we require other words to be
// found in the name/title/description
if (otherterms.length > 0) {
var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase();
var allfound = true;
for (var i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false;
break;
}
}
if (!allfound) {
continue;
}
}
var descr = objname + _(', in ') + title;
anchor = match[3];
if (anchor == '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
}
}
}
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
return [importantResults, objectResults, unimportantResults]
}
}
$(document).ready(function() {
Search.init();
});
});
\ No newline at end of file
......@@ -29,6 +29,9 @@ $(function() {
var sidebar = $('.sphinxsidebar');
var sidebarwrapper = $('.sphinxsidebarwrapper');
// for some reason, the document has no sidebar; do not run into errors
if (!sidebar.length) return;
// original margin-left of the bodywrapper and width of the sidebar
// with the sidebar expanded
var bw_margin_expanded = bodywrapper.css('margin-left');
......
// Underscore.js 0.5.5
// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the terms of the MIT license.
// Portions of Underscore are inspired by or borrowed from Prototype.js,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore/
(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,
......
This diff is collapsed.
<!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>Index &mdash; mailmanweb v0.1 documentation</title>
<title>Index &mdash; Postorius 1.0a2 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: '0.1',
VERSION: '1.0a2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -22,7 +27,7 @@
<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="mailmanweb v0.1 documentation" href="index.html" />
<link rel="top" title="Postorius 1.0a2 documentation" href="index.html" />
</head>
<body>
<div class="related">
......@@ -34,7 +39,7 @@
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">mailmanweb v0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Postorius 1.0a2 documentation</a> &raquo;</li>
</ul>
</div>
......@@ -44,16 +49,20 @@
<div class="body">
<h1 id="index">Index</h1>
<h1 id="index">Index</h1>
<div class="genindex-jumpbox">
<a href="#T"><strong>T</strong></a>
</div>
<div class="genindex-jumpbox">
<a href="#T"><strong>T</strong></a>
</div>
<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="using.html#module-tests.tests">tests.tests (module)</a></dt>
</dl></td>
<dt><a href="using.html#module-tests.tests">tests.tests (module)</a>
</dt>
</dl></td>
</tr></table>
......@@ -69,7 +78,7 @@
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<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" />
......@@ -92,12 +101,12 @@
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="index.html">mailmanweb v0.1 documentation</a> &raquo;</li>
<li><a href="index.html">Postorius 1.0a2 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011, Benedict Stein.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
&copy; Copyright 2012, The Free Software Foundation.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
</div>
</body>
</html>
\ No newline at end of file
......@@ -3,17 +3,20 @@
<!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>Welcome to mailman_django’s documentation! &mdash; mailmanweb v0.1 documentation</title>
<title>Postorius - The New Mailman Web UI &mdash; Postorius 1.0a2 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">