-
Notifications
You must be signed in to change notification settings - Fork 196
GettingStarted
« back to DeveloperGuide |
---|
You can develop on Linux, or Mac OS, or Windows-with-Cygwin.
You will probably be happiest if you do these steps in order.
Python 2.7.x (you may already have this; try running "python" or "python2.7" to check)
- All platforms: Download here and install
- Mac OS X: the pre-installed Python binaries are at /System/Library/Frameworks/Python.framework/Versions/2.x/bin/python2.x and are symlinked from /usr/bin/python2.x. If you downloaded and installed a new version, it will be in /Library/Frameworks rather than /System/Library/Frameworks, and you'll need to
ln -s /Library/Frameworks/Python.framework/Versions/2.7/bin/python /usr/bin/python2.7
Setuptools 0.6c11 and EasyInstall (you may already have this; try running "easy_install" or "easy_install-2.7" to check)
- All platforms: Download, then
tar xvfz
andsudo python2.7 setup.py install
.
- Ubuntu:
sudo apt-get install python-setuptools
Mercurial — for revision control (you may already have this; try running "hg" to check)
- All platforms: Download from http://mercurial.selenic.com/ and install.
PIL 1.1.7 — optional, only needed if you want to test photo uploading locally
- All platforms: Download then
tar xvfz
andsudo python2.7 setup.py install
.
Latest App Engine SDK for Python
- All platforms: Download the Linux zip file (regardless of your platform) from google_appengine_1.8.8.zip and unzip in your home directory.
py.test — for running unit tests
- All platforms:
sudo easy_install-2.7 pytest
Gettext — for internationalization
- Linux:
sudo apt-get install gettext
- Mac OS 10.7: Download, double-click, and install.
- Mac OS 10.8: Download, double-click, and install.
- Make a local clone of the code repository with this command. (This assumes you want to put the code in a directory called
pf
:
hg clone https://googlepersonfinder.googlecode.com/hg pf
- Create a .hgrc file in your HOME directory (or on a Windows system in %USERPROFILE%\Mercurial.ini) containing the following 2 lines:
[ui]
username = John Doe <[email protected]>
Questions about Mercurial? Check out the quickstart guide.
All the following commands should be done from the application directory (the pf
directory we created in the previous step).
cd pf
In one terminal, start a local server with this command:
tools/gae run app
# Brings up a local dev_appserver, serving on localhost:8000 by default
With the app server running, open a separate terminal and enter this command:
tools/console :8000 -c 'setup_datastore()'
# Connects to localhost:8000 and executes setup_datastore()
This will connect to your app and create a few example repositories such as "haiti" and "japan".
Now you should be able to use the app by going to http://localhost:8000/ in a browser, where you'll see the repositories listed on the left.
You can also run tests like this:
tools/all_tests
You may see some warning about the version of Python but it is okay to ignore it now.
If you would like to contribute code, please see HowToDevelop.
Person Finder usually has one repository per crisis incident. Each repository can be customized with a title, set of languages, announcements, and other settings.
To create a new repository, go to the administration page at http://localhost:8000/haiti/admin
and next to "Select a repository" choose "Create new...", then fill in the box with a new repository identifier and click Create. You can then edit the settings page for your newly created repository and click "Save these settings" to save your edits.
If you would like to be able to read and write data in your new repository through the Person Finder API, you will need to create an API key, which you can do at http://localhost:8000/
repo/admin/api_keys
(replace repo with your repository identifier).
« back to DeveloperGuide |
---|