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