Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
This is a very simple starting point for a gondor.io project meant to be used for building mobile APIs using Django >= 1.3.0.  Everything can be modified of course.  I was just hoping to give somebody a headstart and avoid a few of the problems I encountered when getting started with gondor.  I'm assuming you are using virtualenv and pip.  This tutorial is also mercurial based (you can use it on git with only a couple of minor modifications).

- django-tokenapi project for mobile API authentication (https://github.com/jpulgarin/django-tokenapi)
- south for migrations
- sqlite for DB

Another useful resource which I used for much of this: http://kencochrane.net/blog/2011/04/my-day-gondorio/

Setup your Gondor credentials in '~/.gondor'.  This is adequately explained in the gondor docs or from the link above.  You should also create a Gondor site as explained in the gondor docs.

Create a virtualenv:

$ mkvirtualenv gondor  [call this what you want]
$ pip install --update -r www/requirements/project.txt

Additional changes you will need to make:

- edit "www/.gondor/config" and enter your site key
- optionally modify the 'vcs' setting in config if you would rather use git

To create your gondor instance, and deploy:

$ gondor create master
$ gondor deploy master default [the branch name 'default' is specific to mercurial]

Then create your django admin user:

$ gondor run master createsuperuser

Once you have your server up and running, you can verify that the the authentication is working with the superuser credentials set from above.  This first command creates a new token which by default persists for 7 days.

$ curl -d "username=<username>&password=<password>" http://<gondor_site_name>/token/new.json

{"success": true, "token": "2uy-420a8efff7f882afc20d", "user": 1}

To verify that the token is valid and working, we use the user ID and token pair:

$ curl http://<gondor_site_name>/token/2uy-420a8efff7f882afc20d/1.json

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.