{"title":"How to install Django on Windows","version":"2.0","locale":"es","docname":"howto/windows","url":"/es/2.0/howto/windows/","canonical":"https://djangodocs.dev/es/2.0/howto/windows/","summary":"This document will guide you through installing Python 3.5 and Django on Windows. It also provides instructions for installing virtualenv and virtualenvwrapper ,…","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 3.5 and Django on\nWindows. It also provides instructions for installing <a class=\"reference external\" href=\"https://pypi.org/project/virtualenv/\">virtualenv</a> and\n<a class=\"reference external\" href=\"https://pypi.org/project/virtualenvwrapper-win/\">virtualenvwrapper</a>, which make it easier to work on Python projects. This is\nmeant as a beginner’s guide for users working on Django projects and does not\nreflect how Django should be installed when developing patches for Django\nitself.</p>\n<p>The steps in this guide have been tested with Windows 7, 8, and 10. In other\nversions, the steps would be similar. You will need to be familiar with using\nthe Windows command prompt.</p>\n<section id=\"install-python\">\n<h2>Instale 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. At the time of writing, Python 3.5 is the latest version.</p>\n<p>To install Python on your machine go to <a class=\"reference external\" href=\"https://python.org/downloads/\">https://python.org/downloads/</a>. The\nwebsite should offer you a download button for the latest Python version.\nDownload the executable installer and run it. Check the box next to <code class=\"docutils literal notranslate\"><span class=\"pre\">Add</span>\n<span class=\"pre\">Python</span> <span class=\"pre\">3.5</span> <span class=\"pre\">to</span> <span class=\"pre\">PATH</span></code> and then click <code class=\"docutils literal notranslate\"><span class=\"pre\">Install</span> <span class=\"pre\">Now</span></code>.</p>\n<p>After installation, open the command prompt and check that the Python version\nmatches the version you installed by executing:</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\">python</span> <span class=\"o\">--</span><span class=\"n\">version</span>\n</code></pre></div>\n</section>\n<section id=\"about-pip\">\n<h2>About <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code><a class=\"heading-anchor\" href=\"#about-pip\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><a class=\"reference external\" href=\"https://pypi.org/project/pip/\">pip</a> is a package manage for Python. It makes installing and uninstalling\nPython packages (such as Django!) very easy. For the rest of the installation,\nwe’ll use <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code> to install Python packages from the command line.</p>\n<p>To install pip on your machine, go to\n<a class=\"reference external\" href=\"https://pip.pypa.io/en/latest/installing/\">https://pip.pypa.io/en/latest/installing/</a>, and follow the <code class=\"docutils literal notranslate\"><span class=\"pre\">Installing</span> <span class=\"pre\">with</span>\n<span class=\"pre\">get-pip.py</span></code> instructions.</p>\n</section>\n<section id=\"install-virtualenv-and-virtualenvwrapper\">\n<h2>Install <code class=\"docutils literal notranslate\"><span class=\"pre\">virtualenv</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">virtualenvwrapper</span></code><a class=\"heading-anchor\" href=\"#install-virtualenv-and-virtualenvwrapper\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><a class=\"reference external\" href=\"https://pypi.org/project/virtualenv/\">virtualenv</a> and <a class=\"reference external\" href=\"https://pypi.org/project/virtualenvwrapper-win/\">virtualenvwrapper</a> provide a dedicated environment for\neach Django project you create. While not mandatory, this is considered a best\npractice and will save you time in the future when you’re ready to deploy your\nproject. Simply type:</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\">pip</span> <span class=\"n\">install</span> <span class=\"n\">virtualenvwrapper</span><span class=\"o\">-</span><span class=\"n\">win</span>\n</code></pre></div>\n<p>Then create a virtual environment for your project:</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\">mkvirtualenv</span> <span class=\"n\">myproject</span>\n</code></pre></div>\n<p>The virtual environment will be activated automatically and you’ll see\n«(myproject)» next to the command prompt to designate that. If you start a new\ncommand prompt, you’ll need to activate the environment again using:</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\">workon</span> <span class=\"n\">myproject</span>\n</code></pre></div>\n</section>\n<section id=\"install-django\">\n<h2>Instale 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> within your virtual environment.</p>\n<p>In the command prompt, ensure your virtual environment is active, and execute\nthe following command:</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\">pip</span> <span class=\"n\">install</span> <span class=\"n\">django</span>\n</code></pre></div>\n<p>This will download and install the latest Django release.</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<p>See <a class=\"reference internal\" href=\"/es/2.0/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 command <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span> <span class=\"pre\">install</span> <span class=\"pre\">django</span></code>. Set the environment variables\nfor proxy configuration in the command prompt as 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":"Instale Python","anchor":"install-python","children":[]},{"title":"About pip","anchor":"about-pip","children":[]},{"title":"Install virtualenv and virtualenvwrapper","anchor":"install-virtualenv-and-virtualenvwrapper","children":[]},{"title":"Instale Django","anchor":"install-django","children":[]},{"title":"Common pitfalls","anchor":"common-pitfalls","children":[]}],"breadcrumbs":[{"docname":"howto/index","title":"«How-to» guides","url":"/es/2.0/howto/"}],"prev":{"docname":"howto/static-files/deployment","title":"Deploying static files","url":"/es/2.0/howto/static-files/deployment/"},"next":{"docname":"howto/writing-migrations","title":"Writing database migrations","url":"/es/2.0/howto/writing-migrations/"},"formats":{"html":"/es/2.0/howto/windows/","markdown":"/es/2.0/howto/windows.md","json":"/es/2.0/howto/windows.json"},"source":"https://github.com/django/django/blob/stable/2.0.x/docs/howto/windows.txt","official":"https://docs.djangoproject.com/es/2.0/howto/windows/","inVersions":["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"],"inLocales":["en","zh-hans","fr","ja","id","pt-br","ko","es","el","pl"]}