Changes between Initial Version and Version 1 of DjangoDocumentKoreanTranslation/faq-ko.txt

12/10/2007 09:32:50 AM (7 years ago)



  • DjangoDocumentKoreanTranslation/faq-ko.txt

    v1 v1  
     3Django FAQ
     6General questions
     9Why does this project exist?
     12Django grew from a very practical need: World Online, a newspaper Web
     13operation, is responsible for building intensive Web applications on journalism
     14deadlines. In the fast-paced newsroom, World Online often has only a matter of
     15hours to take a complicated Web application from concept to public launch.
     17At the same time, the World Online Web developers have consistently been
     18perfectionists when it comes to following best practices of Web development.
     20In fall 2003, the World Online developers (Adrian Holovaty and Simon Willison)
     21ditched PHP and began using Python to develop its Web sites. As they built
     22intensive, richly interactive sites such as, they began to extract
     23a generic Web development framework that let them build Web applications more
     24and more quickly. They tweaked this framework constantly, adding improvements
     25over two years.
     27In summer 2005, World Online decided to open-source the resulting software,
     28Django. Django would not be possible without a whole host of open-source
     29projects -- `Apache`_, `Python`_, and `PostgreSQL`_ to name a few -- and we're
     30thrilled to be able to give something back to the open-source community.
     32.. _Apache:
     33.. _Python:
     34.. _PostgreSQL:
     36What does "Django" mean, and how do you pronounce it?
     39Django is named after `Django Reinhardt`_, a gypsy jazz guitarist from the 1930s
     40to early 1950s. To this day, he's considered one of the best guitarists of all time.
     42Listen to his music. You'll like it.
     44Django is pronounced **JANG**-oh. Rhymes with FANG-oh. The "D" is silent.
     46We've also recorded an `audio clip of the pronunciation`_.
     48.. _Django Reinhardt:
     49.. _audio clip of the pronunciation:
     51Is Django stable?
     54Yes. World Online has been using Django for more than three years. Sites built
     55on Django have weathered traffic spikes of over one million hits an hour and a
     56number of Slashdottings. Yes, it's quite stable.
     58Does Django scale?
     61Yes. Compared to development time, hardware is cheap, and so Django is
     62designed to take advantage of as much hardware as you can throw at it.
     64Django uses a "shared-nothing" architecture, which means you can add hardware
     65at any level -- database servers, caching servers or Web/application servers.
     67The framework cleanly separates components such as its database layer and
     68application layer. And it ships with a simple-yet-powerful `cache framework`_.
     70.. _`cache framework`: ../cache/
     72Who's behind this?
     75Django was developed at `World Online`_, the Web department of a newspaper in
     76Lawrence, Kansas, USA.
     78`Adrian Holovaty`_
     79    Adrian is a Web developer with a background in journalism. He was lead
     80    developer at World Online for 2.5 years, during which time Django was
     81    developed and implemented on World Online's sites. Now he works for
     82 building rich, database-backed information sites, and
     83    continues to oversee Django development. He likes playing guitar (Django
     84    Reinhardt style) and hacking on side projects such as ``_.
     85    He lives in Chicago.
     87    On IRC, Adrian goes by ``adrian_h``.
     89`Jacob Kaplan-Moss`_
     90    Jacob is a whipper-snapper from California who spends equal time coding and
     91    cooking. He's lead developer at World Online and actively hacks on various
     92    cool side projects. He's contributed to the Python-ObjC bindings and was
     93    the first guy to figure out how to write Tivo apps in Python. Lately he's
     94    been messing with Python on the PSP. He lives in Lawrence, Kansas.
     96    On IRC, Jacob goes by ``jacobkm``.
     98`Simon Willison`_
     99    Simon is a well-respected Web developer from England. He had a one-year
     100    internship at World Online, during which time he and Adrian developed
     101    Django from scratch. The most enthusiastic Brit you'll ever meet, he's
     102    passionate about best practices in Web development and has maintained a
     103    well-read Web-development blog for years at
     104    He works for Yahoo UK, where he managed to score the title "Hacker Liason."
     105    He lives in London.
     107    On IRC, Simon goes by ``SimonW``.
     109`Wilson Miner`_
     110    Wilson's design-fu makes us all look like rock stars. By day, he's an
     111    interactive designer for `Apple`_. Don't ask him what he's working on, or
     112    he'll have to kill you. He lives in San Francisco.
     114    On IRC, Wilson goes by ``wilsonian``.
     116.. _`World Online`:
     117.. _`Adrian Holovaty`:
     118.. _``:
     119.. _``:
     120.. _`Simon Willison`:
     121.. _``:
     122.. _`Jacob Kaplan-Moss`:
     123.. _`Wilson Miner`:
     124.. _`Apple`:
     126Which sites use Django?
     129The Django wiki features a consistently growing `list of Django-powered sites`_.
     130Feel free to add your Django-powered site to the list.
     132.. _list of Django-powered sites:
     134Django 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?
     137Well, the standard names are debatable.
     139In our interpretation of MVC, the "view" describes the data that gets presented
     140to the user. It's not necessarily *how* the data *looks*, but *which* data is
     141presented. The view describes *which data you see*, not *how you see it.* It's
     142a subtle distinction.
     144So, in our case, a "view" is the Python callback function for a particular URL,
     145because that callback function describes which data is presented.
     147Furthermore, it's sensible to separate content from presentation -- which is
     148where templates come in. In Django, a "view" describes which data is presented,
     149but a view normally delegates to a template, which describes *how* the data is
     152Where does the "controller" fit in, then? In Django's case, it's probably the
     153framework itself: the machinery that sends a request to the appropriate view,
     154according to the Django URL configuration.
     156If you're hungry for acronyms, you might say that Django is a "MTV" framework
     157-- that is, "model", "template", and "view." That breakdown makes much more
     160At the end of the day, of course, it comes down to getting stuff done. And,
     161regardless of how things are named, Django gets stuff done in a way that's most
     162logical to us.
     164<Framework X> does <feature Y> -- why doesn't Django?
     167We're well aware that there are other awesome Web frameworks out there, and
     168we're not averse to borrowing ideas where appropriate. However, Django was
     169developed precisely because we were unhappy with the status quo, so please be
     170aware that "because <Framework X>" does it is not going to be sufficient reason
     171to add a given feature to Django.
     173Why did you write all of Django from scratch, instead of using other Python libraries?
     176When Django was originally written a couple of years ago, Adrian and Simon
     177spent quite a bit of time exploring the various Python Web frameworks
     180In our opinion, none of them were completely up to snuff.
     182We're picky. You might even call us perfectionists. (With deadlines.)
     184Over time, we stumbled across open-source libraries that did things we'd
     185already implemented. It was reassuring to see other people solving similar
     186problems in similar ways, but it was too late to integrate outside code: We'd
     187already written, tested and implemented our own framework bits in several
     188production settings -- and our own code met our needs delightfully.
     190In most cases, however, we found that existing frameworks/tools inevitably had
     191some sort of fundamental, fatal flaw that made us squeamish. No tool fit our
     192philosophies 100%.
     194Like we said: We're picky.
     196We've documented our philosophies on the `design philosophies page`_.
     198.. _design philosophies page: ../design_philosophies/
     200Do you have any of those nifty "screencast" things?
     203You can bet your bottom they're on the way. But, since we're still hammering
     204out a few points, we want to make sure they reflect the final state of things
     205at Django 1.0, not some intermediary step. In other words, we don't want to
     206spend a lot of energy creating screencasts yet, because Django APIs will shift.
     208Is Django a content-management-system (CMS)?
     211No, Django is not a CMS, or any sort of "turnkey product" in and of itself.
     212It's a Web framework; it's a programming tool that lets you build Web sites.
     214For example, it doesn't make much sense to compare Django to something like
     215Drupal_, because Django is something you use to *create* things like Drupal.
     217Of course, Django's automatic admin site is fantastic and timesaving -- but
     218the admin site is one module of Django the framework. Furthermore, although
     219Django has special conveniences for building "CMS-y" apps, that doesn't mean
     220it's not just as appropriate for building "non-CMS-y" apps (whatever that
     223.. _Drupal:
     225When will you release Django 1.0?
     228Short answer: When we're comfortable with Django's APIs, have added all
     229features that we feel are necessary to earn a "1.0" status, and are ready to
     230begin maintaining backwards compatibility.
     232The merging of Django's `magic-removal branch`_ went a long way toward Django
     235Of course, you should note that `quite a few production sites`_ use Django in
     236its current status. Don't let the lack of a 1.0 turn you off.
     238.. _magic-removal branch:
     239.. _quite a few production sites:
     241How can I download the Django documentation to read it offline?
     244The Django docs are available in the ``docs`` directory of each Django tarball
     245release. These docs are in ReST (ReStructured Text) format, and each text file
     246corresponds to a Web page on the official Django site.
     248Because the documentation is `stored in revision control`_, you can browse
     249documentation changes just like you can browse code changes.
     251Technically, the docs on Django's site are generated from the latest development
     252versions of those ReST documents, so the docs on the Django site may offer more
     253information than the docs that come with the latest Django release.
     255.. _stored in revision control:
     257Where can I find Django developers for hire?
     260Consult our `developers for hire page`_ for a list of Django developers who
     261would be happy to help you.
     263You might also be interested in posting a job to .
     265.. _developers for hire page:
     267Installation questions
     270How do I get started?
     273    #. `Download the code`_.
     274    #. Install Django (read the `installation guide`_).
     275    #. Walk through the tutorial_.
     276    #. Check out the rest of the documentation_, and `ask questions`_ if you
     277       run into trouble.
     279.. _`Download the code`:
     280.. _`installation guide`: ../install/
     281.. _tutorial:  ../tutorial01/
     282.. _documentation: ../
     283.. _ask questions:
     285How do I fix the "install a later version of setuptools" error?
     288Just run the ```` script in the Django distribution.
     290What are Django's prerequisites?
     293Django requires Python_ 2.3 or later. No other Python libraries are required
     294for basic Django usage.
     296For a development environment -- if you just want to experiment with Django --
     297you don't need to have a separate Web server installed; Django comes with its
     298own lightweight development server. For a production environment, we recommend
     299`Apache 2`_ and mod_python_, although Django follows the WSGI_ spec, which
     300means it can run on a variety of server platforms.
     302If you want to use Django with a database, which is probably the case, you'll
     303also need a database engine. PostgreSQL_ is recommended, because we're
     304PostgreSQL fans, and MySQL_, `SQLite 3`_, and Oracle_ are also supported.
     306.. _Python:
     307.. _Apache 2:
     308.. _mod_python:
     309.. _WSGI:
     310.. _PostgreSQL:
     311.. _MySQL:
     312.. _`SQLite 3`:
     313.. _Oracle:
     315Do I lose anything by using Python 2.3 versus newer Python versions, such as Python 2.5?
     318No. Django itself is guaranteed to work with any version of Python from 2.3
     319and higher.
     321If you use a Python version newer than 2.3, you will, of course, be able to
     322take advantage of newer Python features in your own code, along with the speed
     323improvements and other optimizations that have been made to the Python language
     324itself. But the Django framework itself should work equally well on 2.3 as it
     325does on 2.4 or 2.5.
     327Do I have to use mod_python?
     330Although we recommend mod_python for production use, you don't have to use it,
     331thanks to the fact that Django uses an arrangement called WSGI_. Django can
     332talk to any WSGI-enabled server. Other non-mod_python deployment setups are
     333FastCGI, SCGI or AJP. See `How to use Django with FastCGI, SCGI or AJP`_ for
     334full information.
     336Also, see the `server arrangements wiki page`_ for other deployment strategies.
     338If you just want to play around and develop things on your local computer, use
     339the development Web server that comes with Django. Things should Just Work.
     341.. _WSGI:
     342.. _How to use Django with FastCGI, SCGI or AJP: ../fastcgi/
     343.. _server arrangements wiki page:
     345How do I install mod_python on Windows?
     348    * For Python 2.4, grab mod_python from `win32 build of mod_python for
     349      Python 2.4`_.
     350    * For Python 2.4, check out this `Django on Windows howto`_.
     351    * For Python 2.3, grab mod_python from and read
     352      `Running mod_python on Apache on Windows2000`_.
     353    * Also, try this (not Windows-specific) `guide to getting mod_python
     354      working`_.
     356.. _`win32 build of mod_python for Python 2.4`:
     357.. _`Django on Windows howto`:
     358.. _`Running mod_python on Apache on Windows2000`:
     359.. _`guide to getting mod_python working`:
     361Will Django run under shared hosting (like TextDrive or Dreamhost)?
     364See our `Django-friendly Web hosts`_ page.
     366.. _`Django-friendly Web hosts`:
     368Should I use the official version or development version?
     371The Django developers improve Django every day and are pretty good about not
     372checking in broken code. We use the development code (from the Subversion
     373repository) directly on our servers, so we consider it stable. With that in
     374mind, we recommend that you use the latest development code, because it
     375generally contains more features and fewer bugs than the "official" releases.
     377Using Django
     380Why do I get an error about importing DJANGO_SETTINGS_MODULE?
     383Make sure that:
     385    * The environment variable DJANGO_SETTINGS_MODULE is set to a fully-qualified
     386      Python module (i.e. "mysite.settings").
     388    * Said module is on ``sys.path`` (``import mysite.settings`` should work).
     390    * The module doesn't contain syntax errors (of course).
     392    * If you're using mod_python but *not* using Django's request handler,
     393      you'll need to work around a mod_python bug related to the use of
     394      ``SetEnv``; before you import anything from Django you'll need to do
     395      the following::
     397            os.environ.update(req.subprocess_env)
     399      (where ``req`` is the mod_python request object).
     401I can't stand your template language. Do I have to use it?
     404We happen to think our template engine is the best thing since chunky bacon,
     405but we recognize that choosing a template language runs close to religion.
     406There's nothing about Django that requires using the template language, so
     407if you're attached to ZPT, Cheetah, or whatever, feel free to use those.
     409Do I have to use your model/database layer?
     412Nope. Just like the template system, the model/database layer is decoupled from
     413the rest of the framework.
     415The one exception is: If you use a different database library, you won't get to
     416use Django's automatically-generated admin site. That app is coupled to the
     417Django database layer.
     419How do I use image and file fields?
     422Using a ``FileField`` or an ``ImageField`` in a model takes a few steps:
     424    #. In your settings file, define ``MEDIA_ROOT`` as the full path to
     425       a directory where you'd like Django to store uploaded files. (For
     426       performance, these files are not stored in the database.) Define
     427       ``MEDIA_URL`` as the base public URL of that directory. Make sure that
     428       this directory is writable by the Web server's user account.
     430    #. Add the ``FileField`` or ``ImageField`` to your model, making sure
     431       to define the ``upload_to`` option to tell Django to which subdirectory
     432       of ``MEDIA_ROOT`` it should upload files.
     434    #. All that will be stored in your database is a path to the file
     435       (relative to ``MEDIA_ROOT``). You'll must likely want to use the
     436       convenience ``get_<fieldname>_url`` function provided by Django. For
     437       example, if your ``ImageField`` is called ``mug_shot``, you can get the
     438       absolute URL to your image in a template with
     439       ``{{ object.get_mug_shot_url }}``.
     441Databases and models
     444How can I see the raw SQL queries Django is running?
     447Make sure your Django ``DEBUG`` setting is set to ``True``. Then, just do
     450    >>> from django.db import connection
     451    >>> connection.queries
     452    [{'sql': 'SELECT,polls_polls.question,polls_polls.pub_date FROM polls_polls',
     453    'time': '0.002'}]
     455``connection.queries`` is only available if ``DEBUG`` is ``True``. It's a list
     456of dictionaries in order of query execution. Each dictionary has the following::
     458    ``sql`` -- The raw SQL statement
     459    ``time`` -- How long the statement took to execute, in seconds.
     461``connection.queries`` includes all SQL statements -- INSERTs, UPDATES,
     462SELECTs, etc. Each time your app hits the database, the query will be recorded.
     464Can I use Django with a pre-existing database?
     467Yes. See `Integrating with a legacy database`_.
     469.. _`Integrating with a legacy database`: ../legacy_databases/
     471If I make changes to a model, how do I update the database?
     474If you don't mind clearing data, your project's ```` utility has an
     475option to reset the SQL for a particular application::
     477 reset appname
     479This drops any tables associated with ``appname`` and recreates them.
     481If you do care about deleting data, you'll have to execute the ``ALTER TABLE``
     482statements manually in your database. That's the way we've always done it,
     483because dealing with data is a very sensitive operation that we've wanted to
     484avoid automating. That said, there's some work being done to add partially
     485automated database-upgrade functionality.
     487Do Django models support multiple-column primary keys?
     490No. Only single-column primary keys are supported.
     492But this isn't an issue in practice, because there's nothing stopping you from
     493adding other constraints (using the ``unique_together`` model option or
     494creating the constraint directly in your database), and enforcing the
     495uniqueness at that level. Single-column primary keys are needed for things such
     496as the admin interface to work; e.g., you need a simple way of being able to
     497specify an object to edit or delete.
     499How do I add database-specific options to my CREATE TABLE statements, such as specifying MyISAM as the table type?
     502We try to avoid adding special cases in the Django code to accommodate all the
     503database-specific options such as table type, etc. If you'd like to use any of
     504these options, create an `SQL initial data file`_ that contains ``ALTER TABLE``
     505statements that do what you want to do. The initial data files are executed in
     506your database after the ``CREATE TABLE`` statements.
     508For example, if you're using MySQL and want your tables to use the MyISAM table
     509type, create an initial data file and put something like this in it::
     511    ALTER TABLE myapp_mytable ENGINE=MyISAM;
     513As explained in the `SQL initial data file`_ documentation, this SQL file can
     514contain arbitrary SQL, so you can make any sorts of changes you need to make.
     516.. _SQL initial data file: ../model-api/#providing-initial-sql-data
     518Why is Django leaking memory?
     521Django isn't known to leak memory. If you find your Django processes are
     522allocating more and more memory, with no sign of releasing it, check to make
     523sure your ``DEBUG`` setting is set to ``True``. If ``DEBUG`` is ``True``, then
     524Django saves a copy of every SQL statement it has executed.
     526(The queries are saved in ``django.db.connection.queries``. See
     527`How can I see the raw SQL queries Django is running?`_.)
     529To fix the problem, set ``DEBUG`` to ``False``.
     531If you need to clear the query list manually at any point in your functions,
     532just call ``reset_queries()``, like this::
     534    from django import db
     535    db.reset_queries()
     537The admin site
     540I can't log in. When I enter a valid username and password, it just brings up the login page again, with no error messages.
     543The login cookie isn't being set correctly, because the domain of the cookie
     544sent out by Django doesn't match the domain in your browser. Try these two
     547    * Set the ``SESSION_COOKIE_DOMAIN`` setting in your admin config file
     548      to match your domain. For example, if you're going to
     549      "" in your browser, in
     550      "myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = ''``.
     552    * Some browsers (Firefox?) don't like to accept cookies from domains that
     553      don't have dots in them. If you're running the admin site on "localhost"
     554      or another domain that doesn't have a dot in it, try going to
     555      "localhost.localdomain" or "". And set
     556      ``SESSION_COOKIE_DOMAIN`` accordingly.
     558I 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.
     561If you're sure your username and password are correct, make sure your user
     562account has ``is_active`` and ``is_staff`` set to True. The admin site only
     563allows access to users with those two fields both set to True.
     565How can I prevent the cache middleware from caching the admin site?
     568Set the ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting to ``True``. See the
     569`cache documentation`_ for more information.
     571.. _cache documentation: ../cache/#the-per-site-cache
     573How do I automatically set a field's value to the user who last edited the object in the admin?
     576At this point, Django doesn't have an official way to do this. But it's an oft-requested
     577feature, so we're discussing how it can be implemented. The problem is we don't want to couple
     578the model layer with the admin layer with the request layer (to get the current user). It's a
     579tricky problem.
     581One person hacked up a `solution that doesn't require patching Django`_, but note that it's an
     582unofficial solution, and there's no guarantee it won't break at some point.
     584.. _solution that doesn't require patching Django:
     586How do I limit admin access so that objects can only be edited by the users who created them?
     589See the answer to the previous question.
     591My admin-site CSS and images showed up fine using the development server, but they're not displaying when using mod_python.
     594See `serving the admin files`_ in the "How to use Django with mod_python"
     597.. _serving the admin files: ../modpython/#serving-the-admin-files
     599My "list_filter" contains a ManyToManyField, but the filter doesn't display.
     602Django won't bother displaying the filter for a ``ManyToManyField`` if there
     603are fewer than two related objects.
     605For example, if your ``list_filter`` includes ``sites``, and there's only one
     606site in your database, it won't display a "Site" filter. In that case,
     607filtering by site would be meaningless.
     609How can I customize the functionality of the admin interface?
     612You've got several options. If you want to piggyback on top of an add/change
     613form that Django automatically generates, you can attach arbitrary JavaScript
     614modules to the page via the model's ``class Admin`` ``js`` parameter. That
     615parameter is a list of URLs, as strings, pointing to JavaScript modules that
     616will be included within the admin form via a ``<script>`` tag.
     618If you want more flexibility than simply tweaking the auto-generated forms,
     619feel free to write custom views for the admin. The admin is powered by Django
     620itself, and you can write custom views that hook into the authentication
     621system, check permissions and do whatever else they need to do.
     623If you want to customize the look-and-feel of the admin interface, read the
     624next question.
     626The dynamically-generated admin site is ugly! How can I change it?
     629We like it, but if you don't agree, you can modify the admin site's
     630presentation by editing the CSS stylesheet and/or associated image files. The
     631site is built using semantic HTML and plenty of CSS hooks, so any changes you'd
     632like to make should be possible by editing the stylesheet. We've got a
     633`guide to the CSS used in the admin`_ to get you started.
     635.. _`guide to the CSS used in the admin`: ../admin_css/
     637How do I create users without having to edit password hashes?
     640If you'd like to use the admin site to create users, upgrade to the Django
     641development version, where this problem was fixed on Aug. 4, 2006.
     643You can also use the Python API. See `creating users`_ for full info.
     645.. _creating users: ../authentication/#creating-users
     647Contributing code
     650How can I get started contributing code to Django?
     653Thanks for asking! We've written an entire document devoted to this question.
     654It's titled `Contributing to Django`_.
     656.. _Contributing to Django: ../contributing/
     658I submitted a bug fix in the ticket system several weeks ago. Why are you ignoring my patch?
     661Don't worry: We're not ignoring you!
     663It's important to understand there is a difference between "a ticket is being
     664ignored" and "a ticket has not been attended to yet." Django's ticket system
     665contains hundreds of open tickets, of various degrees of impact on end-user
     666functionality, and Django's developers have to review and prioritize.
     668Besides, if your feature request stands no chance of inclusion in Django, we
     669won't ignore it -- we'll just close the ticket. So if your ticket is still
     670open, it doesn't mean we're ignoring you; it just means we haven't had time to
     671look at it yet.
Back to Top