|
|
Line 1: |
Line 1: |
| 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). | | 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== | | ==Prerequisites== |
|
| |
|
| '''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.''
| | You will need the following installed on your system to get Bespin up and running: |
|
| |
|
| Run:
| | * Mercurial |
| | * Git |
| | * Python 2.5 or 2.6 |
|
| |
|
| <code>hg clone http://hg.mozilla.org/labs/bespin</code>
| | '''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.'' |
|
| |
|
| <code>cd bespin/</code>
| | '''NOTE FOR MAC USERS:''' ''You will need Xcode installed.'' |
|
| |
|
| to download the Mercurial repository and enter the <code>bespin/</code> directory. (See the [[Labs/Bespin/DeveloperGuide/UsingMercurial|Using Mercurial]] article for more detailed instructions on using Mercurial.) | | '''NOTE FOR WINDOWS USERS:''' ''Most Bespin developers are using unix-like platforms. Bespin's server should be able to run on Windows, though. You'll need a C compiler, and you can use Microsoft's free [[http://www.microsoft.com/Express/VC/ Visual C++]] compiler. As an alternative, you can use [[http://www.cygwin.com/ Cygwin]] or [[http://www.mingw.org/ MinGW]] to have a unix-like environment on your Windows system.'' |
|
| |
|
| To set up Bespin for the first time, run:
| | ==Getting Started== |
|
| |
|
| <code>python bootstrap.py --no-site-packages</code>
| | Run: |
|
| |
| 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:
| |
| | |
| <code>source bin/activate</code>
| |
|
| |
| 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:
| | hg clone http://hg.mozilla.org/labs/bespinclient |
| | hg clone http://hg.mozilla.org/labs/bespinserver |
| | cd bespinclient |
|
| |
|
| <code>paver dojo create_db</code> | | This will get the Bespin client and Python Bespin server code checked out. The <code>bespinclient/</code> directory is the "main" directory that you'll use. (See the [[Labs/Bespin/DeveloperGuide/UsingMercurial|Using Mercurial]] article for more detailed instructions on using Mercurial.) |
|
| |
|
| You can start up the development server (runs on localhost:8080) by running:
| | To set up Bespin for the first time, run: |
|
| |
|
| <code>paver start</code>
| | python bootstrap.py --no-site-packages |
| | |
| 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 start</code>
| |
| | |
| For a complete reference on all commands and their arguments, run <code>paver help</code> or <code>paver help <command></code>.
| |
| | |
| You can run the unit tests by running:
| |
| | |
| <code>nosetests backend/python/bespin</code>
| |
| | |
| ==Updating the Required Files==
| |
| | |
| If the "requirements.txt" file changes, you can re-install the required packages by running:
| |
| | |
| <code>paver required</code>
| |
| | | |
| You can also force upgrade all of the packages like so:
| | to get the environment set up. This is built around [[http://pypi.python.org/pypi/virtualenv virtualenv]]. |
|
| |
|
| <code>pip install -U -r requirements.txt</code>
| | After running the bootstrap script, please follow the additional instructions that are displayed on the screen. |
|
| |
|
| ==More Documentation== | | ==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/. | | Documentation can be found in the docs directory of "bespinclient". |
|
| |
|
| ==Contributing to Bespin== | | ==Contributing to Bespin== |
Line 59: |
Line 41: |
| For details see: | | For details see: |
| :[[Labs/Bespin/Contributing]] | | :[[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:
| |
|
| |
| # some libraries used by Bespin try to compile C code
| |
| # some paths may not be correct on Windows systems
| |