Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin
[mediagoblin.git] / docs / hackinghowto.rst
CommitLineData
5a40e1ec
WKG
1.. _hacking-howto:
2
00fdc7bd
WKG
3===============
4 Hacking HOWTO
5===============
6
5a40e1ec
WKG
7
8So you want to hack on GNU MediaGoblin?
9=======================================
56d507b6
WKG
10
11First thing to do is check out the Web site where we list all the
12project infrastructure including:
13
14* the mailing list
15* the IRC channel
16* the bug tracker
17
18Additionally, we have information on how to get involved, who to talk
19to, what needs to be worked on, and other things besides!
20
21
c66d0f5c
WKG
22How to set up and maintain an environment for hacking
23=====================================================
56d507b6 24
56d507b6 25
c66d0f5c
WKG
26Getting requirements
27--------------------
56d507b6 28
c66d0f5c
WKG
29First, you need to have the following installed before you can build
30an environment for hacking on GNU MediaGoblin:
56d507b6 31
c66d0f5c 32* Python 2.6 or 2.7 - http://www.python.org/
56d507b6 33
c66d0f5c 34 You'll need Python as well as the dev files for building modules.
56d507b6 35
c66d0f5c
WKG
36* python-lxml - http://lxml.de/
37* git - http://git-scm.com/
38* MongoDB - http://www.mongodb.org/
39
40If you're running Debian GNU/Linux or a Debian-derived distribution
41such as Mint or Ubuntu, running the following should install these
42requirements::
43
44 sudo apt-get install mongodb git-core python python-dev python-lxml
45
46
47Running bootstrap and buildout
48------------------------------
49
50After installing the requirements, follow these steps:
51
521. Clone the repository::
53
54 git clone http://git.gitorious.org/mediagoblin/mediagoblin.git
56d507b6 55
719f82ba 562. Bootstrap and run buildout::
56d507b6 57
c66d0f5c
WKG
58 cd mediagoblin
59 python bootstrap.py && ./bin/buildout
60
61
62That's it! Using this method, buildout should create a ``user_dev``
63directory, in which certain things will be stored (media, beaker
64session stuff, etc). You can change this, but for development
65purposes this default should be fine.
66
67
68.. Note::
69
70 We used `zc.buildout <http://www.buildout.org/>`_ because it
71 involves fewer steps to get things running and less knowledge of
72 Python packaging. However, if you prefer to use `virtualenv
73 <http://pypi.python.org/pypi/virtualenv>`_, that should work just
74 fine.
56d507b6
WKG
75
76
c66d0f5c
WKG
77Updating dependencies
78---------------------
56d507b6 79
c66d0f5c
WKG
80While hacking on GNU MediaGoblin over time, you'll eventually have to
81update the dependencies. To do that, run::
56d507b6 82
c66d0f5c 83 ./bin/buildout
56d507b6
WKG
84
85
dae6add9
CAW
86Running the server
87==================
88
89Run::
90
c66d0f5c 91 ./bin/paster serve mediagoblin.ini --reload
dae6add9
CAW
92
93
56d507b6
WKG
94Running the test suite
95======================
96
97Run::
98
c66d0f5c 99 ./bin/nosetests
56d507b6
WKG
100
101
102Creating a new file
103===================
104
5a40e1ec
WKG
105FIXME - this needs to be updated when it's set in stone.
106
908dee6b 107All new files need to have license/copyright information.
56d507b6 108
908dee6b 109The following kinds of files get the GNU AGPL header:
56d507b6 110
908dee6b
WKG
111* Python files
112* JavaScript files
113* templates
114* other files with code in them
56d507b6 115
908dee6b 116The following files get a CC BY header:
56d507b6 117
908dee6b 118* CSS files
56d507b6 119
908dee6b
WKG
120The following files don't get a header because that's hard, but are
121under the CC BY license:
122
123* image files
124* video files
5a40e1ec
WKG
125
126
127Quickstart for Django programmers
128=================================
129
130FIXME - write this
131
132
133Bite-sized bugs to start with
134=============================
135
136FIXME - write this