windows.txt 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ================================
  2. How to install Django on Windows
  3. ================================
  4. This document will guide you through installing Python and Django for basic
  5. usage on Windows. This is meant as a beginner's guide for users working on
  6. Django projects and does not reflect how Django should be installed when
  7. developing patches for Django itself.
  8. The steps in this guide have been tested with Windows 7 and 8. In other
  9. versions, the steps would be similar.
  10. Install Python
  11. ==============
  12. Django is a Python web framework, thus requiring Python to be installed on your
  13. machine.
  14. To install Python on your machine go to http://python.org/download/, and
  15. download a Windows MSI installer for Python. Once downloaded, run the MSI
  16. installer and follow the on-screen instructions.
  17. After installation, open the command prompt and check the Python version by
  18. executing ``python --version``. If you encounter a problem, make sure you
  19. have set the ``PATH`` variable correctly. You might need to adjust your
  20. ``PATH`` environment variable to include paths to the Python executable and
  21. additional scripts. For example, if your Python is installed in
  22. ``C:\Python34\``, the following paths need to be added to ``PATH``::
  23. C:\Python34\;C:\Python34\Scripts;
  24. Install Setuptools
  25. ==================
  26. To install Python packages on your computer, Setuptools is needed. Download the
  27. latest version of `Setuptools <http://pypi.python.org/pypi/setuptools>`_ for
  28. your Python version and follow the installation instructions given there.
  29. Install PIP
  30. ===========
  31. `PIP <http://www.pip-installer.org/>`_ is a package manager for Python that
  32. uses the `Python Package Index <http://pypi.python.org>`_ to install Python
  33. packages. PIP will later be used to install Django from PyPI. If you've
  34. installed Python 3.4, ``pip`` is included so you may skip this section.
  35. Open a command prompt and execute ``easy_install pip``. This will install
  36. ``pip`` on your system. This command will work if you have successfully
  37. installed Setuptools.
  38. Alternatively, go to `<http://www.pip-installer.org/en/latest/installing.html>`_
  39. for installing/upgrading instructions.
  40. Install Django
  41. ==============
  42. Django can be installed easily using ``pip``.
  43. In the command prompt, execute the following command: ``pip install django``.
  44. This will download and install Django.
  45. After the installation has completed, you can verify your Django installation
  46. by executing ``django-admin --version`` in the command prompt.
  47. .. versionchanged:: 1.7
  48. In Django 1.7, a ``.exe`` has been introduced, so just use
  49. ``django-admin`` in place of ``django-admin.py`` in the command prompt.
  50. See :ref:`database-installation` for information on database installation
  51. with Django.
  52. Common pitfalls
  53. ===============
  54. * If ``django-admin`` only displays the help text no matter what arguments
  55. it is given, there is probably a problem with the file association in
  56. Windows. Check if there is more than one environment variable set for
  57. running Python scripts in ``PATH``. This usually occurs when there is more
  58. than one Python version installed.
  59. * If you are connecting to the internet behind a proxy, there might be problem
  60. in running the commands ``easy_install pip`` and ``pip install django``.
  61. Set the environment variables for proxy configuration in the command prompt
  62. as follows::
  63. set http_proxy=http://username:password@proxyserver:proxyport
  64. set https_proxy=https://username:password@proxyserver:proxyport