root/README

Revision 5ca18786bead451a5cb57d6937aa8fdfe0291017, 8.0 KB (checked in by Luis Rodrigues <lfrodrigues@…>, 2 years ago)

replaced django evolution information with south

  • Property mode set to 100644
Line 
1.. image:: rancho_logo.png
2        :align: center
3
4==================================================
5Rancho: Open Source Group/Project Management Tool
6==================================================
7
8
9:Author: The Rancho Team
10:Contact: info@getrancho.com
11:Date: 2009-11-15
12:Web site: http://www.getrancho.com
13:License: Rancho is published under the GNU AGPL v3 license.
14
15.. contents::
16
17Introduction
18=============
19
20Rancho is an Open Source web based tool developed with Django to manage groups of people and projects.
21
22This document gives a brief explanation on how to install Django. Please note that deploying or optimizing Rancho is not the purpose of this document, thus, such subjects are not covered.
23
24The installation of Rancho on a Debian based system using the PostgreSQL database is also included in order to provide an example.
25
26System Requirements
27====================
28
29Here are the system requirements to run Rancho.
30
31  * Linux/UNIX operating system;
32  * Django (http://www.djangoproject.com);
33  * MySQL>=4.0.1 (http://www.mysql.com) OR PostgreSQL>=8.3 (http://www.postgresql.com);
34  * Python MySQLDB (http://mysql-python.sourceforge.net/) in case of using the MySQL database;
35  * PsycoPG (http://www.initd.org) in case of using the PostgreSQL database;
36  * pytz (http://pytz.sourceforge.net/);
37  * PIL - Python Image Library - (http://www.pythonware.com/products/pil/);
38  * ReportLab>=2.2 (http://www.reportlab.org/downloads.html);
39  * html5lib - Library for working with HTML5 documents (http://code.google.com/p/html5lib/);
40  * XHTML2PDF - HTML to PDF converter (http://www.xhtml2pdf.com/)
41  * ElementTree - A container object, designed to store hierarchical data structures. THIS IS ONLINE NEEDED IN PYTHON<=2.4 (http://effbot.org/zone/element-index.htm)
42
43Getting the Code
44=================
45
46Rancho's latest release can be downloaded from:
47
48    http://www.getrancho.com/download
49
50The GIT version of Rancho can be checked out using the following command::
51
52    $ git clone http://git.getrancho.com/rancho.git
53
54Configuration
55==============
56
57Once the system requirements are met and the code is downloaded, the first thing to do is to edit the settings_customize.py file found on the project's root folder. This file already contains several strings that give hints on how to configure it.
58
59External Modules
60=================
61
62Rancho uses some external Django appls. There is a script to easily get those apps called *get_externals.sh*. To run the script you can do as follows::
63
64    $ ./get_externals.sh
65
66Installation on Debian
67=======================
68
69This section covers the installation of Django on a Debian system (or Debian based like Ubuntu). The database used for this example is PostgreSQL which is assumed to be already installed locally as well as Rancho. For this example, the database user is assumed be 'jsmith' with the password 'qwerty'.
70
71Run the following command as superuser to install the other requirements::
72
73    # apt-get install python-psycopg python-tz python-imaging python-reportlab python-html5lib
74    # easy_install pisa
75
76Once the packages finish being installed, create a database to be used by Rancho::
77
78    $ createdb ranchodb
79
80After this, Rancho needs to be configured. Edit the settings_customize.py file as follows::
81
82    SEARCH_ENGINE = 'postgresql'
83   
84    DATABASE_ENGINE = 'postgresql'
85   
86    DATABASE_NAME = 'ranchodb'
87   
88    DATABASE_USER = 'jsmith'
89   
90    DATABASE_PASSWORD = 'qwerty'
91   
92    DATABASE_HOST = ''
93   
94    DATABASE_PORT = ''
95
96
97After the database settings, the email settings need to be configured in order for notifications to be sent. The values given to the settings bellow are also fictional in order to better examplify the configuration::
98
99    DEFAULT_FROM_EMAIL = 'no-reply@example.com'
100   
101    EMAIL_HOST = 'smtp.example.com'
102   
103    EMAIL_HOST_USER = 'jsmith@example.com'
104   
105    EMAIL_HOST_PASSWORD = 'qwerty'
106   
107
108After this, rename the file as settings.py and that's it with Rancho configuration. The next step is to create the database tables and Rancho's initial information like the account owner and the default company::
109
110    $ python manage.py syncdb
111    $ python manage.py migrate
112
113Answer yes to the question to create a superuser and then supply the rest of the information asked.
114
115Once the previous command is finished, it's time to run Rancho. For this, the Django test server is used::
116
117    $ python manage.py runserver
118
119If everything went okay, you can now visit http://localhost:8000 in your web browser to access Rancho. Log in with the information you supplied previously and that's it! Rancho is installed!
120
121**Important**: Note that it is not advisable to use this server for production.
122
123Upgrading Rancho
124=================
125
126If you have a Rancho version installed and upgrade it, there might be changes to the
127database that must be solved in order, for example, to preserve data.
128
129**Important**: It is advisable to back up all your data before upgrading Rancho.
130
131The first thing to do after having upgraded Rancho is to migrate the database
132using the following command::
133
134        $ python manage.py migrate
135
136If all went well, Rancho will be ready to be run.
137
138Important Configuration
139=======================
140
141When using Rancho in a production environment you have to configure some additional items.
142
143Sending files through Django is very inefficient so you should configure Rancho to use Apache mod-xsendfile. You can get it from: http://tn123.ath.cx/mod_xsendfile/
144
145HOW_SEND_FILE='apache-modsendfile'
146
147You should also define a value for SECRET_KEY since this is used to provide a seed in secret-key hashing algorithms. Set this to a random string -- the longer, the better.
148
149Finally you should setup the cron::
150
151    # crontab -e
152
153add the following lines::
154     
155    0 23 * * * RANCHO_INSTALL_DIR/rancho/manage.py run_cron
156    0 * * * * RANCHO_INSTALL_DIR/rancho/manage.py send_mail
157
158The cron is run every day at 23h00 and the mail is sent every hour.
159
160Deploying Rancho in mod_wsgi and mod_python
161============================================
162
163Here you have a sample deployment for mod_wsgi and mod_python. Visit the Django web site to get more complete information on how to deploy Rancho in a production environment.
164
165mod_wsgi
166-------------
167
168Create a new site configuration for apache with::
169
170    <VirtualHost *>
171            ServerName sitename.com
172            Include "INSTALL_DIR/rancho/apache/apache_django_wsgi.conf"
173            ErrorLog /var/log/apache2/error.log
174            LogLevel warn
175            CustomLog /var/log/apache2/access.log combined
176            ServerSignature Off
177            XSendFile on
178            XSendFileAllowAbove on
179    </VirtualHost>
180
181Create a directory for apache configuration in your INSTALL_DIR and create two files::
182
183    apache_django_wsgi.conf
184   
185    Alias /media/ "RANCHO_INSTALL_DIR/rancho/media/"
186    <Directory "RANCHO_INSTALL_DIR/rancho/media">
187        Order allow,deny
188        Options -Indexes
189        Allow from all
190        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
191    </Directory>
192
193    WSGIScriptAlias / "RANCHO_INSTALL_DIR/rancho/apache/rancho.wsgi"
194    <Directory "RANCHO_INSTALL_DIR/rancho/apache/">
195        Allow from all
196    </Directory>
197
198    rancho.wsgi
199   
200    import os, sys
201    #Calculate the path based on the location of the WSGI script.
202    apache_configuration= os.path.dirname(__file__)
203    project = os.path.dirname(apache_configuration)
204    workspace = os.path.dirname(project)
205    sys.path.append(workspace)
206    sys.path.append(project)
207    os.environ['DJANGO_SETTINGS_MODULE'] = 'rancho.settings'
208    import django.core.handlers.wsgi
209    application = django.core.handlers.wsgi.WSGIHandler()
210
211mod_python
212----------------
213
214Create a new site configuration for apache with::
215
216    <VirtualHost *>
217        <Location "/">
218            SetHandler python-program
219            PythonHandler django.core.handlers.modpython
220            SetEnv DJANGO_SETTINGS_MODULE rancho.settings
221            PythonDebug On
222            PythonPath "['RANCHO_INSTALL_DIR', 'RANCHO_INSTALL_DIR/rancho' ] + sys.path"
223        </Location>
224    </VirtualHost>
Note: See TracBrowser for help on using the browser.