contributing.txt 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  1. ======================
  2. Contributing to Django
  3. ======================
  4. If you think working *with* Django is fun, wait until you start working *on*
  5. it. We're passionate about helping Django users make the jump to contributing
  6. members of the community, so there are many ways you can help Django's
  7. development:
  8. * Blog about Django. We syndicate all the Django blogs we know about on
  9. the `community page`_; contact jacob@jacobian.org if you've got a blog
  10. you'd like to see on that page.
  11. * Report bugs and request features in our `ticket tracker`_. Please read
  12. `Reporting bugs`_, below, for the details on how we like our bug reports
  13. served up.
  14. * Submit patches for new and/or fixed behavior. Please read `Submitting
  15. patches`_, below, for details on how to submit a patch. If you're looking
  16. for an easy way to start contributing to Django have a look at the
  17. `easy-pickings`_ tickets.
  18. * Join the `django-developers`_ mailing list and share your ideas for how
  19. to improve Django. We're always open to suggestions, although we're
  20. likely to be skeptical of large-scale suggestions without some code to
  21. back it up.
  22. * Triage patches that have been submitted by other users. Please read
  23. `Ticket triage`_ below, for details on the triage process.
  24. That's all you need to know if you'd like to join the Django development
  25. community. The rest of this document describes the details of how our community
  26. works and how it handles bugs, mailing lists, and all the other minutiae of
  27. Django development.
  28. .. seealso::
  29. This document contains specific details for contributing to
  30. Django. However, many new contributors find this guide confusing
  31. or intimidating at first. For a simpler introduction
  32. to becoming a contributor please see the :doc:`/howto/contribute` guide.
  33. .. _reporting-bugs:
  34. Reporting bugs
  35. ==============
  36. Well-written bug reports are *incredibly* helpful. However, there's a certain
  37. amount of overhead involved in working with any bug tracking system so your
  38. help in keeping our ticket tracker as useful as possible is appreciated. In
  39. particular:
  40. * **Do** read the :doc:`FAQ </faq/index>` to see if your issue might
  41. be a well-known question.
  42. * **Do** `search the tracker`_ to see if your issue has already been filed.
  43. * **Do** ask on `django-users`_ *first* if you're not sure if what you're
  44. seeing is a bug.
  45. * **Do** write complete, reproducible, specific bug reports. Include as
  46. much information as you possibly can, complete with code snippets, test
  47. cases, etc. This means including a clear, concise description of the
  48. problem, and a clear set of instructions for replicating the problem.
  49. A minimal example that illustrates the bug in a nice small test case
  50. is the best possible bug report.
  51. * **Don't** use the ticket system to ask support questions. Use the
  52. `django-users`_ list, or the `#django`_ IRC channel for that.
  53. * **Don't** use the ticket system to make large-scale feature requests.
  54. We like to discuss any big changes to Django's core on the
  55. `django-developers`_ list before actually working on them.
  56. * **Don't** reopen issues that have been marked "wontfix". This mark
  57. means that the decision has been made that we can't or won't fix
  58. this particular issue. If you're not sure why, please ask
  59. on `django-developers`_.
  60. * **Don't** use the ticket tracker for lengthy discussions, because they're
  61. likely to get lost. If a particular ticket is controversial, please move
  62. discussion to `django-developers`_.
  63. * **Don't** post to django-developers just to announce that you have filed
  64. a bug report. All the tickets are mailed to another list
  65. (`django-updates`_), which is tracked by developers and interested
  66. community members; we see them as they are filed.
  67. .. _django-updates: http://groups.google.com/group/django-updates
  68. .. _reporting-security-issues:
  69. Reporting security issues
  70. =========================
  71. Report security issues to security@djangoproject.com. This is a private list
  72. only open to long-time, highly trusted Django developers, and its archives are
  73. not publicly readable.
  74. In the event of a confirmed vulnerability in Django itself, we will take the
  75. following actions:
  76. * Acknowledge to the reporter that we've received the report and that a
  77. fix is forthcoming. We'll give a rough timeline and ask the reporter
  78. to keep the issue confidential until we announce it.
  79. * Halt all other development as long as is needed to develop a fix,
  80. including patches against the current and two previous releases.
  81. * Determine a go-public date for announcing the vulnerability and the fix.
  82. To try to mitigate a possible "arms race" between those applying the
  83. patch and those trying to exploit the hole, we will not announce
  84. security problems immediately.
  85. * Pre-notify everyone we know to be running the affected version(s) of
  86. Django. We will send these notifications through private e-mail
  87. which will include documentation of the vulnerability, links to the
  88. relevant patch(es), and a request to keep the vulnerability
  89. confidential until the official go-public date.
  90. * Publicly announce the vulnerability and the fix on the pre-determined
  91. go-public date. This will probably mean a new release of Django, but
  92. in some cases it may simply be patches against current releases.
  93. Submitting patches
  94. ==================
  95. We're always grateful for patches to Django's code. Indeed, bug reports
  96. with associated patches will get fixed *far* more quickly than those
  97. without patches.
  98. "Claiming" tickets
  99. ------------------
  100. In an open-source project with hundreds of contributors around the world, it's
  101. important to manage communication efficiently so that work doesn't get
  102. duplicated and contributors can be as effective as possible. Hence, our policy
  103. is for contributors to "claim" tickets in order to let other developers know
  104. that a particular bug or feature is being worked on.
  105. If you have identified a contribution you want to make and you're capable of
  106. fixing it (as measured by your coding ability, knowledge of Django internals
  107. and time availability), claim it by following these steps:
  108. * `Create an account`_ to use in our ticket system.
  109. * If a ticket for this issue doesn't exist yet, create one in our
  110. `ticket tracker`_.
  111. * If a ticket for this issue already exists, make sure nobody else has
  112. claimed it. To do this, look at the "Assigned to" section of the ticket.
  113. If it's assigned to "nobody," then it's available to be claimed.
  114. Otherwise, somebody else is working on this ticket, and you either find
  115. another bug/feature to work on, or contact the developer working on the
  116. ticket to offer your help.
  117. * Log into your account, if you haven't already, by clicking "Login" in the
  118. upper right of the ticket page.
  119. * Claim the ticket by clicking the radio button next to "Accept ticket"
  120. near the bottom of the page, then clicking "Submit changes."
  121. If you have an account but have forgotten your password, you can reset it
  122. using the `password reset page`_.
  123. .. _Create an account: http://www.djangoproject.com/accounts/register/
  124. .. _password reset page: http://www.djangoproject.com/accounts/password/reset/
  125. Ticket claimers' responsibility
  126. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  127. Once you've claimed a ticket, you have a responsibility to work on that ticket
  128. in a reasonably timely fashion. If you don't have time to work on it, either
  129. unclaim it or don't claim it in the first place!
  130. If there's no sign of progress on a particular claimed ticket for a week or
  131. two, another developer may ask you to relinquish the ticket claim so that it's
  132. no longer monopolized and somebody else can claim it.
  133. If you've claimed a ticket and it's taking a long time (days or weeks) to code,
  134. keep everybody updated by posting comments on the ticket. If you don't provide
  135. regular updates, and you don't respond to a request for a progress report,
  136. your claim on the ticket may be revoked. As always, more communication is
  137. better than less communication!
  138. Which tickets should be claimed?
  139. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  140. Of course, going through the steps of claiming tickets is overkill in some
  141. cases. In the case of small changes, such as typos in the documentation or
  142. small bugs that will only take a few minutes to fix, you don't need to jump
  143. through the hoops of claiming tickets. Just submit your patch and be done with
  144. it.
  145. Patch style
  146. -----------
  147. * Make sure your code matches our `coding style`_.
  148. * Submit patches in the format returned by the ``svn diff`` command.
  149. An exception is for code changes that are described more clearly in
  150. plain English than in code. Indentation is the most common example; it's
  151. hard to read patches when the only difference in code is that it's
  152. indented.
  153. Patches in ``git diff`` format are also acceptable.
  154. * When creating patches, always run ``svn diff`` from the top-level
  155. ``trunk`` directory -- i.e., the one that contains ``django``, ``docs``,
  156. ``tests``, ``AUTHORS``, etc. This makes it easy for other people to
  157. apply your patches.
  158. * Attach patches to a ticket in the `ticket tracker`_, using the "attach
  159. file" button. Please *don't* put the patch in the ticket description
  160. or comment unless it's a single line patch.
  161. * Name the patch file with a ``.diff`` extension; this will let the ticket
  162. tracker apply correct syntax highlighting, which is quite helpful.
  163. * Check the "Has patch" box on the ticket details. This will make it
  164. obvious that the ticket includes a patch, and it will add the ticket to
  165. the `list of tickets with patches`_.
  166. * The code required to fix a problem or add a feature is an essential part
  167. of a patch, but it is not the only part. A good patch should also include
  168. a regression test to validate the behavior that has been fixed
  169. (and prevent the problem from arising again).
  170. * If the code associated with a patch adds a new feature, or modifies
  171. behavior of an existing feature, the patch should also contain
  172. documentation.
  173. Non-trivial patches
  174. -------------------
  175. A "non-trivial" patch is one that is more than a simple bug fix. It's a patch
  176. that introduces Django functionality and makes some sort of design decision.
  177. If you provide a non-trivial patch, include evidence that alternatives have
  178. been discussed on `django-developers`_. If you're not sure whether your patch
  179. should be considered non-trivial, just ask.
  180. Ticket triage
  181. =============
  182. Unfortunately, not all bug reports in the `ticket tracker`_ provide all
  183. the `required details`_. A number of tickets have patches, but those patches
  184. don't meet all the requirements of a `good patch`_.
  185. One way to help out is to *triage* bugs that have been reported by other
  186. users. The core team--as well as many community members--work on this
  187. regularly, but more help is always appreciated.
  188. Most of the workflow is based around the concept of a ticket's "triage stage".
  189. This stage describes where in its lifetime a given ticket is at any time.
  190. Along with a handful of flags, this field easily tells us what and who each
  191. ticket is waiting on.
  192. Since a picture is worth a thousand words, let's start there:
  193. .. image:: _images/djangotickets.png
  194. :height: 451
  195. :width: 590
  196. :alt: Django's ticket workflow
  197. We've got two roles in this diagram:
  198. * Core developers: people with commit access who are responsible for
  199. making the big decisions, writing large portions of the code and
  200. integrating the contributions of the community.
  201. * Ticket triagers: anyone in the Django community who chooses to
  202. become involved in Django's development process. Our Trac installation
  203. is :ref:`intentionally left open to the public
  204. <the-spirit-of-contributing>`, and anyone can triage tickets.
  205. Django is a community project, and we encourage `triage by the
  206. community`_.
  207. Second, note the five triage stages:
  208. 1. A ticket starts as "Unreviewed", meaning that nobody has examined
  209. the ticket.
  210. 2. "Design decision needed" means "this concept requires a design
  211. decision," which should be discussed either in the ticket comments or on
  212. `django-developers`_. The "Design decision needed" step will generally
  213. only be used for feature requests. It can also be used for issues
  214. that *might* be bugs, depending on opinion or interpretation. Obvious
  215. bugs (such as crashes, incorrect query results, or non-compliance with a
  216. standard) skip this step and move straight to "Accepted".
  217. 3. Once a ticket is ruled to be approved for fixing, it's moved into the
  218. "Accepted" stage. This stage is where all the real work gets done.
  219. 4. In some cases, a ticket might get moved to the "Someday/Maybe" state.
  220. This means the ticket is an enhancement request that we might consider
  221. adding to the framework if an excellent patch is submitted. These
  222. tickets are not a high priority.
  223. 5. If a ticket has an associated patch (see below), it will be reviewed
  224. by the community. If the patch is complete, it'll be marked as "ready
  225. for checkin" so that a core developer knows to review and commit the
  226. patch.
  227. The second part of this workflow involves a set of flags the describe what the
  228. ticket has or needs in order to be "ready for checkin":
  229. "Has patch"
  230. This means the ticket has an associated patch_. These will be
  231. reviewed to see if the patch is "good".
  232. "Needs documentation"
  233. This flag is used for tickets with patches that need associated
  234. documentation. Complete documentation of features is a prerequisite
  235. before we can check them into the codebase.
  236. "Needs tests"
  237. This flags the patch as needing associated unit tests. Again, this is a
  238. required part of a valid patch.
  239. "Patch needs improvement"
  240. This flag means that although the ticket *has* a patch, it's not quite
  241. ready for checkin. This could mean the patch no longer applies
  242. cleanly, there is a flaw in the implementation, or that the code
  243. doesn't meet our standards.
  244. A ticket can be resolved in a number of ways:
  245. "fixed"
  246. Used by the core developers once a patch has been rolled into
  247. Django and the issue is fixed.
  248. "invalid"
  249. Used if the ticket is found to be incorrect. This means that the
  250. issue in the ticket is actually the result of a user error, or
  251. describes a problem with something other than Django, or isn't
  252. a bug report or feature request at all (for example, some new users
  253. submit support queries as tickets).
  254. "wontfix"
  255. Used when a core developer decides that this request is not
  256. appropriate for consideration in Django. This is usually chosen after
  257. discussion in the ``django-developers`` mailing list. Feel free to
  258. start or join in discussions of "wontfix" tickets on the mailing list,
  259. but please do not reopen tickets closed as "wontfix" by core
  260. developers.
  261. "duplicate"
  262. Used when another ticket covers the same issue. By closing duplicate
  263. tickets, we keep all the discussion in one place, which helps everyone.
  264. "worksforme"
  265. Used when the ticket doesn't contain enough detail to replicate
  266. the original bug.
  267. If you believe that the ticket was closed in error -- because you're
  268. still having the issue, or it's popped up somewhere else, or the triagers have
  269. made a mistake -- please reopen the ticket and provide further information.
  270. Please do not reopen tickets that have been marked as "wontfix" by core
  271. developers.
  272. .. _required details: `Reporting bugs`_
  273. .. _good patch: `Patch style`_
  274. .. _triage by the community: `Triage by the general community`_
  275. .. _patch: `Submitting patches`_
  276. Triage by the general community
  277. -------------------------------
  278. Although the core developers make the big decisions in the ticket triage
  279. process, there's a lot that general community members can do to help the
  280. triage process. In particular, you can help out by:
  281. * Closing "Unreviewed" tickets as "invalid", "worksforme" or "duplicate."
  282. * Promoting "Unreviewed" tickets to "Design decision needed" if a design
  283. decision needs to be made, or "Accepted" in case of obvious bugs.
  284. * Correcting the "Needs tests", "Needs documentation", or "Has patch"
  285. flags for tickets where they are incorrectly set.
  286. * Adding the `easy-pickings`_ keyword to tickets that are small and
  287. relatively straightforward.
  288. * Checking that old tickets are still valid. If a ticket hasn't seen
  289. any activity in a long time, it's possible that the problem has been
  290. fixed but the ticket hasn't yet been closed.
  291. * Contacting the owners of tickets that have been claimed but have not
  292. seen any recent activity. If the owner doesn't respond after a week
  293. or so, remove the owner's claim on the ticket.
  294. * Identifying trends and themes in the tickets. If there a lot of bug
  295. reports about a particular part of Django, it may indicate we should
  296. consider refactoring that part of the code. If a trend is emerging,
  297. you should raise it for discussion (referencing the relevant tickets)
  298. on `django-developers`_.
  299. However, we do ask the following of all general community members working in
  300. the ticket database:
  301. * Please **don't** close tickets as "wontfix." The core developers will
  302. make the final determination of the fate of a ticket, usually after
  303. consultation with the community.
  304. * Please **don't** promote your own tickets to "Ready for checkin". You
  305. may mark other people's tickets which you've reviewed as "Ready for
  306. checkin", but you should get at minimum one other community member to
  307. review a patch that you submit.
  308. * Please **don't** reverse a decision that has been made by a core
  309. developer. If you disagree with a decision that has been made,
  310. please post a message to `django-developers`_.
  311. * If you're unsure if you should be making a change, don't make the change
  312. but instead leave a comment with your concerns on the ticket, or
  313. post a message to `django-developers`_. It's okay to be unsure, but
  314. your input is still valuable.
  315. .. _contributing-translations:
  316. Submitting and maintaining translations
  317. =======================================
  318. Various parts of Django, such as the admin site and validation error messages,
  319. are internationalized. This means they display different text depending on a
  320. user's language setting. For this, Django uses the same internationalization
  321. infrastructure available to Django applications described in the
  322. :doc:`i18n documentation</topics/i18n/index>`.
  323. These translations are contributed by Django users worldwide. If you find an
  324. incorrect translation or want to discuss specific translations, go to the
  325. `translation team`_ page for that language. If you would like to help out
  326. with translating or add a language that isn't yet translated, here's what
  327. to do:
  328. * Join the `Django i18n mailing list`_ and introduce yourself.
  329. * Make sure you read the notes about :ref:`specialties-of-django-i18n`.
  330. * Signup at `Transifex`_ and visit the `Django project page`_.
  331. * On the "`Translation Teams`_" page, choose the language team you want
  332. to work with, **or** -- in case the language team doesn't exist yet --
  333. request a new team by clicking on the "Request a new team" button
  334. and select the appropriate language.
  335. * Then, click the "Join this Team" button to become a member of this team.
  336. Every team has at least one coordinator who is responsible to review
  337. your membership request. You can of course also contact the team
  338. coordinator to clarify procedual problems and handle the actual
  339. translation process.
  340. * Once you are a member of a team choose the translation resource you
  341. want update on the team page. For example the "core" resource refers
  342. to the translation catalogue that contains all non-app translations.
  343. Each of the contrib apps also have a resource (prefixed with "contrib-").
  344. .. note::
  345. For more information about how to use Transifex, see the
  346. `Transifex Help`_
  347. * Optionally, review and update the ``conf/locale/<locale>/formats.py``
  348. file to describe the date, time and numbers formatting particularities
  349. of your locale. These files aren't covered by the use of Transifex and
  350. require a patch against the Django source tree, just as a code change
  351. would:
  352. * Create a diff against the current Subversion trunk.
  353. * Open a ticket in Django's ticket system, set its ``Component`` field
  354. to ``Translations``, and attach the patch to it. See
  355. :ref:`format-localization` for details.
  356. .. _Django i18n mailing list: http://groups.google.com/group/django-i18n/
  357. .. _Transifex: http://www.transifex.net/
  358. .. _Django project page: http://www.transifex.net/projects/p/django/
  359. .. _translation teams: http://www.transifex.net/projects/p/django/teams/
  360. .. _translation team: http://www.transifex.net/projects/p/django/teams/
  361. .. _Transifex Help: http://help.transifex.net/
  362. Submitting javascript patches
  363. =============================
  364. .. versionadded:: 1.2
  365. Django's admin system leverages the jQuery framework to increase the
  366. capabilities of the admin interface. In conjunction, there is an emphasis on
  367. admin javascript performance and minimizing overall admin media file size.
  368. Serving compressed or "minified" versions of javascript files is considered
  369. best practice in this regard.
  370. To that end, patches for javascript files should include both the original
  371. code for future development (e.g. "foo.js"), and a compressed version for
  372. production use (e.g. "foo.min.js"). Any links to the file in the codebase
  373. should point to the compressed version.
  374. To simplify the process of providing optimized javascript code, Django
  375. includes a handy script which should be used to create a "minified" version.
  376. This script is located at ``/contrib/admin/media/js/compress.py``.
  377. Behind the scenes, ``compress.py`` is a front-end for Google's
  378. `Closure Compiler`_ which is written in Java. However, the Closure Compiler
  379. library is not bundled with Django directly, so those wishing to contribute
  380. complete javascript patches will need to download and install the library
  381. independently.
  382. The Closure Compiler library requires Java version 6 or higher (Java 1.6 or
  383. higher on Mac OS X). Note that Mac OS X 10.5 and earlier did not ship with Java
  384. 1.6 by default, so it may be necessary to upgrade your Java installation before
  385. the tool will be functional. Also note that even after upgrading Java, the
  386. default `/usr/bin/java` command may remain linked to the previous Java
  387. binary, so relinking that command may be necessary as well.
  388. Please don't forget to run ``compress.py`` and include the ``diff`` of the
  389. minified scripts when submitting patches for Django's javascript.
  390. .. _Closure Compiler: http://code.google.com/closure/compiler/
  391. Django conventions
  392. ==================
  393. Various Django-specific code issues are detailed in this section.
  394. Use of ``django.conf.settings``
  395. -------------------------------
  396. Modules should not in general use settings stored in ``django.conf.settings``
  397. at the top level (i.e. evaluated when the module is imported). The explanation
  398. for this is as follows:
  399. Manual configuration of settings (i.e. not relying on the
  400. ``DJANGO_SETTINGS_MODULE`` environment variable) is allowed and possible as
  401. follows::
  402. from django.conf import settings
  403. settings.configure({}, SOME_SETTING='foo')
  404. However, if any setting is accessed before the ``settings.configure`` line,
  405. this will not work. (Internally, ``settings`` is a ``LazyObject`` which
  406. configures itself automatically when the settings are accessed if it has not
  407. already been configured).
  408. So, if there is a module containing some code as follows::
  409. from django.conf import settings
  410. from django.core.urlresolvers import get_callable
  411. default_foo_view = get_callable(settings.FOO_VIEW)
  412. ...then importing this module will cause the settings object to be configured.
  413. That means that the ability for third parties to import the module at the top
  414. level is incompatible with the ability to configure the settings object
  415. manually, or makes it very difficult in some circumstances.
  416. Instead of the above code, a level of laziness or indirection must be used,
  417. such as `django.utils.functional.LazyObject``, ``django.utils.functional.lazy``
  418. or ``lambda``.
  419. Coding style
  420. ============
  421. Please follow these coding standards when writing code for inclusion in Django:
  422. * Unless otherwise specified, follow :pep:`8`.
  423. You could use a tool like `pep8.py`_ to check for some problems in this
  424. area, but remember that PEP 8 is only a guide, so respect the style of
  425. the surrounding code as a primary goal.
  426. * Use four spaces for indentation.
  427. * Use underscores, not camelCase, for variable, function and method names
  428. (i.e. ``poll.get_unique_voters()``, not ``poll.getUniqueVoters``).
  429. * Use ``InitialCaps`` for class names (or for factory functions that
  430. return classes).
  431. * Mark all strings for internationalization; see the :doc:`i18n
  432. documentation </topics/i18n/index>` for details.
  433. * In docstrings, use "action words" such as::
  434. def foo():
  435. """
  436. Calculates something and returns the result.
  437. """
  438. pass
  439. Here's an example of what not to do::
  440. def foo():
  441. """
  442. Calculate something and return the result.
  443. """
  444. pass
  445. * Please don't put your name in the code you contribute. Our policy is to
  446. keep contributors' names in the ``AUTHORS`` file distributed with Django
  447. -- not scattered throughout the codebase itself. Feel free to include a
  448. change to the ``AUTHORS`` file in your patch if you make more than a
  449. single trivial change.
  450. Template style
  451. --------------
  452. * In Django template code, put one (and only one) space between the curly
  453. brackets and the tag contents.
  454. Do this:
  455. .. code-block:: html+django
  456. {{ foo }}
  457. Don't do this:
  458. .. code-block:: html+django
  459. {{foo}}
  460. View style
  461. ----------
  462. * In Django views, the first parameter in a view function should be called
  463. ``request``.
  464. Do this::
  465. def my_view(request, foo):
  466. # ...
  467. Don't do this::
  468. def my_view(req, foo):
  469. # ...
  470. Model style
  471. -----------
  472. * Field names should be all lowercase, using underscores instead of
  473. camelCase.
  474. Do this::
  475. class Person(models.Model):
  476. first_name = models.CharField(max_length=20)
  477. last_name = models.CharField(max_length=40)
  478. Don't do this::
  479. class Person(models.Model):
  480. FirstName = models.CharField(max_length=20)
  481. Last_Name = models.CharField(max_length=40)
  482. * The ``class Meta`` should appear *after* the fields are defined, with
  483. a single blank line separating the fields and the class definition.
  484. Do this::
  485. class Person(models.Model):
  486. first_name = models.CharField(max_length=20)
  487. last_name = models.CharField(max_length=40)
  488. class Meta:
  489. verbose_name_plural = 'people'
  490. Don't do this::
  491. class Person(models.Model):
  492. first_name = models.CharField(max_length=20)
  493. last_name = models.CharField(max_length=40)
  494. class Meta:
  495. verbose_name_plural = 'people'
  496. Don't do this, either::
  497. class Person(models.Model):
  498. class Meta:
  499. verbose_name_plural = 'people'
  500. first_name = models.CharField(max_length=20)
  501. last_name = models.CharField(max_length=40)
  502. * The order of model inner classes and standard methods should be as
  503. follows (noting that these are not all required):
  504. * All database fields
  505. * Custom manager attributes
  506. * ``class Meta``
  507. * ``def __unicode__()``
  508. * ``def __str__()``
  509. * ``def save()``
  510. * ``def get_absolute_url()``
  511. * Any custom methods
  512. * If ``choices`` is defined for a given model field, define the choices as
  513. a tuple of tuples, with an all-uppercase name, either near the top of the
  514. model module or just above the model class. Example::
  515. GENDER_CHOICES = (
  516. ('M', 'Male'),
  517. ('F', 'Female'),
  518. )
  519. Documentation style
  520. ===================
  521. We place a high importance on consistency and readability of documentation.
  522. (After all, Django was created in a journalism environment!)
  523. How to document new features
  524. ----------------------------
  525. We treat our documentation like we treat our code: we aim to improve it as
  526. often as possible. This section explains how writers can craft their
  527. documentation changes in the most useful and least error-prone ways.
  528. Documentation changes come in two forms:
  529. * General improvements -- Typo corrections, error fixes and better
  530. explanations through clearer writing and more examples.
  531. * New features -- Documentation of features that have been added to the
  532. framework since the last release.
  533. Our policy is:
  534. **All documentation of new features should be written in a way that clearly
  535. designates the features are only available in the Django development
  536. version. Assume documentation readers are using the latest release, not the
  537. development version.**
  538. Our preferred way for marking new features is by prefacing the features'
  539. documentation with: ".. versionadded:: X.Y", followed by an optional one line
  540. comment and a mandatory blank line.
  541. General improvements, or other changes to the APIs that should be emphasized
  542. should use the ".. versionchanged:: X.Y" directive (with the same format as the
  543. ``versionadded`` mentioned above.
  544. There's a full page of information about the :doc:`Django documentation
  545. system </internals/documentation>` that you should read prior to working on the
  546. documentation.
  547. Guidelines for reST files
  548. -------------------------
  549. These guidelines regulate the format of our reST documentation:
  550. * In section titles, capitalize only initial words and proper nouns.
  551. * Wrap the documentation at 80 characters wide, unless a code example
  552. is significantly less readable when split over two lines, or for another
  553. good reason.
  554. Commonly used terms
  555. -------------------
  556. Here are some style guidelines on commonly used terms throughout the
  557. documentation:
  558. * **Django** -- when referring to the framework, capitalize Django. It is
  559. lowercase only in Python code and in the djangoproject.com logo.
  560. * **e-mail** -- it has a hyphen.
  561. * **MySQL**
  562. * **PostgreSQL**
  563. * **Python** -- when referring to the language, capitalize Python.
  564. * **realize**, **customize**, **initialize**, etc. -- use the American
  565. "ize" suffix, not "ise."
  566. * **SQLite**
  567. * **subclass** -- it's a single word without a hyphen, both as a verb
  568. ("subclass that model") and as a noun ("create a subclass").
  569. * **Web**, **World Wide Web**, **the Web** -- note Web is always
  570. capitalized when referring to the World Wide Web.
  571. * **Web site** -- use two words, with Web capitalized.
  572. Django-specific terminology
  573. ---------------------------
  574. * **model** -- it's not capitalized.
  575. * **template** -- it's not capitalized.
  576. * **URLconf** -- use three capitalized letters, with no space before
  577. "conf."
  578. * **view** -- it's not capitalized.
  579. Committing code
  580. ===============
  581. Please follow these guidelines when committing code to Django's Subversion
  582. repository:
  583. * For any medium-to-big changes, where "medium-to-big" is according to your
  584. judgment, please bring things up on the `django-developers`_ mailing list
  585. before making the change.
  586. If you bring something up on `django-developers`_ and nobody responds,
  587. please don't take that to mean your idea is great and should be
  588. implemented immediately because nobody contested it. Django's lead
  589. developers don't have a lot of time to read mailing-list discussions
  590. immediately, so you may have to wait a couple of days before getting a
  591. response.
  592. * Write detailed commit messages in the past tense, not present tense.
  593. * Good: "Fixed Unicode bug in RSS API."
  594. * Bad: "Fixes Unicode bug in RSS API."
  595. * Bad: "Fixing Unicode bug in RSS API."
  596. * For commits to a branch, prefix the commit message with the branch name.
  597. For example: "magic-removal: Added support for mind reading."
  598. * Limit commits to the most granular change that makes sense. This means,
  599. use frequent small commits rather than infrequent large commits. For
  600. example, if implementing feature X requires a small change to library Y,
  601. first commit the change to library Y, then commit feature X in a separate
  602. commit. This goes a *long way* in helping all core Django developers
  603. follow your changes.
  604. * Separate bug fixes from feature changes.
  605. Bug fixes need to be added to the current bugfix branch (e.g. the
  606. ``1.0.X`` branch) as well as the current trunk.
  607. * If your commit closes a ticket in the Django `ticket tracker`_, begin
  608. your commit message with the text "Fixed #abc", where "abc" is the number
  609. of the ticket your commit fixes. Example: "Fixed #123 -- Added support
  610. for foo". We've rigged Subversion and Trac so that any commit message
  611. in that format will automatically close the referenced ticket and post a
  612. comment to it with the full commit message.
  613. If your commit closes a ticket and is in a branch, use the branch name
  614. first, then the "Fixed #abc." For example:
  615. "magic-removal: Fixed #123 -- Added whizbang feature."
  616. For the curious: We're using a `Trac post-commit hook`_ for this.
  617. .. _Trac post-commit hook: http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook
  618. * If your commit references a ticket in the Django `ticket tracker`_ but
  619. does *not* close the ticket, include the phrase "Refs #abc", where "abc"
  620. is the number of the ticket your commit references. We've rigged
  621. Subversion and Trac so that any commit message in that format will
  622. automatically post a comment to the appropriate ticket.
  623. Reverting commits
  624. -----------------
  625. Nobody's perfect; mistakes will be committed. When a mistaken commit is
  626. discovered, please follow these guidelines:
  627. * Try very hard to ensure that mistakes don't happen. Just because we
  628. have a reversion policy doesn't relax your responsibility to aim for
  629. the highest quality possible. Really: double-check your work before
  630. you commit it in the first place!
  631. * If possible, have the original author revert his/her own commit.
  632. * Don't revert another author's changes without permission from the
  633. original author.
  634. * If the original author can't be reached (within a reasonable amount
  635. of time -- a day or so) and the problem is severe -- crashing bug,
  636. major test failures, etc -- then ask for objections on django-dev
  637. then revert if there are none.
  638. * If the problem is small (a feature commit after feature freeze,
  639. say), wait it out.
  640. * If there's a disagreement between the committer and the
  641. reverter-to-be then try to work it out on the `django-developers`_
  642. mailing list. If an agreement can't be reached then it should
  643. be put to a vote.
  644. * If the commit introduced a confirmed, disclosed security
  645. vulnerability then the commit may be reverted immediately without
  646. permission from anyone.
  647. * The release branch maintainer may back out commits to the release
  648. branch without permission if the commit breaks the release branch.
  649. .. _unit-tests:
  650. Unit tests
  651. ==========
  652. Django comes with a test suite of its own, in the ``tests`` directory of the
  653. Django tarball. It's our policy to make sure all tests pass at all times.
  654. The tests cover:
  655. * Models and the database API (``tests/modeltests/``).
  656. * Everything else in core Django code (``tests/regressiontests``)
  657. * Contrib apps (``django/contrib/<contribapp>/tests``, see below)
  658. We appreciate any and all contributions to the test suite!
  659. The Django tests all use the testing infrastructure that ships with Django for
  660. testing applications. See :doc:`Testing Django applications </topics/testing>`
  661. for an explanation of how to write new tests.
  662. .. _running-unit-tests:
  663. Running the unit tests
  664. ----------------------
  665. Quickstart
  666. ~~~~~~~~~~
  667. Running the tests requires a Django settings module that defines the
  668. databases to use. To make it easy to get started. Django provides a
  669. sample settings module that uses the SQLite database. To run the tests
  670. with this sample ``settings`` module, ``cd`` into the Django
  671. ``tests/`` directory and run:
  672. .. code-block:: bash
  673. ./runtests.py --settings=test_sqlite
  674. If you get an ``ImportError: No module named django.contrib`` error,
  675. you need to add your install of Django to your ``PYTHONPATH``. For
  676. more details on how to do this, read `Pointing Python at the new
  677. Django version`_ below.
  678. Using another ``settings`` module
  679. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  680. The included settings module allows you to run the test suite using
  681. SQLite. If you want to test behavior using a different database (and
  682. if you're proposing patches for Django, it's a good idea to test
  683. across databases), you may need to define your own settings file.
  684. To run the tests with different settings, ``cd`` to the ``tests/`` directory
  685. and type:
  686. .. code-block:: bash
  687. ./runtests.py --settings=path.to.django.settings
  688. The :setting:`DATABASES` setting in this test settings module needs to define
  689. two databases:
  690. * A ``default`` database. This database should use the backend that
  691. you want to use for primary testing
  692. * A database with the alias ``other``. The ``other`` database is
  693. used to establish that queries can be directed to different
  694. databases. As a result, this database can use any backend you
  695. want. It doesn't need to use the same backend as the ``default``
  696. database (although it can use the same backend if you want to).
  697. If you're using a backend that isn't SQLite, you will need to provide other
  698. details for each database:
  699. * The :setting:`USER` option for each of your databases needs to
  700. specify an existing user account for the database.
  701. * The :setting:`PASSWORD` option needs to provide the password for
  702. the :setting:`USER` that has been specified.
  703. * The :setting:`NAME` option must be the name of an existing database to
  704. which the given user has permission to connect. The unit tests will not
  705. touch this database; the test runner creates a new database whose name is
  706. :setting:`NAME` prefixed with ``test_``, and this test database is
  707. deleted when the tests are finished. This means your user account needs
  708. permission to execute ``CREATE DATABASE``.
  709. You will also need to ensure that your database uses UTF-8 as the default
  710. character set. If your database server doesn't use UTF-8 as a default charset,
  711. you will need to include a value for ``TEST_CHARSET`` in the settings
  712. dictionary for the applicable database.
  713. Running only some of the tests
  714. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  715. Django's entire test suite takes a few minutes to run. To run a subset of the
  716. unit tests, append the names of the test modules to the ``runtests.py``
  717. command line.
  718. As an example, if you'd like to only run tests for generic relations and
  719. internationalization, type:
  720. .. code-block:: bash
  721. ./runtests.py --settings=path.to.settings generic_relations i18n
  722. See the list of directories in ``tests/modeltests`` and
  723. ``tests/regressiontests`` for module names.
  724. If you just want to run a particular class of tests, you can specify a list of
  725. paths to individual test classes. For example, to run the ``TranslationTests``
  726. of the ``i18n`` module, type:
  727. .. code-block:: bash
  728. ./runtests.py --settings=path.to.settings i18n.TranslationTests
  729. You can specify an individual test like this:
  730. .. code-block:: bash
  731. ./runtests.py --settings=path.to.settings i18n.TranslationTests.test_lazy_objects
  732. Running all the tests
  733. ~~~~~~~~~~~~~~~~~~~~~
  734. If you want to run the full suite of tests, you'll need to install a number of
  735. dependencies:
  736. * PyYAML_
  737. * Markdown_
  738. * Textile_
  739. * Docutils_
  740. * setuptools_
  741. * memcached_, plus a :ref:`supported Python binding <memcached>`
  742. * gettext_ (:ref:`gettext_on_windows`)
  743. If you want to test the memcached cache backend, you will also need to define
  744. a :setting:`CACHES` setting that points at your memcached instance.
  745. Each of these dependencies is optional. If you're missing any of them, the
  746. associated tests will be skipped.
  747. .. _PyYAML: http://pyyaml.org/wiki/PyYAML
  748. .. _Markdown: http://pypi.python.org/pypi/Markdown/1.7
  749. .. _Textile: http://pypi.python.org/pypi/textile
  750. .. _docutils: http://pypi.python.org/pypi/docutils/0.4
  751. .. _setuptools: http://pypi.python.org/pypi/setuptools/
  752. .. _memcached: http://www.danga.com/memcached/
  753. .. _gettext: http://www.gnu.org/software/gettext/manual/gettext.html
  754. Contrib apps
  755. ------------
  756. Tests for apps in ``django/contrib/`` go in their respective directories under
  757. ``django/contrib/``, in a ``tests.py`` file. (You can split the tests over
  758. multiple modules by using a ``tests`` directory in the normal Python way.)
  759. For the tests to be found, a ``models.py`` file must exist (it doesn't
  760. have to have anything in it). If you have URLs that need to be
  761. mapped, put them in ``tests/urls.py``.
  762. To run tests for just one contrib app (e.g. ``markup``), use the same
  763. method as above::
  764. ./runtests.py --settings=settings markup
  765. Requesting features
  766. ===================
  767. We're always trying to make Django better, and your feature requests are a key
  768. part of that. Here are some tips on how to most effectively make a request:
  769. * Request the feature on `django-developers`_, not in the ticket tracker;
  770. it'll get read more closely if it's on the mailing list.
  771. * Describe clearly and concisely what the missing feature is and how you'd
  772. like to see it implemented. Include example code (non-functional is OK)
  773. if possible.
  774. * Explain *why* you'd like the feature. In some cases this is obvious, but
  775. since Django is designed to help real developers get real work done,
  776. you'll need to explain it, if it isn't obvious why the feature would be
  777. useful.
  778. As with most open-source projects, code talks. If you are willing to write the
  779. code for the feature yourself or if (even better) you've already written it,
  780. it's much more likely to be accepted. If it's a large feature that might need
  781. multiple developers we're always happy to give you an experimental branch in
  782. our repository; see below.
  783. Branch policy
  784. =============
  785. In general, the trunk must be kept stable. People should be able to run
  786. production sites against the trunk at any time. Additionally, commits to trunk
  787. ought to be as atomic as possible -- smaller changes are better. Thus, large
  788. feature changes -- that is, changes too large to be encapsulated in a single
  789. patch, or changes that need multiple eyes on them -- must happen on dedicated
  790. branches.
  791. This means that if you want to work on a large feature -- anything that would
  792. take more than a single patch, or requires large-scale refactoring -- you need
  793. to do it on a feature branch. Our development process recognizes two options
  794. for feature branches:
  795. 1. Feature branches using a distributed revision control system like
  796. Git_, Mercurial_, Bazaar_, etc.
  797. If you're familiar with one of these tools, this is probably your best
  798. option since it doesn't require any support or buy-in from the Django
  799. core developers.
  800. However, do keep in mind that Django will continue to use Subversion for
  801. the foreseeable future, and this will naturally limit the recognition of
  802. your branch. Further, if your branch becomes eligible for merging to
  803. trunk you'll need to find a core developer familiar with your DVCS of
  804. choice who'll actually perform the merge.
  805. If you do decided to start a distributed branch of Django and choose to
  806. make it public, please add the branch to the `Django branches`_ wiki
  807. page.
  808. 2. Feature branches using SVN have a higher bar. If you want a branch
  809. in SVN itself, you'll need a "mentor" among the :doc:`core committers
  810. </internals/committers>`. This person is responsible for actually
  811. creating the branch, monitoring your process (see below), and
  812. ultimately merging the branch into trunk.
  813. If you want a feature branch in SVN, you'll need to ask in
  814. `django-developers`_ for a mentor.
  815. .. _git: http://git-scm.com/
  816. .. _mercurial: http://mercurial.selenic.com/
  817. .. _bazaar: http://bazaar.canonical.com/
  818. .. _django branches: http://code.djangoproject.com/wiki/DjangoBranches
  819. Branch rules
  820. ------------
  821. We've got a few rules for branches born out of experience with what makes a
  822. successful Django branch.
  823. DVCS branches are obviously not under central control, so we have no way of
  824. enforcing these rules. However, if you're using a DVCS, following these rules
  825. will give you the best chance of having a successful branch (read: merged back
  826. to trunk).
  827. Developers with branches in SVN, however, **must** follow these rules. The
  828. branch mentor will keep on eye on the branch and **will delete it** if these
  829. rules are broken.
  830. * Only branch entire copies of the Django tree, even if work is only
  831. happening on part of that tree. This makes it painless to switch to a
  832. branch.
  833. * Merge changes from trunk no less than once a week, and preferably every
  834. couple-three days.
  835. In our experience, doing regular trunk merges is often the difference
  836. between a successful branch and one that fizzles and dies.
  837. If you're working on an SVN branch, you should be using `svnmerge.py`_
  838. to track merges from trunk.
  839. * Keep tests passing and documentation up-to-date. As with patches,
  840. we'll only merge a branch that comes with tests and documentation.
  841. .. _svnmerge.py: http://www.orcaware.com/svn/wiki/Svnmerge.py
  842. Once the branch is stable and ready to be merged into the trunk, alert
  843. `django-developers`_.
  844. After a branch has been merged, it should be considered "dead"; write access to
  845. it will be disabled, and old branches will be periodically "trimmed." To keep
  846. our SVN wrangling to a minimum, we won't be merging from a given branch into
  847. the trunk more than once.
  848. Using branches
  849. --------------
  850. To use a branch, you'll need to do two things:
  851. * Get the branch's code through Subversion.
  852. * Point your Python ``site-packages`` directory at the branch's version of
  853. the ``django`` package rather than the version you already have
  854. installed.
  855. Getting the code from Subversion
  856. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  857. To get the latest version of a branch's code, check it out using Subversion:
  858. .. code-block:: bash
  859. svn co http://code.djangoproject.com/svn/django/branches/<branch>/
  860. ...where ``<branch>`` is the branch's name. See the `list of branch names`_.
  861. Alternatively, you can automatically convert an existing directory of the
  862. Django source code as long as you've checked it out via Subversion. To do the
  863. conversion, execute this command from within your ``django`` directory:
  864. .. code-block:: bash
  865. svn switch http://code.djangoproject.com/svn/django/branches/<branch>/
  866. The advantage of using ``svn switch`` instead of ``svn co`` is that the
  867. ``switch`` command retains any changes you might have made to your local copy
  868. of the code. It attempts to merge those changes into the "switched" code. The
  869. disadvantage is that it may cause conflicts with your local changes if the
  870. "switched" code has altered the same lines of code.
  871. (Note that if you use ``svn switch``, you don't need to point Python at the new
  872. version, as explained in the next section.)
  873. .. _list of branch names: http://code.djangoproject.com/browser/django/branches
  874. Pointing Python at the new Django version
  875. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  876. Once you've retrieved the branch's code, you'll need to change your Python
  877. ``site-packages`` directory so that it points to the branch version of the
  878. ``django`` directory. (The ``site-packages`` directory is somewhere such as
  879. ``/usr/lib/python2.4/site-packages`` or
  880. ``/usr/local/lib/python2.4/site-packages`` or ``C:\Python\site-packages``.)
  881. The simplest way to do this is by renaming the old ``django`` directory to
  882. ``django.OLD`` and moving the trunk version of the code into the directory
  883. and calling it ``django``.
  884. Alternatively, you can use a symlink called ``django`` that points to the
  885. location of the branch's ``django`` package. If you want to switch back, just
  886. change the symlink to point to the old code.
  887. A third option is to use a `path file`_ (``<something>.pth``) which should
  888. work on all systems (including Windows, which doesn't have symlinks
  889. available). First, make sure there are no files, directories or symlinks named
  890. ``django`` in your ``site-packages`` directory. Then create a text file named
  891. ``django.pth`` and save it to your ``site-packages`` directory. That file
  892. should contain a path to your copy of Django on a single line and optional
  893. comments. Here is an example that points to multiple branches. Just uncomment
  894. the line for the branch you want to use ('Trunk' in this example) and make
  895. sure all other lines are commented::
  896. # Trunk is a svn checkout of:
  897. # http://code.djangoproject.com/svn/django/trunk/
  898. #
  899. /path/to/trunk
  900. # <branch> is a svn checkout of:
  901. # http://code.djangoproject.com/svn/django/branches/<branch>/
  902. #
  903. #/path/to/<branch>
  904. # On windows a path may look like this:
  905. # C:/path/to/<branch>
  906. If you're using Django 0.95 or earlier and installed it using
  907. ``python setup.py install``, you'll have a directory called something like
  908. ``Django-0.95-py2.4.egg`` instead of ``django``. In this case, edit the file
  909. ``setuptools.pth`` and remove the line that references the Django ``.egg``
  910. file. Then copy the branch's version of the ``django`` directory into
  911. ``site-packages``.
  912. .. _path file: http://docs.python.org/library/site.html
  913. How we make decisions
  914. =====================
  915. Whenever possible, we strive for a rough consensus. To that end, we'll often
  916. have informal votes on `django-developers`_ about a feature. In these votes we
  917. follow the voting style invented by Apache and used on Python itself, where
  918. votes are given as +1, +0, -0, or -1. Roughly translated, these votes mean:
  919. * +1: "I love the idea and I'm strongly committed to it."
  920. * +0: "Sounds OK to me."
  921. * -0: "I'm not thrilled, but I won't stand in the way."
  922. * -1: "I strongly disagree and would be very unhappy to see the idea turn
  923. into reality."
  924. Although these votes on django-developers are informal, they'll be taken very
  925. seriously. After a suitable voting period, if an obvious consensus arises
  926. we'll follow the votes.
  927. However, consensus is not always possible. If consensus cannot be reached, or
  928. if the discussion towards a consensus fizzles out without a concrete decision,
  929. we use a more formal process.
  930. Any core committer (see below) may call for a formal vote using the same
  931. voting mechanism above. A proposition will be considered carried by the core
  932. team if:
  933. * There are three "+1" votes from members of the core team.
  934. * There is no "-1" vote from any member of the core team.
  935. * The BDFLs haven't stepped in and executed their positive or negative
  936. veto.
  937. When calling for a vote, the caller should specify a deadline by which
  938. votes must be received. One week is generally suggested as the minimum
  939. amount of time.
  940. Since this process allows any core committer to veto a proposal, any "-1"
  941. votes (or BDFL vetos) should be accompanied by an explanation that explains
  942. what it would take to convert that "-1" into at least a "+0".
  943. Whenever possible, these formal votes should be announced and held in
  944. public on the `django-developers`_ mailing list. However, overly sensitive
  945. or contentious issues -- including, most notably, votes on new core
  946. committers -- may be held in private.
  947. Commit access
  948. =============
  949. Django has two types of committers:
  950. Core committers
  951. These are people who have a long history of contributions to Django's
  952. codebase, a solid track record of being polite and helpful on the
  953. mailing lists, and a proven desire to dedicate serious time to Django's
  954. development. The bar is high for full commit access.
  955. Partial committers
  956. These are people who are "domain experts." They have direct check-in access
  957. to the subsystems that fall under their jurisdiction, and they're given a
  958. formal vote in questions that involve their subsystems. This type of access
  959. is likely to be given to someone who contributes a large subframework to
  960. Django and wants to continue to maintain it.
  961. Partial commit access is granted by the same process as full
  962. committers. However, the bar is set lower; proven expertise in the area
  963. in question is likely to be sufficient.
  964. Decisions on new committers will follow the process explained above in `how
  965. we make decisions`_.
  966. To request commit access, please contact an existing committer privately.
  967. Public requests for commit access are potential flame-war starters, and
  968. will be ignored.
  969. .. _community page: http://www.djangoproject.com/community/
  970. .. _ticket tracker: http://code.djangoproject.com/newticket
  971. .. _django-developers: http://groups.google.com/group/django-developers
  972. .. _search the tracker: http://code.djangoproject.com/search
  973. .. _django-users: http://groups.google.com/group/django-users
  974. .. _`#django`: irc://irc.freenode.net/django
  975. .. _list of tickets with patches: http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&has_patch=1&order=priority
  976. .. _pep8.py: http://pypi.python.org/pypi/pep8/
  977. .. _i18n branch: http://code.djangoproject.com/browser/django/branches/i18n
  978. .. _`tags/releases`: http://code.djangoproject.com/browser/django/tags/releases
  979. .. _`easy-pickings`: http://code.djangoproject.com/query?status=new&status=assigned&status=reopened&keywords=~easy-pickings&order=priority