{"title":"How to install Django on Windows","version":"1.8","locale":"en","docname":"howto/windows","url":"/en/1.8/howto/windows/","canonical":"https://djangodocs.dev/en/1.8/howto/windows/","summary":"This document will guide you through installing Python and Django for basic usage on Windows. This is meant as a beginner’s guide for users working on Django…","html":"<h1>How to install Django on Windows<a class=\"heading-anchor\" href=\"#how-to-install-django-on-windows\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>This document will guide you through installing Python and Django for basic\nusage on Windows. This is meant as a beginner’s guide for users working on\nDjango projects and does not reflect how Django should be installed when\ndeveloping patches for Django itself.</p>\n<p>The steps in this guide have been tested with Windows 7 and 8. In other\nversions, the steps would be similar.</p>\n<section id=\"install-python\">\n<h2>Install Python<a class=\"heading-anchor\" href=\"#install-python\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django is a Python web framework, thus requiring Python to be installed on your\nmachine.</p>\n<p>To install Python on your machine go to <a class=\"reference external\" href=\"https://python.org/download/\">https://python.org/download/</a>, and\ndownload a Windows MSI installer for Python. Once downloaded, run the MSI\ninstaller and follow the on-screen instructions.</p>\n<p>After installation, open the command prompt and check the Python version by\nexecuting <code class=\"docutils literal notranslate\"><span class=\"pre\">python</span> <span class=\"pre\">--version</span></code>. If you encounter a problem, make sure you\nhave set the <code class=\"docutils literal notranslate\"><span class=\"pre\">PATH</span></code> variable correctly. You might need to adjust your\n<code class=\"docutils literal notranslate\"><span class=\"pre\">PATH</span></code> environment variable to include paths to the Python executable and\nadditional scripts. For example, if your Python is installed in\n<code class=\"docutils literal notranslate\"><span class=\"pre\">C:\\Python34\\</span></code>, the following paths need to be added to <code class=\"docutils literal notranslate\"><span class=\"pre\">PATH</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">C</span><span class=\"p\">:</span>\\<span class=\"n\">Python34</span>\\<span class=\"p\">;</span><span class=\"n\">C</span><span class=\"p\">:</span>\\<span class=\"n\">Python34</span>\\<span class=\"n\">Scripts</span><span class=\"p\">;</span>\n</code></pre></div>\n</section>\n<section id=\"install-setuptools\">\n<h2>Install Setuptools<a class=\"heading-anchor\" href=\"#install-setuptools\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>To install Python packages on your computer, Setuptools is needed. Download the\nlatest version of <a class=\"reference external\" href=\"https://pypi.python.org/pypi/setuptools\">Setuptools</a> for\nyour Python version and follow the installation instructions given there.</p>\n</section>\n<section id=\"install-pip\">\n<h2>Install PIP<a class=\"heading-anchor\" href=\"#install-pip\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><a class=\"reference external\" href=\"http://www.pip-installer.org/\">PIP</a> is a package manager for Python that\nuses the <a class=\"reference external\" href=\"https://pypi.python.org\">Python Package Index</a> to install Python\npackages. PIP will later be used to install Django from PyPI. If you’ve\ninstalled Python 3.4, <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code> is included so you may skip this section.</p>\n<p>Open a command prompt and execute <code class=\"docutils literal notranslate\"><span class=\"pre\">easy_install</span> <span class=\"pre\">pip</span></code>. This will install\n<code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code> on your system. This command will work if you have successfully\ninstalled Setuptools.</p>\n<p>Alternatively, go to <a class=\"reference external\" href=\"http://www.pip-installer.org/en/latest/installing.html\">http://www.pip-installer.org/en/latest/installing.html</a>\nfor installing/upgrading instructions.</p>\n</section>\n<section id=\"install-django\">\n<h2>Install Django<a class=\"heading-anchor\" href=\"#install-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django can be installed easily using <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code>.</p>\n<p>In the command prompt, execute the following command: <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span> <span class=\"pre\">install</span> <span class=\"pre\">django</span></code>.\nThis will download and install Django.</p>\n<p>After the installation has completed, you can verify your Django installation\nby executing <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span> <span class=\"pre\">--version</span></code> in the command prompt.</p>\n<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p><p>In Django 1.7, a <code class=\"docutils literal notranslate\"><span class=\"pre\">.exe</span></code> has been introduced, so just use\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> in place of <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin.py</span></code> in the command prompt.</p>\n</aside>\n<p>See <a class=\"reference internal\" href=\"/en/1.8/topics/install/#database-installation\"><span class=\"std std-ref\">Get your database running</span></a> for information on database installation\nwith Django.</p>\n</section>\n<section id=\"common-pitfalls\">\n<h2>Common pitfalls<a class=\"heading-anchor\" href=\"#common-pitfalls\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<ul>\n<li><p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> only displays the help text no matter what arguments\nit is given, there is probably a problem with the file association in\nWindows. Check if there is more than one environment variable set for\nrunning Python scripts in <code class=\"docutils literal notranslate\"><span class=\"pre\">PATH</span></code>. This usually occurs when there is more\nthan one Python version installed.</p></li>\n<li><p>If you are connecting to the internet behind a proxy, there might be problem\nin running the commands <code class=\"docutils literal notranslate\"><span class=\"pre\">easy_install</span> <span class=\"pre\">pip</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span> <span class=\"pre\">install</span> <span class=\"pre\">django</span></code>.\nSet the environment variables for proxy configuration in the command prompt\nas follows:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"nb\">set</span> <span class=\"n\">http_proxy</span><span class=\"o\">=</span><span class=\"n\">http</span><span class=\"p\">:</span><span class=\"o\">//</span><span class=\"n\">username</span><span class=\"p\">:</span><span class=\"n\">password</span><span class=\"nd\">@proxyserver</span><span class=\"p\">:</span><span class=\"n\">proxyport</span>\n<span class=\"nb\">set</span> <span class=\"n\">https_proxy</span><span class=\"o\">=</span><span class=\"n\">https</span><span class=\"p\">:</span><span class=\"o\">//</span><span class=\"n\">username</span><span class=\"p\">:</span><span class=\"n\">password</span><span class=\"nd\">@proxyserver</span><span class=\"p\">:</span><span class=\"n\">proxyport</span>\n</code></pre></div>\n</li>\n</ul>\n</section>","rootId":"how-to-install-django-on-windows","toc":[{"title":"Install Python","anchor":"install-python","children":[]},{"title":"Install Setuptools","anchor":"install-setuptools","children":[]},{"title":"Install PIP","anchor":"install-pip","children":[]},{"title":"Install Django","anchor":"install-django","children":[]},{"title":"Common pitfalls","anchor":"common-pitfalls","children":[]}],"breadcrumbs":[{"docname":"howto/index","title":"“How-to” guides","url":"/en/1.8/howto/"}],"prev":{"docname":"howto/static-files/deployment","title":"Deploying static files","url":"/en/1.8/howto/static-files/deployment/"},"next":{"docname":"howto/writing-migrations","title":"Writing database migrations","url":"/en/1.8/howto/writing-migrations/"},"formats":{"html":"/en/1.8/howto/windows/","markdown":"/en/1.8/howto/windows.md","json":"/en/1.8/howto/windows.json"},"source":"https://github.com/django/django/blob/stable/1.8.x/docs/howto/windows.txt","official":"https://docs.djangoproject.com/en/1.8/howto/windows/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9","1.8"],"inLocales":["en"]}