{"title":"How to install Django on Windows","version":"2.1","locale":"pl","docname":"howto/windows","url":"/pl/2.1/howto/windows/","canonical":"https://djangodocs.dev/pl/2.1/howto/windows/","summary":"This document will guide you through installing Python 3.5 and Django on Windows.","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>Instalacja Pythona<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\">Add\nPython 3.5 to PATH</code> and then click <code class=\"docutils literal notranslate\">Install Now</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>python <span class=\"o\">--</span>version\n</code></pre></div>\n</section>\n<section id=\"about-pip\">\n<h2>About <code class=\"docutils literal notranslate\">pip</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\">pip</code> to install Python packages from the command line.</p>\n<p>Aby zainstalować pip na waszym komputerze, przejdźcie pod adres <a class=\"reference external\" href=\"https://pip.pypa.io/en/latest/installing/\">https://pip.pypa.io/en/latest/installing/</a> i zapoznajcie się z instrukcjami dostępnymi pod hasłem „Installing with get-pip.py”.</p>\n</section>\n<section id=\"install-virtualenv-and-virtualenvwrapper\">\n<h2>Install <code class=\"docutils literal notranslate\">virtualenv</code> and <code class=\"docutils literal notranslate\">virtualenvwrapper</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>pip install virtualenvwrapper<span class=\"o\">-</span>win\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>mkvirtualenv myproject\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>workon myproject\n</code></pre></div>\n</section>\n<section id=\"install-django\">\n<h2>Instaluj 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 można łatwo zainstalować, używając polecenia <code class=\"docutils literal notranslate\">pip</code> wewnątrz waszego środowiska wirtualnego.</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>pip install django\n</code></pre></div>\n<p>This will download and install the latest Django release.</p>\n<p>Po zakończeniu instalacji możecie zweryfikować zainstalowane Django wykonując komendę <code class=\"docutils literal notranslate\">django-admin --version</code> w wierszu polecenia.</p>\n<p>See <a class=\"reference internal\" href=\"/pl/2.1/topics/install/#database-installation\"><span class=\"std std-ref\">Uruchamianie bazy danych</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\">django-admin</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\">PATH</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\">pip install django</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> http_proxy<span class=\"o\">=</span>http<span class=\"p\">:</span><span class=\"o\">//</span>username<span class=\"p\">:</span>password<span class=\"nd\">@proxyserver</span><span class=\"p\">:</span>proxyport\n<span class=\"nb\">set</span> https_proxy<span class=\"o\">=</span>https<span class=\"p\">:</span><span class=\"o\">//</span>username<span class=\"p\">:</span>password<span class=\"nd\">@proxyserver</span><span class=\"p\">:</span>proxyport\n</code></pre></div>\n</li>\n</ul>\n</section>","rootId":"how-to-install-django-on-windows","toc":[{"title":"Instalacja Pythona","anchor":"install-python","children":[]},{"title":"About pip","anchor":"about-pip","children":[]},{"title":"Install virtualenv and virtualenvwrapper","anchor":"install-virtualenv-and-virtualenvwrapper","children":[]},{"title":"Instaluj Django","anchor":"install-django","children":[]},{"title":"Common pitfalls","anchor":"common-pitfalls","children":[]}],"breadcrumbs":[{"docname":"howto/index","title":"Przewodniki „Jak to zrobić”","url":"/pl/2.1/howto/"}],"prev":{"docname":"howto/static-files/deployment","title":"Deploying static files","url":"/pl/2.1/howto/static-files/deployment/"},"next":{"docname":"howto/writing-migrations","title":"Writing database migrations","url":"/pl/2.1/howto/writing-migrations/"},"formats":{"html":"/pl/2.1/howto/windows/","markdown":"/pl/2.1/howto/windows.md","json":"/pl/2.1/howto/windows.json"},"source":"https://github.com/django/django/blob/stable/2.1.x/docs/howto/windows.txt","official":"https://docs.djangoproject.com/pl/2.1/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"],"inLocales":["en","zh-hans","fr","ja","id","pt-br","ko","es","el","pl"]}