Labs/Bespin/DeveloperGuide/Setup: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 22: Line 22:


<code>paver start</code>
<code>paver start</code>
If you already have something running on port 8080, or wish to listen on a specific IP address, you can run the server with a couple of additional arguments. For instance, to run it on 127.0.0.1:8000, you could run:
<code>paver server.address=127.0.0.1 server.port=8000</code>
For a complete reference on all commands and their arguments, run <code>paver help</code> or <code>paver help &lt;command&gt;</code>.


You can run the unit tests by running:
You can run the unit tests by running:

Revision as of 18:14, 20 August 2009

Thanks for downloading the code to the Bespin project. You can easily get Bespin's Python server running on your local Mac or Linux machine (see note about Windows below).

Getting Started

NOTE FOR LINUX USERS: If you are running on a Linux system, you will likely need a "python-dev" (on Ubuntu; possibly "python-devel" elsewhere) package installed, if you do not already have it.

Run:

python bootstrap.py --no-site-packages

to get the environment set up. This is built around virtualenv. All of the required packages will automatically be installed. Once this is set up, you can run:

source bin/activate

to enter the virtualenv. Alternatively, you can just prefix the commands you run with "bin/". If you wish to restore your command line environment, you can type "deactivate".

The first time around, you'll need to download Dojo and create the database:

paver dojo create_db

You can start up the development server (runs on localhost:8080) by running:

paver start

If you already have something running on port 8080, or wish to listen on a specific IP address, you can run the server with a couple of additional arguments. For instance, to run it on 127.0.0.1:8000, you could run:

paver server.address=127.0.0.1 server.port=8000

For a complete reference on all commands and their arguments, run paver help or paver help <command>.

You can run the unit tests by running:

nosetests backend/python/bespin

Updating the Required Files

If the "requirements.txt" file changes, you can re-install the required packages by running:

paver required

You can also force upgrade all of the packages like so:

pip install -U -r requirements.txt

More Documentation

Documentation for Bespin's code and APIs are actually part of every instance of the Bespin server. To view the docs on your local instance, just browse to http://localhost:8080/docs/.

Contributing to Bespin

For details see:

Labs/Bespin/Contributing

The source repository is in Mercurial at:

http://hg.mozilla.org/labs/bespin/

Note about running on Windows

The current, up-to-date Bespin backend is written in Python. Because Python is cross-platform, it should be possible (and likely not too difficult) to make the backend work on Windows once Python 2.5 is installed. However, this has not been tested and there are likely two issues:

  1. some libraries used by Bespin try to compile C code
  2. some paths may not be correct on Windows systems