Django

Code

root/django/branches/gis/docs/faq.txt

Revision 8215, 32.5 kB (checked in by jbronn, 4 months ago)

gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.

  • Property svn:eol-style set to native
Line 
1 ==========
2 Django FAQ
3 ==========
4
5 General questions
6 =================
7
8 Why does this project exist?
9 ----------------------------
10
11 Django grew from a very practical need: World Online, a newspaper Web
12 operation, is responsible for building intensive Web applications on journalism
13 deadlines. In the fast-paced newsroom, World Online often has only a matter of
14 hours to take a complicated Web application from concept to public launch.
15
16 At the same time, the World Online Web developers have consistently been
17 perfectionists when it comes to following best practices of Web development.
18
19 In fall 2003, the World Online developers (Adrian Holovaty and Simon Willison)
20 ditched PHP and began using Python to develop its Web sites. As they built
21 intensive, richly interactive sites such as Lawrence.com, they began to extract
22 a generic Web development framework that let them build Web applications more
23 and more quickly. They tweaked this framework constantly, adding improvements
24 over two years.
25
26 In summer 2005, World Online decided to open-source the resulting software,
27 Django. Django would not be possible without a whole host of open-source
28 projects -- `Apache`_, `Python`_, and `PostgreSQL`_ to name a few -- and we're
29 thrilled to be able to give something back to the open-source community.
30
31 .. _Apache: http://httpd.apache.org/
32 .. _Python: http://www.python.org/
33 .. _PostgreSQL: http://www.postgresql.org/
34
35 What does "Django" mean, and how do you pronounce it?
36 -----------------------------------------------------
37
38 Django is named after `Django Reinhardt`_, a gypsy jazz guitarist from the 1930s
39 to early 1950s. To this day, he's considered one of the best guitarists of all time.
40
41 Listen to his music. You'll like it.
42
43 Django is pronounced **JANG**-oh. Rhymes with FANG-oh. The "D" is silent.
44
45 We've also recorded an `audio clip of the pronunciation`_.
46
47 .. _Django Reinhardt: http://en.wikipedia.org/wiki/Django_Reinhardt
48 .. _audio clip of the pronunciation: http://red-bean.com/~adrian/django_pronunciation.mp3
49
50 Is Django stable?
51 -----------------
52
53 Yes. World Online has been using Django for more than three years. Sites built
54 on Django have weathered traffic spikes of over one million hits an hour and a
55 number of Slashdottings. Yes, it's quite stable.
56
57 Does Django scale?
58 ------------------
59
60 Yes. Compared to development time, hardware is cheap, and so Django is
61 designed to take advantage of as much hardware as you can throw at it.
62
63 Django uses a "shared-nothing" architecture, which means you can add hardware
64 at any level -- database servers, caching servers or Web/application servers.
65
66 The framework cleanly separates components such as its database layer and
67 application layer. And it ships with a simple-yet-powerful `cache framework`_.
68
69 .. _`cache framework`: ../cache/
70
71 Who's behind this?
72 ------------------
73
74 Django was developed at `World Online`_, the Web department of a newspaper in
75 Lawrence, Kansas, USA.
76
77 `Adrian Holovaty`_
78     Adrian is a Web developer with a background in journalism. He was lead
79     developer at World Online for 2.5 years, during which time Django was
80     developed and implemented on World Online's sites. Now he works for
81     washingtonpost.com building rich, database-backed information sites, and
82     continues to oversee Django development. He likes playing guitar (Django
83     Reinhardt style) and hacking on side projects such as `chicagocrime.org`_.
84     He lives in Chicago.
85
86     On IRC, Adrian goes by ``adrian_h``.
87
88 `Jacob Kaplan-Moss`_
89     Jacob is a whipper-snapper from California who spends equal time coding and
90     cooking. He's lead developer at World Online and actively hacks on various
91     cool side projects. He's contributed to the Python-ObjC bindings and was
92     the first guy to figure out how to write Tivo apps in Python. Lately he's
93     been messing with Python on the PSP. He lives in Lawrence, Kansas.
94
95     On IRC, Jacob goes by ``jacobkm``.
96
97 `Simon Willison`_
98     Simon is a well-respected Web developer from England. He had a one-year
99     internship at World Online, during which time he and Adrian developed
100     Django from scratch. The most enthusiastic Brit you'll ever meet, he's
101     passionate about best practices in Web development and has maintained a
102     well-read Web-development blog for years at http://simon.incutio.com.
103     He works for Yahoo UK, where he managed to score the title "Hacker Liason."
104     He lives in London.
105
106     On IRC, Simon goes by ``SimonW``.
107
108 `Wilson Miner`_
109     Wilson's design-fu makes us all look like rock stars. By day, he's an
110     interactive designer for `Apple`_. Don't ask him what he's working on, or
111     he'll have to kill you. He lives in San Francisco.
112
113     On IRC, Wilson goes by ``wilsonian``.
114
115 .. _`World Online`: http://code.djangoproject.com/wiki/WorldOnline
116 .. _`Adrian Holovaty`: http://www.holovaty.com/
117 .. _`washingtonpost.com`: http://www.washingtonpost.com/
118 .. _`chicagocrime.org`: http://www.chicagocrime.org/
119 .. _`Simon Willison`: http://simon.incutio.com/
120 .. _`simon.incutio.com`: http://simon.incutio.com/
121 .. _`Jacob Kaplan-Moss`: http://www.jacobian.org/
122 .. _`Wilson Miner`: http://www.wilsonminer.com/
123 .. _`Apple`: http://www.apple.com/
124
125 Which sites use Django?
126 -----------------------
127
128 The Django wiki features a consistently growing `list of Django-powered sites`_.
129 Feel free to add your Django-powered site to the list.
130
131 .. _list of Django-powered sites: http://code.djangoproject.com/wiki/DjangoPoweredSites
132
133 Django appears to be a MVC framework, but you call the Controller the "view", and the View the "template". How come you don't use the standard names?
134 -----------------------------------------------------------------------------------------------------------------------------------------------------
135
136 Well, the standard names are debatable.
137
138 In our interpretation of MVC, the "view" describes the data that gets presented
139 to the user. It's not necessarily *how* the data *looks*, but *which* data is
140 presented. The view describes *which data you see*, not *how you see it.* It's
141 a subtle distinction.
142
143 So, in our case, a "view" is the Python callback function for a particular URL,
144 because that callback function describes which data is presented.
145
146 Furthermore, it's sensible to separate content from presentation -- which is
147 where templates come in. In Django, a "view" describes which data is presented,
148 but a view normally delegates to a template, which describes *how* the data is
149 presented.
150
151 Where does the "controller" fit in, then? In Django's case, it's probably the
152 framework itself: the machinery that sends a request to the appropriate view,
153 according to the Django URL configuration.
154
155 If you're hungry for acronyms, you might say that Django is a "MTV" framework
156 -- that is, "model", "template", and "view." That breakdown makes much more
157 sense.
158
159 At the end of the day, of course, it comes down to getting stuff done. And,
160 regardless of how things are named, Django gets stuff done in a way that's most
161 logical to us.
162
163 <Framework X> does <feature Y> -- why doesn't Django?
164 -----------------------------------------------------
165
166 We're well aware that there are other awesome Web frameworks out there, and
167 we're not averse to borrowing ideas where appropriate. However, Django was
168 developed precisely because we were unhappy with the status quo, so please be
169 aware that "because <Framework X> does it" is not going to be sufficient reason
170 to add a given feature to Django.
171
172 Why did you write all of Django from scratch, instead of using other Python libraries?
173 --------------------------------------------------------------------------------------
174
175 When Django was originally written a couple of years ago, Adrian and Simon
176 spent quite a bit of time exploring the various Python Web frameworks
177 available.
178
179 In our opinion, none of them were completely up to snuff.
180
181 We're picky. You might even call us perfectionists. (With deadlines.)
182
183 Over time, we stumbled across open-source libraries that did things we'd
184 already implemented. It was reassuring to see other people solving similar
185 problems in similar ways, but it was too late to integrate outside code: We'd
186 already written, tested and implemented our own framework bits in several
187 production settings -- and our own code met our needs delightfully.
188
189 In most cases, however, we found that existing frameworks/tools inevitably had
190 some sort of fundamental, fatal flaw that made us squeamish. No tool fit our
191 philosophies 100%.
192
193 Like we said: We're picky.
194
195 We've documented our philosophies on the `design philosophies page`_.
196
197 .. _design philosophies page: ../design_philosophies/
198
199 Do you have any of those nifty "screencast" things?
200 ---------------------------------------------------
201
202 You can bet your bottom they're on the way. But, since we're still hammering
203 out a few points, we want to make sure they reflect the final state of things
204 at Django 1.0, not some intermediary step. In other words, we don't want to
205 spend a lot of energy creating screencasts yet, because Django APIs will shift.
206
207 Is Django a content-management-system (CMS)?
208 --------------------------------------------
209
210 No, Django is not a CMS, or any sort of "turnkey product" in and of itself.
211 It's a Web framework; it's a programming tool that lets you build Web sites.
212
213 For example, it doesn't make much sense to compare Django to something like
214 Drupal_, because Django is something you use to *create* things like Drupal.
215
216 Of course, Django's automatic admin site is fantastic and timesaving -- but
217 the admin site is one module of Django the framework. Furthermore, although
218 Django has special conveniences for building "CMS-y" apps, that doesn't mean
219 it's not just as appropriate for building "non-CMS-y" apps (whatever that
220 means!).
221
222 .. _Drupal: http://drupal.org/
223
224 When will you release Django 1.0?
225 ---------------------------------
226
227 See our `version one roadmap`_ for the detailed timeline. We're aiming for
228 September 2, 2008.
229
230 .. _version one roadmap: http://code.djangoproject.com/wiki/VersionOneRoadmap
231
232 How can I download the Django documentation to read it offline?
233 ---------------------------------------------------------------
234
235 The Django docs are available in the ``docs`` directory of each Django tarball
236 release. These docs are in ReST (ReStructured Text) format, and each text file
237 corresponds to a Web page on the official Django site.
238
239 Because the documentation is `stored in revision control`_, you can browse
240 documentation changes just like you can browse code changes.
241
242 Technically, the docs on Django's site are generated from the latest development
243 versions of those ReST documents, so the docs on the Django site may offer more
244 information than the docs that come with the latest Django release.
245
246 .. _stored in revision control: http://code.djangoproject.com/browser/django/trunk/docs
247
248 Where can I find Django developers for hire?
249 --------------------------------------------
250
251 Consult our `developers for hire page`_ for a list of Django developers who
252 would be happy to help you.
253
254 You might also be interested in posting a job to http://djangogigs.com/ .
255 If you want to find Django-capable people in your local area, try
256 http://djangopeople.net/ .
257
258 .. _developers for hire page: http://code.djangoproject.com/wiki/DevelopersForHire
259
260 Installation questions
261 ======================
262
263 How do I get started?
264 ---------------------
265
266     #. `Download the code`_.
267     #. Install Django (read the `installation guide`_).
268     #. Walk through the tutorial_.
269     #. Check out the rest of the documentation_, and `ask questions`_ if you
270        run into trouble.
271
272 .. _`Download the code`: http://www.djangoproject.com/download/
273 .. _`installation guide`: ../install/
274 .. _tutorial:  ../tutorial01/
275 .. _documentation: ../
276 .. _ask questions: http://www.djangoproject.com/community/
277
278 How do I fix the "install a later version of setuptools" error?
279 ---------------------------------------------------------------
280
281 Just run the ``ez_setup.py`` script in the Django distribution.
282
283 What are Django's prerequisites?
284 --------------------------------
285
286 Django requires Python_ 2.3 or later. No other Python libraries are required
287 for basic Django usage.
288
289 For a development environment -- if you just want to experiment with Django --
290 you don't need to have a separate Web server installed; Django comes with its
291 own lightweight development server. For a production environment, we recommend
292 `Apache 2`_ and mod_python_, although Django follows the WSGI_ spec, which
293 means it can run on a variety of server platforms.
294
295 If you want to use Django with a database, which is probably the case, you'll
296 also need a database engine. PostgreSQL_ is recommended, because we're
297 PostgreSQL fans, and MySQL_, `SQLite 3`_, and Oracle_ are also supported.
298
299 .. _Python: http://www.python.org/
300 .. _Apache 2: http://httpd.apache.org/
301 .. _mod_python: http://www.modpython.org/
302 .. _WSGI: http://www.python.org/peps/pep-0333.html
303 .. _PostgreSQL: http://www.postgresql.org/
304 .. _MySQL: http://www.mysql.com/
305 .. _`SQLite 3`: http://www.sqlite.org/
306 .. _Oracle: http://www.oracle.com/
307
308 Do I lose anything by using Python 2.3 versus newer Python versions, such as Python 2.5?
309 ----------------------------------------------------------------------------------------
310
311 No. Django itself is guaranteed to work with any version of Python from 2.3
312 and higher.
313
314 If you use a Python version newer than 2.3, you will, of course, be able to
315 take advantage of newer Python features in your own code, along with the speed
316 improvements and other optimizations that have been made to the Python language
317 itself. But the Django framework itself should work equally well on 2.3 as it
318 does on 2.4 or 2.5.
319
320 Do I have to use mod_python?
321 ----------------------------
322
323 Although we recommend mod_python for production use, you don't have to use it,
324 thanks to the fact that Django uses an arrangement called WSGI_. Django can
325 talk to any WSGI-enabled server. Other non-mod_python deployment setups are
326 FastCGI, SCGI or AJP. See `How to use Django with FastCGI, SCGI or AJP`_ for
327 full information.
328
329 Also, see the `server arrangements wiki page`_ for other deployment strategies.
330
331 If you just want to play around and develop things on your local computer, use
332 the development Web server that comes with Django. Things should Just Work.
333
334 .. _WSGI: http://www.python.org/peps/pep-0333.html
335 .. _How to use Django with FastCGI, SCGI or AJP: ../fastcgi/
336 .. _server arrangements wiki page: http://code.djangoproject.com/wiki/ServerArrangements
337
338 How do I install mod_python on Windows?
339 ---------------------------------------
340
341     * For Python 2.4, grab mod_python from `win32 build of mod_python for
342       Python 2.4`_.
343     * For Python 2.4, check out this `Django on Windows howto`_.
344     * For Python 2.3, grab mod_python from http://www.modpython.org/ and read
345       `Running mod_python on Apache on Windows2000`_.
346     * Also, try this (not Windows-specific) `guide to getting mod_python
347       working`_.
348
349 .. _`win32 build of mod_python for Python 2.4`: http://www.lehuen.com/nicolas/index.php/2005/02/21/39-win32-build-of-mod_python-314-for-python-24
350 .. _`Django on Windows howto`: http://thinkhole.org/wp/django-on-windows/
351 .. _`Running mod_python on Apache on Windows2000`: http://groups-beta.google.com/group/comp.lang.python/msg/139af8c83a5a9d4f
352 .. _`guide to getting mod_python working`: http://www.dscpl.com.au/articles/modpython-001.html
353
354 Will Django run under shared hosting (like TextDrive or Dreamhost)?
355 -------------------------------------------------------------------
356
357 See our `Django-friendly Web hosts`_ page.
358
359 .. _`Django-friendly Web hosts`: http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts
360
361 Should I use the official version or development version?
362 ---------------------------------------------------------
363
364 The Django developers improve Django every day and are pretty good about not
365 checking in broken code. We use the development code (from the Subversion
366 repository) directly on our servers, so we consider it stable. With that in
367 mind, we recommend that you use the latest development code, because it
368 generally contains more features and fewer bugs than the "official" releases.
369
370 Using Django
371 ============
372
373 Why do I get an error about importing DJANGO_SETTINGS_MODULE?
374 -------------------------------------------------------------
375
376 Make sure that:
377
378     * The environment variable DJANGO_SETTINGS_MODULE is set to a fully-qualified
379       Python module (i.e. "mysite.settings").
380
381     * Said module is on ``sys.path`` (``import mysite.settings`` should work).
382
383     * The module doesn't contain syntax errors (of course).
384
385     * If you're using mod_python but *not* using Django's request handler,
386       you'll need to work around a mod_python bug related to the use of
387       ``SetEnv``; before you import anything from Django you'll need to do
388       the following::
389
390             os.environ.update(req.subprocess_env)
391
392       (where ``req`` is the mod_python request object).
393
394 I can't stand your template language. Do I have to use it?
395 ----------------------------------------------------------
396
397 We happen to think our template engine is the best thing since chunky bacon,
398 but we recognize that choosing a template language runs close to religion.
399 There's nothing about Django that requires using the template language, so
400 if you're attached to ZPT, Cheetah, or whatever, feel free to use those.
401
402 Do I have to use your model/database layer?
403 -------------------------------------------
404
405 Nope. Just like the template system, the model/database layer is decoupled from
406 the rest of the framework.
407
408 The one exception is: If you use a different database library, you won't get to
409 use Django's automatically-generated admin site. That app is coupled to the
410 Django database layer.
411
412 How do I use image and file fields?
413 -----------------------------------
414
415 Using a ``FileField`` or an ``ImageField`` in a model takes a few steps:
416
417     #. In your settings file, define ``MEDIA_ROOT`` as the full path to
418        a directory where you'd like Django to store uploaded files. (For
419        performance, these files are not stored in the database.) Define
420        ``MEDIA_URL`` as the base public URL of that directory. Make sure that
421        this directory is writable by the Web server's user account.
422
423     #. Add the ``FileField`` or ``ImageField`` to your model, making sure
424        to define the ``upload_to`` option to tell Django to which subdirectory
425        of ``MEDIA_ROOT`` it should upload files.
426
427     #. All that will be stored in your database is a path to the file
428        (relative to ``MEDIA_ROOT``). You'll most likely want to use the
429        convenience ``get_<fieldname>_url`` function provided by Django. For
430        example, if your ``ImageField`` is called ``mug_shot``, you can get the
431        absolute URL to your image in a template with
432        ``{{ object.get_mug_shot_url }}``.
433
434 Databases and models
435 ====================
436
437 How can I see the raw SQL queries Django is running?
438 ----------------------------------------------------
439
440 Make sure your Django ``DEBUG`` setting is set to ``True``. Then, just do
441 this::
442
443     >>> from django.db import connection
444     >>> connection.queries
445     [{'sql': 'SELECT polls_polls.id,polls_polls.question,polls_polls.pub_date FROM polls_polls',
446     'time': '0.002'}]
447
448 ``connection.queries`` is only available if ``DEBUG`` is ``True``. It's a list
449 of dictionaries in order of query execution. Each dictionary has the following::
450
451     ``sql`` -- The raw SQL statement
452     ``time`` -- How long the statement took to execute, in seconds.
453
454 ``connection.queries`` includes all SQL statements -- INSERTs, UPDATES,
455 SELECTs, etc. Each time your app hits the database, the query will be recorded.
456
457 Can I use Django with a pre-existing database?
458 ----------------------------------------------
459
460 Yes. See `Integrating with a legacy database`_.
461
462 .. _`Integrating with a legacy database`: ../legacy_databases/
463
464 If I make changes to a model, how do I update the database?
465 -----------------------------------------------------------
466
467 If you don't mind clearing data, your project's ``manage.py`` utility has an
468 option to reset the SQL for a particular application::
469
470     manage.py reset appname
471
472 This drops any tables associated with ``appname`` and recreates them.
473
474 If you do care about deleting data, you'll have to execute the ``ALTER TABLE``
475 statements manually in your database. That's the way we've always done it,
476 because dealing with data is a very sensitive operation that we've wanted to
477 avoid automating. That said, there's some work being done to add partially
478 automated database-upgrade functionality.
479
480 Do Django models support multiple-column primary keys?
481 ------------------------------------------------------
482
483 No. Only single-column primary keys are supported.
484
485 But this isn't an issue in practice, because there's nothing stopping you from
486 adding other constraints (using the ``unique_together`` model option or
487 creating the constraint directly in your database), and enforcing the
488 uniqueness at that level. Single-column primary keys are needed for things such
489 as the admin interface to work; e.g., you need a simple way of being able to
490 specify an object to edit or delete.
491
492 How do I add database-specific options to my CREATE TABLE statements, such as specifying MyISAM as the table type?
493 ------------------------------------------------------------------------------------------------------------------
494
495 We try to avoid adding special cases in the Django code to accommodate all the
496 database-specific options such as table type, etc. If you'd like to use any of
497 these options, create an `SQL initial data file`_ that contains ``ALTER TABLE``
498 statements that do what you want to do. The initial data files are executed in
499 your database after the ``CREATE TABLE`` statements.
500
501 For example, if you're using MySQL and want your tables to use the MyISAM table
502 type, create an initial data file and put something like this in it::
503
504     ALTER TABLE myapp_mytable ENGINE=MyISAM;
505
506 As explained in the `SQL initial data file`_ documentation, this SQL file can
507 contain arbitrary SQL, so you can make any sorts of changes you need to make.
508
509 .. _SQL initial data file: ../model-api/#providing-initial-sql-data
510
511 Why is Django leaking memory?
512 -----------------------------
513
514 Django isn't known to leak memory. If you find your Django processes are
515 allocating more and more memory, with no sign of releasing it, check to make
516 sure your ``DEBUG`` setting is set to ``True``. If ``DEBUG`` is ``True``, then
517 Django saves a copy of every SQL statement it has executed.
518
519 (The queries are saved in ``django.db.connection.queries``. See
520 `How can I see the raw SQL queries Django is running?`_.)
521
522 To fix the problem, set ``DEBUG`` to ``False``.
523
524 If you need to clear the query list manually at any point in your functions,
525 just call ``reset_queries()``, like this::
526
527     from django import db
528     db.reset_queries()
529
530 The admin site
531 ==============
532
533 I can't log in. When I enter a valid username and password, it just brings up the login page again, with no error messages.
534 ---------------------------------------------------------------------------------------------------------------------------
535
536 The login cookie isn't being set correctly, because the domain of the cookie
537 sent out by Django doesn't match the domain in your browser. Try these two
538 things:
539
540     * Set the ``SESSION_COOKIE_DOMAIN`` setting in your admin config file
541       to match your domain. For example, if you're going to
542       "http://www.mysite.com/admin/" in your browser, in
543       "myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = 'www.mysite.com'``.
544
545     * Some browsers (Firefox?) don't like to accept cookies from domains that
546       don't have dots in them. If you're running the admin site on "localhost"
547       or another domain that doesn't have a dot in it, try going to
548       "localhost.localdomain" or "127.0.0.1". And set
549       ``SESSION_COOKIE_DOMAIN`` accordingly.
550
551 I can't log in. When I enter a valid username and password, it brings up the login page again, with a "Please enter a correct username and password" error.
552 -----------------------------------------------------------------------------------------------------------------------------------------------------------
553
554 If you're sure your username and password are correct, make sure your user
555 account has ``is_active`` and ``is_staff`` set to True. The admin site only
556 allows access to users with those two fields both set to True.
557
558 How can I prevent the cache middleware from caching the admin site?
559 -------------------------------------------------------------------
560
561 Set the ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting to ``True``. See the
562 `cache documentation`_ for more information.
563
564 .. _cache documentation: ../cache/#the-per-site-cache
565
566 How do I automatically set a field's value to the user who last edited the object in the admin?
567 -----------------------------------------------------------------------------------------------
568
569 At this point, Django doesn't have an official way to do this. But it's an oft-requested
570 feature, so we're discussing how it can be implemented. The problem is we don't want to couple
571 the model layer with the admin layer with the request layer (to get the current user). It's a
572 tricky problem.
573
574 One person hacked up a `solution that doesn't require patching Django`_, but note that it's an
575 unofficial solution, and there's no guarantee it won't break at some point.
576
577 .. _solution that doesn't require patching Django: http://lukeplant.me.uk/blog.php?id=1107301634
578
579 How do I limit admin access so that objects can only be edited by the users who created them?
580 ---------------------------------------------------------------------------------------------
581
582 See the answer to the previous question.
583
584 My admin-site CSS and images showed up fine using the development server, but they're not displaying when using mod_python.
585 ---------------------------------------------------------------------------------------------------------------------------
586
587 See `serving the admin files`_ in the "How to use Django with mod_python"
588 documentation.
589
590 .. _serving the admin files: ../modpython/#serving-the-admin-files
591
592 My "list_filter" contains a ManyToManyField, but the filter doesn't display.
593 ----------------------------------------------------------------------------
594
595 Django won't bother displaying the filter for a ``ManyToManyField`` if there
596 are fewer than two related objects.
597
598 For example, if your ``list_filter`` includes ``sites``, and there's only one
599 site in your database, it won't display a "Site" filter. In that case,
600 filtering by site would be meaningless.
601
602 How can I customize the functionality of the admin interface?
603 -------------------------------------------------------------
604
605 You've got several options. If you want to piggyback on top of an add/change
606 form that Django automatically generates, you can attach arbitrary JavaScript
607 modules to the page via the model's ``class Admin`` ``js`` parameter. That
608 parameter is a list of URLs, as strings, pointing to JavaScript modules that
609 will be included within the admin form via a ``<script>`` tag.
610
611 If you want more flexibility than simply tweaking the auto-generated forms,
612 feel free to write custom views for the admin. The admin is powered by Django
613 itself, and you can write custom views that hook into the authentication
614 system, check permissions and do whatever else they need to do.
615
616 If you want to customize the look-and-feel of the admin interface, read the
617 next question.
618
619 The dynamically-generated admin site is ugly! How can I change it?
620 ------------------------------------------------------------------
621
622 We like it, but if you don't agree, you can modify the admin site's
623 presentation by editing the CSS stylesheet and/or associated image files. The
624 site is built using semantic HTML and plenty of CSS hooks, so any changes you'd
625 like to make should be possible by editing the stylesheet. We've got a
626 `guide to the CSS used in the admin`_ to get you started.
627
628 .. _`guide to the CSS used in the admin`: ../admin_css/
629
630 How do I create users without having to edit password hashes?
631 -------------------------------------------------------------
632
633 If you'd like to use the admin site to create users, upgrade to the Django
634 development version, where this problem was fixed on Aug. 4, 2006.
635
636 You can also use the Python API. See `creating users`_ for full info.
637
638 .. _creating users: ../authentication/#creating-users
639
640 Getting help
641 ============
642
643 How do I do X? Why doesn't Y work? Where can I go to get help?
644 --------------------------------------------------------------
645
646 If this FAQ doesn't contain an answer to your question, you might want to
647 try the `django-users mailing list`_. Feel free to ask any question related
648 to installing, using, or debugging Django.
649
650 If you prefer IRC, the `#django IRC channel`_ on the Freenode IRC network is an
651 active community of helpful individuals who may be able to solve your problem.
652
653 .. _`django-users mailing list`: http://groups.google.com/group/django-users
654 .. _`#django IRC channel`: irc://irc.freenode.net/django
655
656 Why hasn't my message appeared on django-users?
657 -----------------------------------------------
658
659 django-users_ has a lot of subscribers. This is good for the community, as
660 it means many people are available to contribute answers to questions.
661 Unfortunately, it also means that django-users_ is an attractive target for
662 spammers.
663
664 In order to combat the spam problem, when you join the django-users_ mailing
665 list, we manually moderate the first message you send to the list. This means
666 that spammers get caught, but it also means that your first question to the
667 list might take a little longer to get answered. We apologize for any
668 inconvenience that this policy may cause.
669
670 .. _django-users: http://groups.google.com/group/django-users
671
672 Nobody on django-users answered my question! What should I do?
673 --------------------------------------------------------------
674
675 Try making your question more specific, or provide a better example of your
676 problem.
677
678 As with most open-source mailing lists, the folks on django-users_ are
679 volunteers. If nobody has answered your question, it may be because nobody
680 knows the answer, it may be because nobody can understand the question, or it
681 may be that everybody that can help is busy. One thing you might try is to ask
682 the question on IRC -- visit the `#django IRC channel`_ on the Freenode IRC
683 network.
684
685 You might notice we have a second mailing list, called django-developers_ --
686 but please don't e-mail support questions to this mailing list. This list is
687 for discussion of the development of Django itself. Asking a tech support
688 question there is considered quite impolite.
689
690 .. _django-developers: http://groups.google.com/group/django-developers
691
692 I think I've found a bug! What should I do?
693 -------------------------------------------
694
695 Detailed instructions on how to handle a potential bug can be found in our
696 `Guide to contributing to Django`_.
697
698 .. _`Guide to contributing to Django`: ../contributing/#reporting-bugs
699
700 I think I've found a security problem! What should I do?
701 --------------------------------------------------------
702
703 If you think you've found a security problem with Django, please send a message
704 to security@djangoproject.com. This is a private list only open to long-time,
705 highly trusted Django developers, and its archives are not publicly readable.
706
707 Due to the sensitive nature of security issues, we ask that if you think you
708 have found a security problem, *please* don't send a message to one of the
709 public mailing lists. Django has a `policy for handling security issues`_;
710 while a defect is outstanding, we would like to minimize any damage that
711 could be inflicted through public knowledge of that defect.
712
713 .. _`policy for handling security issues`: ../contributing/#reporting-security-issues
714
715 Contributing code
716 =================
717
718 How can I get started contributing code to Django?
719 --------------------------------------------------
720
721 Thanks for asking! We've written an entire document devoted to this question.
722 It's titled `Contributing to Django`_.
723
724 .. _`Contributing to Django`: ../contributing/
725
726 I submitted a bug fix in the ticket system several weeks ago. Why are you ignoring my patch?
727 --------------------------------------------------------------------------------------------
728
729 Don't worry: We're not ignoring you!
730
731 It's important to understand there is a difference between "a ticket is being
732 ignored" and "a ticket has not been attended to yet." Django's ticket system
733 contains hundreds of open tickets, of various degrees of impact on end-user
734 functionality, and Django's developers have to review and prioritize.
735
736 On top of that: the people who work on Django are all volunteers. As a result,
737 the amount of time that we have to work on the framework is limited and will
738 vary from week to week depending on our spare time. If we're busy, we may not
739 be able to spend as much time on Django as we might want.
740
741 Besides, if your feature request stands no chance of inclusion in Django, we
742 won't ignore it -- we'll just close the ticket. So if your ticket is still
743 open, it doesn't mean we're ignoring you; it just means we haven't had time to
744 look at it yet.
Note: See TracBrowser for help on using the browser.