| #summary How to get started with Melange | |
| #labels Featured,Phase-Guidelines,Contents-Draft,Importance-Featured | |
| = Prerequisites = | |
| [MelangeIntro Melange] is a web application that runs on | |
| [http://code.google.com/appengine/ Google App Engine]. Google App Engine requires | |
| Python 2.5 or later. Please follow the instructions for your development platform | |
| [http://www.python.org/download/releases/2.5.2/ here] to install Python. | |
| For other setup information, take a look at CodingHintsAndTips. | |
| = Checking Out the Code = | |
| If you are not yet a [ContributionReviews#Committers committer] to the Melange project, you can check out the code just run the following command: | |
| {{{ | |
| svn checkout http://soc.googlecode.com/svn/trunk/ soc-read-only | |
| }}} | |
| On Windows you can use Tortoise SVN to do this checkout, and you drop the 'soc-read-only' - you'll have specified where to put the code already - it's the directory you right clicked on. | |
| If you are a committer follow the instructions [http://code.google.com/p/soc/source/checkout here] to create an SVN working copy by checking out the Melange source code. | |
| = Running the Code = | |
| Change directories into your SVN working copy (into the `trunk/` directory if you have | |
| customized your working copy). There is currently no _build_ step for the Melange web | |
| application (though one will soon be needed in order to upload Melange to a Google | |
| App Engine instance). However, you will need to create your own `app/app.yaml` file from | |
| the existing `app/app.yaml.template` file. On a UNIX system, in the working copy using | |
| shell commands, this can be done with something like: | |
| {{{ | |
| cp app/app.yaml.template app/app.yaml | |
| }}} | |
| Then, edit the newly-created `app.yaml` file with your favorite editor, changing these | |
| lines: | |
| {{{ | |
| # TODO(proto): uncomment and supply a Google App Engine application instance | |
| # application: FIXME | |
| }}} | |
| to something like: | |
| {{{ | |
| application: your-app-engine-name | |
| }}} | |
| where `your-app-engine-name` is the name of one of your Google App Engine slots (or | |
| just some made-up string if you only want to run the `dev_appserver.py` that comes | |
| with the | |
| [http://code.google.com/appengine/downloads.html Google App Engine SDK]). Don't use '`_`' in the name. If you're a C programmer your instincts might tell you that '`_`' is better than '-' in the name - resist those instincts here. | |
| ==Running Locally== | |
| The Melange web application can be started with this command line (since `thirdparty/google_appengine` is checked into `trunk/` in the Melange SVN repository to make it available for test scripts): | |
| {{{ | |
| thirdparty/google_appengine/dev_appserver.py app | |
| }}} | |
| Melange should then be running on [http://localhost:8080/ your workstation on port 8080]. On Windows if you've not got .py associated with the python exe you'll need to prefix the line with `Python`. | |
| If you want to run Melange on other ports you can use the `--port` argument. For more dev_appserver arguments have a look [http://code.google.com/appengine/docs/thedevwebserver.html here]. | |
| ==Running on GAE== | |
| Once you have your application configured correctly, you will need | |
| to execute the `build.sh` script found in the `scripts` | |
| folder. On a UNIX system, in the `trunk/` directory of the working | |
| copy, using shell commands, this can be done with something like: | |
| {{{ | |
| cd scripts/ | |
| ./build.sh | |
| }}} | |
| This script will create a `build/` directory at the same | |
| level as the `app/` directory (and the `scripts/` directory) in the | |
| `svn` working copy. If you're using Windows, you'll need to have Cygwin, and have it on your path _before_ system binaries as the windows `find` command conflicts with the bash `find` command. You'll also need to explicitly prefix with `bash` unless you have set up an association between sh and bash. | |
| You can run the contents of the `build/` directory, in | |
| order to test what would actually be uploaded by `appcfg.py upload` | |
| to Google App Engine by using: | |
| {{{ | |
| thirdparty/google_appengine/dev_appserver.py build | |
| }}} | |
| = Contributing = | |
| There are a number of ways that you can contribute to the Melange project. | |
| == Discussion == | |
| If you are interested in contributing to the Melange project, please join our | |
| [MailingListsGuidelines#General_discussion_list general discussion mailing list]. | |
| Also,feel free to join us [IrcChannelGuidelines on IRC]. | |
| == User Stories, Feature Requests, and Mock-Ups == | |
| If you are a past mentor or student participant in GSoC or GHOP but do not have the time | |
| to contribute patches to Melange, we can still use your help. While there is some code | |
| already submitted for Melange, large parts of the web application are not yet defined. | |
| Please consider writing up a feature request, [UserStories User Story], or even | |
| creating a [http://soc.googlecode.com/svn/trunk/mockups/sitehome.html mock-up] of | |
| something you would like to see in Melange. You can also take a look at the existing | |
| [http://code.google.com/p/soc/issues/list?q=type:Story User Stories] and add your | |
| comments and suggestions. | |
| == Patches == | |
| [ContributionReviews#Patches Patches] to the code are also welcome, | |
| [ContributionReviews#Suggested_patches_from_casual_contributors even from non-committers]. | |
| = Gory Details = | |
| If you enjoy reading dry design documents, you can find some of them | |
| [MelangeIntro here] and [SoCOverview here]. Please bear in mind that this effort is in its very early stages and is being carried out in public view. Much of the documentation is very incomplete and will evolve over time. | |
| = Troubleshooting = | |
| == AppConfigNotFoundError == | |
| {{{ | |
| soc-read-only$ thirdparty/google_appengine/dev_appserver.py app | |
| Traceback (most recent call last): | |
| File "soc-read-only/thirdparty/google_appengine/google/appengine/tools/dev_appserver.py", line 2638, in LoadAppConfig | |
| raise AppConfigNotFoundError | |
| google.appengine.tools.dev_appserver.AppConfigNotFoundError | |
| }}} | |
| This error means that it can not find a app.yaml file. Please check the following things, | |
| * You are running the command in the directory you checked out. | |
| * You have created the app.yaml from app.yaml.template in step [GettingStarted#Running_the_Code Running the Code]. | |
| == Socket.error == | |
| {{{ | |
| File "/usr/lib/python2.5/BaseHTTPServer.py", line 101, in server_bind | |
| SocketServer.TCPServer.server_bind(self) | |
| File "/usr/lib/python2.5/SocketServer.py", line 341, in server_bind | |
| self.socket.bind(self.server_address) | |
| File "<string>", line 1, in bind | |
| socket.error: (98, 'Address already in use') | |
| }}} | |
| This error means that some other program is running on port 8080 (the default port that appengine starts on). This can also happen if you try and run two copies of the program at once. | |
| To run the program on a different port use the --port argument, for example | |
| {{{ | |
| thirdparty/google_appengine/dev_appserver.py --port=9999 build | |
| }}} | |
| You will then need to connect to the correct port when browsing to the site. IE In the above example you would need to go to [http://localhost:9999/]. |