Welcome to Funday Anyday Roulette’s documentation!¶
Funday Anyday Roulette is a site that gives you a random Funday Monday to play. These docs mostly concern folks wanting to either work on the site or using the API.
Contents:
Getting Involved¶
Installing¶
Funday Roulette is a pretty standard Django application. If you are familiar with Django development you should be right at home.
First you’ll need to clone the code base using git:
git clone https://github.com/wraithan/funday.git
Then set up a virtualenv and then after activating it (see virtualenv link if you don’t know what I am talking about), install the dependencies for funday:
pip install -r requirements.txt
After that you’ll set up the database, run migrations, and import a base set of data:
./manage.py syncdb
./manage.py migrate
./manage.py loaddata funday_monday_import
Now it is simple as running the server and checking that things work:
./manage.py runserver
Contributing¶
All development is done on github in the official repo: wraithan/funday please direct pull requests and issues there.
Before starting work on something please make sure it is an issue in the issue tracker. When you are done writing your patch please put fixes #1 in your commit message (replacing 1 with the issue that your commit fixes) then send a pull request.
I can emphasize this part enough: please do not delete your fork until the pull request has been closed. If it hasn’t been closed and you delete you fork, I can’t pull down your code to test it before merging which means I very likely wont merge your code.
Code Style¶
I follow pep8 and pyflakes closely. If you’d like to check to see if your code is ready for you to send a pull request please install fabric then run:
fab style_check
It will tell you where you have made mistakes, or it will just exit normally after running pep8 and pyflakes.
On top of those two, I prefer to have imports grouped in the following way:
# python imports
import os
# library imports
from django.db import models
# local package imports
from anyday.core import views
Within the groupings the imports should be alphabetized.
API¶
This is a Tastypie based API, as such in interacting with it you can use their documentation for that: Interacting with Tastypie. Below are the current points in the API.
-
GET
/api/v1/funday/
¶ List of all Funday objects.
Example Request
GET /api/v1/funday/ HTTP/1.1 Host: fundayroulette.com Accept: application/json
Example Response
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Vary: Accept { "meta": { "limit": 20, "next": "/api/v1/funday/?offset=20&limit=20&format=json", "offset": 0, "previous": null, "total_count": 1 }, "objects": [ { "created": "2012-09-13T06:08:54.151000", "description": "The constraint is that the Zerg player is forbidden to make any Queens.", "game_type": "individual", "id": 1, "modified": "2012-09-14T10:02:42.453000", "name": "No Queens!", "protoss": false, "resource_uri": "/api/v1/funday/1/", "terran": false, "video": "http://day9.tv/d/Day9/day9-daily-183-funday-monday-no-queens/", "zerg": true }, ] }
-
GET
/api/v1/funday/<id>/
¶ Details for an individual Funday object.
Example Request
GET /api/v1/funday/1/ HTTP/1.1 Host: fundayroulette.com Accept: application/json
Example Response
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Vary: Accept { "created": "2012-09-13T06:08:54.151000", "description": "The constraint is that the Zerg player is forbidden to make any Queens.", "game_type": "individual", "id": 1, "modified": "2012-09-14T10:02:42.453000", "name": "No Queens!", "protoss": false, "resource_uri": "/api/v1/funday/1/", "terran": false, "video": "http://day9.tv/d/Day9/day9-daily-183-funday-monday-no-queens/", "zerg": true }
-
GET
/api/v1/funday/random/
¶ Details for a random Funday object.
Example Request
GET /api/v1/funday/random/ HTTP/1.1 Host: fundayroulette.com Accept: application/json
Example Response
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Vary: Accept { "created": "2012-09-13T07:29:45.214000", "description": "At the beginning of your game, you must name three Units. For the rest of the game, you may only make those three Units (and workers/buildings, of course).", "game_type": "individual", "id": 16, "modified": "2012-09-13T07:29:45.215000", "name": "Count to Three", "protoss": true, "resource_uri": "/api/v1/funday/16/", "terran": true, "video": "http://day9.tv/d/Day9/day9-daily-284-funday-monday-count-to-three-encore/", "zerg": true }