Changeset 2762
- Timestamp:
- 04/27/06 23:47:12 (2 years ago)
- Files:
-
- django/branches/magic-removal/docs/faq.txt (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/docs/faq.txt
r2524 r2762 9 9 ---------------------------- 10 10 11 Django grew from a very practical need: in our fast-paced newsroom, we often 12 have only a matter of hours to take a complicated Web application from 13 concept to public launch. Django was designed to not only allow us to 14 build Web applications quickly, but to allow us to build them right. 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 Thus, Django was designed not only to allow fast Web development, but 20 *best-practice* Web development. 15 21 16 22 Django would not be possible without a whole host of open-source projects -- 17 `Apache`_, `Python`_, and `PostgreSQL`_ to name a few -- and we're thrilled to be18 able to give something back to the open-source community.23 `Apache`_, `Python`_, and `PostgreSQL`_ to name a few -- and we're thrilled to 24 be able to give something back to the open-source community. 19 25 20 26 .. _Apache: http://httpd.apache.org/ … … 30 36 Listen to his music. You'll like it. 31 37 32 According to Wikipedia_, "Django is pronounced **zhane**-go (with a long 'a')." 38 Django is pronounced **JANG**-oh. Rhymes with FANG-oh. 33 39 34 40 .. _Django Reinhardt: http://en.wikipedia.org/wiki/Django_Reinhardt 35 .. _Wikipedia: http://en.wikipedia.org/wiki/Django_Reinhardt36 41 37 42 Is Django stable? 38 43 ----------------- 39 44 40 We've been using Django for almost two years. Sites built on Django have 41 weathered traffic spikes of over one million hits an hour, and at least42 one Slashdotting. Yes, it's quite stable.45 Yes. World Online has been using Django for more than two years. Sites built on 46 Django have weathered traffic spikes of over one million hits an hour and at 47 least one Slashdotting. Yes, it's quite stable. 43 48 44 49 Does Django scale? … … 47 52 Yes. Compared to development time, hardware is cheap, and so Django is 48 53 designed to take advantage of as much hardware as you can throw at it. 49 Django ships with clean separation of the database layer from the 50 application layer and a simple-yet-powerful `cache framework`_. 54 55 Django uses a "shared-nothing" architecture, which means you can add hardware 56 at any level -- database servers, caching servers or Web/application servers. 57 58 The framework cleanly separates components such as its database layer and 59 application layer. And it ships with a simple-yet-powerful `cache framework`_. 51 60 52 61 .. _`cache framework`: http://www.djangoproject.com/documentation/cache/ … … 61 70 Adrian is a Web developer with a background in journalism. He was lead 62 71 developer at World Online for 2.5 years, during which time Django was 63 developed and implemented on World Online's sites. Now he's editor of 64 editorial innovations at washingtonpost.com, and he continues to oversee 65 Django development. He likes playing guitar (Django Reinhardt style) and 66 hacking on side projects such as `chicagocrime.org`_. He lives in Chicago. 72 developed and implemented on World Online's sites. Now he works for 73 washingtonpost.com building rich, database-backed information sites, and 74 continues to oversee Django development. He likes playing guitar (Django 75 Reinhardt style) and hacking on side projects such as `chicagocrime.org`_. 76 He lives in Chicago. 67 77 68 78 On IRC, Adrian goes by ``adrian_h``. 79 80 `Jacob Kaplan-Moss`_ 81 Jacob is a whipper-snapper from California who spends equal time coding and 82 cooking. He's lead developer at World Online and actively hacks on various 83 cool side projects. He's contributed to the Python-ObjC bindings and was 84 the first guy to figure out how to write Tivo apps in Python. Lately he's 85 been messing with Python on the PSP. He lives in Lawrence, Kansas. 86 87 On IRC, Jacob goes by ``jacobkm``. 69 88 70 89 `Simon Willison`_ 71 90 Simon is a well-respected Web developer from England. He had a one-year 72 91 internship at World Online, during which time he and Adrian developed 73 Django from scratch. He's enthusiastic, he's passionate about best 74 practices in Web development, and he really likes squirrels. Probably to a 75 fault. He went back to university to finish his degree and is poised to 76 continue doing big, exciting things on the Web. He lives in England. 92 Django from scratch. The most enthusiastic Brit you'll ever meet, he's 93 passionate about best practices in Web development and has maintained a 94 well-read Web-development blog for years at http://simon.incutio.com. 95 He works for Yahoo UK, where he managed to score the title "Hacker Liason." 96 He lives in London. 77 97 78 98 On IRC, Simon goes by ``SimonW``. 79 80 `Jacob Kaplan-Moss`_81 Jacob is a whipper-snapper from California who spends equal time coding and82 cooking. He does Web development for World Online and actively hacks on83 various cool side projects. He's contributed to the Python-ObjC bindings and84 was the first guy to figure out how to write Tivo apps in Python. Lately85 he's been messing with Python on the PSP. He lives in Lawrence, Kansas.86 87 On IRC, Jacob goes by ``jacobkm``.88 99 89 100 `Wilson Miner`_ … … 107 118 ----------------------- 108 119 109 The Django wiki features a `list of Django-powered sites`_. Feel free to add110 your Django-powered site to the list.120 The Django wiki features a consistently growing `list of Django-powered sites`_. 121 Feel free to add your Django-powered site to the list. 111 122 112 123 .. _list of Django-powered sites: http://code.djangoproject.com/wiki/DjangoPoweredSites … … 115 126 ----------------------------------------------------------------------------------------------------------------------------------------------------- 116 127 117 That's because Django isn't strictly a MVC framework. We don't really believe in 118 any capital-M Methodologies; we do what "feels" right. If you squint the right 119 way, you can call Django's ORM the "Model", the view functions the "View", and 120 the dynamically-generated API the "Controller" -- but not really. 128 That's because Django isn't strictly a MVC framework. If you squint the right 129 way, you can call Django's database layer the "Model", the view functions the 130 "View", and the URL dispatcher the "Controller" -- but not really. 121 131 122 132 In fact, you might say that Django is a "MTV" framework -- that is, Model, … … 184 194 That translates into summer 2006. 185 195 196 The merging of Django's `magic-removal branch`_ went a long way toward Django 197 1.0. 198 186 199 Of course, you should note that `quite a few production sites`_ use Django in 187 200 its current status. Don't let the lack of a 1.0 turn you off. 188 201 202 .. _magic-removal branch: http://code.djangoproject.com/wiki/RemovingTheMagic 189 203 .. _quite a few production sites: http://code.djangoproject.com/wiki/DjangoPoweredSites 190 204 … … 226 240 --------------------------------------------------------------- 227 241 228 Just run the ``e x_setup.py`` script in the Django distribution.242 Just run the ``ez_setup.py`` script in the Django distribution. 229 243 230 244 What are Django's prerequisites? 231 245 -------------------------------- 232 246 233 Django requires Python_ 2.3 or later. 247 Django requires Python_ 2.3 or later. No other Python libraries are required. 234 248 235 249 For a development environment -- if you just want to experiment with Django -- … … 257 271 258 272 For production use, though, we recommend mod_python. The Django developers have 259 been running it on mod_python for abouttwo years, and it's quite stable.273 been running it on mod_python for more than two years, and it's quite stable. 260 274 261 275 However, if you don't want to use mod_python, you can use a different server, … … 325 339 There's nothing about Django that requires using the template language, so 326 340 if you're attached to ZPT, Cheetah, or whatever, feel free to use those. 341 342 Do I have to use your model/database layer? 343 ------------------------------------------- 344 345 Nope. Just like the template system, the model/database layer is decoupled from 346 the rest of the framework. The one exception is: If you use a different 347 database library, you won't get to use Django's automatically-generated admin 348 site. That app is coupled to the Django database layer. 327 349 328 350 How do I use image and file fields? … … 368 390 statements manually in your database. That's the way we've always done it, 369 391 because dealing with data is a very sensitive operation that we've wanted to 370 avoid automating. That said, there's some work being done to add a 371 ``django-admin.py updatedb`` command, which would output the necessary 372 ``ALTER TABLE`` statements, if any. 392 avoid automating. That said, there's some work being done to add partially 393 automated database-upgrade functionality. 373 394 374 395 Do Django models support multiple-column primary keys? … … 393 414 this:: 394 415 395 >>> from django. core.db import db396 >>> db.queries416 >>> from django.db import connection 417 >>> connection.queries 397 418 [{'sql': 'SELECT polls_polls.id,polls_polls.question,polls_polls.pub_date FROM polls_polls', 398 419 'time': '0.002'}] 399 420 400 `` db.queries`` is only available if ``DEBUG`` is ``True``. It's a list of401 dictionaries in order of query execution. Each dictionary has the following::421 ``connection.queries`` is only available if ``DEBUG`` is ``True``. It's a list 422 of dictionaries in order of query execution. Each dictionary has the following:: 402 423 403 424 ``sql`` -- The raw SQL statement 404 425 ``time`` -- How long the statement took to execute, in seconds. 405 426 406 `` db.queries`` includes all SQL statements -- INSERTs, UPDATES, SELECTs, etc.407 Each time your app hits the database, the query will be recorded.427 ``connection.queries`` includes all SQL statements -- INSERTs, UPDATES, 428 SELECTs, etc. Each time your app hits the database, the query will be recorded. 408 429 409 430 Can I use Django with a pre-existing database? … … 466 487 ---------------------------------------------------------------------------- 467 488 468 Django won't bother displaying the filter for a ManyToManyField if there are469 fewer than two related objects.489 Django won't bother displaying the filter for a ``ManyToManyField`` if there 490 are fewer than two related objects. 470 491 471 492 For example, if your ``list_filter`` includes ``sites``, and there's only one … … 478 499 You've got several options. If you want to piggyback on top of an add/change 479 500 form that Django automatically generates, you can attach arbitrary JavaScript 480 modules to the page via the model's `` admin.js`` parameter. That parameter is481 a list of URLs, as strings, pointing to JavaScript modules that will be 482 included within the admin form via a <script>tag.501 modules to the page via the model's ``class Admin`` ``js`` parameter. That 502 parameter is a list of URLs, as strings, pointing to JavaScript modules that 503 will be included within the admin form via a ``<script>`` tag. 483 504 484 505 If you want more flexibility than simply tweaking the auto-generated forms, … … 493 514 ------------------------------------------------------------------ 494 515 495 We think it's very purty, but if you don't agree, you can modify the admin496 site's presentation by editing the CSS stylesheet and/or associated image files. 497 The site is built using semantic HTML, so any changes you'd like to make should498 be possible by editing the CSS stylesheet. We've got a `guide to the CSS used in 499 the admin`_ to get you started.516 We like it, but if you don't agree, you can modify the admin site's 517 presentation by editing the CSS stylesheet and/or associated image files. The 518 site is built using semantic HTML and plenty of CSS hooks, so any changes you'd 519 like to make should be possible by editing the stylesheet. We've got a 520 `guide to the CSS used in the admin`_ to get you started. 500 521 501 522 .. _`guide to the CSS used in the admin`: http://www.djangoproject.com/documentation/admin_css/ 523 524 How do I create users without having to edit password hashes? 525 ------------------------------------------------------------- 526 527 We don't recommend you create users via the admin interface, because at the 528 moment it requires you to edit password hashes manually. (Passwords are hashed 529 using one-way hash algorithms for security; there's currently no Web interface 530 for changing passwords by entering the actual password rather than the hash.) 531 532 To create a user, you'll have to use the Python API. See `creating users`_ for 533 full info. 534 535 .. _creating users: http://www.djangoproject.com/documentation/authentication/#creating-users
