install.txt 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. =====================
  2. How to install Django
  3. =====================
  4. This document will get you up and running with Django.
  5. Install Apache and mod_python
  6. =============================
  7. If you just want to experiment with Django, skip this step. Django comes with
  8. its own Web server for development purposes.
  9. If you want to use Django on a production site, use Apache with `mod_python`_.
  10. mod_python is similar to mod_perl -- it embeds Python within Apache and loads
  11. Python code into memory when the server starts. Code stays in memory throughout
  12. the life of an Apache process, which leads to significant performance gains
  13. over other server arrangements. Make sure you have Apache installed, with the
  14. mod_python module activated.
  15. If you can't use mod_python for some reason, fear not: Django follows the WSGI_
  16. spec, which allows it to run on a variety of server platforms. As people
  17. experiment with different server platforms, we'll update this document to
  18. give specific installation instructions for each platform.
  19. .. _Apache: http://httpd.apache.org/
  20. .. _mod_python: http://www.modpython.org/
  21. .. _WSGI: http://www.python.org/peps/pep-0333.html
  22. Get your database running
  23. =========================
  24. If you plan to use Django's database API functionality, you'll need to
  25. make sure a database server is running. Django works with PostgreSQL_
  26. (recommended) or MySQL_.
  27. Note that MySQL support is a recent development, and Django hasn't been
  28. comprehensively tested with that database. If you find any bugs in Django's
  29. MySQL bindings, please file them in `Django's ticket system`_ so we can fix them
  30. immediately.
  31. Additionally, you'll need to make sure your Python database bindings are
  32. installed.
  33. * If you're using PostgreSQL, you'll need the psycopg_ package (version 1 --
  34. not version 2, which is still in beta). If you're on Windows, check out the
  35. unofficial `compiled Windows version`_.
  36. * If you're using MySQL, you'll need MySQLdb_.
  37. .. _PostgreSQL: http://www.postgresql.org/
  38. .. _MySQL: http://www.mysql.com/
  39. .. _Django's ticket system: http://code.djangoproject.com/report/1
  40. .. _psycopg: http://initd.org/projects/psycopg1
  41. .. _compiled Windows version: http://stickpeople.com/projects/python/win-psycopg/
  42. .. _MySQLdb: http://sourceforge.net/projects/mysql-python
  43. Install the Django code
  44. =======================
  45. Installation instructions are slightly different depending on whether you're
  46. using the latest official version or the latest development version.
  47. It's easy either way.
  48. Installing the official version
  49. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  50. There IS no official version yet. But once there is, here's how it'll work:
  51. 1. Download the tarball of the latest official version from our `download page`_.
  52. 2. ``tar xzvf django-1.0.0.tar.gz``
  53. 3. ``cd django-1.0.0``
  54. 4. ``python setup.py install``
  55. Installing the development version
  56. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  57. 1. Make sure you have Subversion_ installed.
  58. 2. ``svn co http://code.djangoproject.com/svn/django/trunk/ django_src``
  59. 3. Symlink ``django_src/django`` so that ``django`` is within your Python
  60. ``site-packages`` directory:
  61. ``ln -s `pwd`/django_src/django /usr/lib/python2.3/site-packages/django``
  62. (In the above line, change ``python2.3`` to match your current Python version.)
  63. You don't have to run ``python setup.py install``.
  64. When you want to update your code, just run the command ``svn update`` from
  65. within the ``django_src`` directory.
  66. .. _`download page`: http://www.djangoproject.com/download/
  67. .. _Subversion: http://subversion.tigris.org/