blob: edf2e83ca857e2f978b24a103dc9079e527c5b17 [file]
#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.
== Building With `scripts/build.sh` ==
Because
[http://code.google.com/p/soc/source/browse/#svn/trunk/app/tiny_mce Tiny MCE]
(and possibly some other third-party content and JavaScript incorporated
into Melange) is large,
[http://code.google.com/p/googleappengine/source/browse/#svn/trunk/google/appengine/ext/zipserve zipserve]
is used to combine this content into `.zip` archive files (to avoid
file-count limits in Google App Engine). A side effect of this is that,
for Tiny MCE to work in the `textarea` controls on your local working copy,
launched with `thirdparty/google_appengine`, you still need to run a build script
to produce these <tt>.zip</tt> files at least once.
To do this, 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 are using Windows, you will 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.
== 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 Google App Engine ==
Once you have your application configured correctly and you have
executed the `build.sh` script found in the `scripts` folder,
you are ready to deploy your Melange image to your specific Google
App Engine instance.
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
}}}
Once you are satisfied that `build/` contains everything needed, you can deploy
to your Google App Engine instance with:
{{{
thirdparty/google_appengine/appcfg.py update 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].
== Bug Hunting and Feature Requests ==
If you are (or were) a 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 a great deal of code is already done, some parts of the web application are not entirely bug free yet, or feature complete.
Please consider writing up a feature request, or bug report. Please be precise when you file a [http://tinyurl.com/new-issue New Issue].
== Patches ==
[ContributionReviews#Patches Patches] to the code are also welcome,
[ContributionReviews#Suggested_patches_from_casual_contributors even from non-committers].
= 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/].