{"title":"Django 설치하는 법","version":"2.2","locale":"ko","docname":"topics/install","url":"/ko/2.2/topics/install/","canonical":"https://djangodocs.dev/ko/2.2/topics/install/","summary":"이 문서는 Django를 설치하는 방법을 설명합니다. Python 설치 Link to this heading # Django는 Python 웹 프래임워크 입니다. 장고와 어떤 파이썬 버전을 사용해야 하나요? 에서 자세한 내용을 참고하세요. 최신 Python 버전은…","html":"<h1>Django 설치하는 법<a class=\"heading-anchor\" href=\"#how-to-install-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>이 문서는 Django를 설치하는 방법을 설명합니다.</p>\n<section id=\"install-python\">\n<h2>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는 Python 웹 프래임워크 입니다. <a class=\"reference internal\" href=\"/ko/2.2/faq/install/#faq-python-version-support\"><span class=\"std std-ref\">장고와 어떤 파이썬 버전을 사용해야 하나요?</span></a> 에서 자세한 내용을 참고하세요.</p>\n<p>최신 Python 버전은 <a class=\"reference external\" href=\"https://www.python.org/downloads/\">https://www.python.org/downloads/</a> 또는 운영 체제 패키지 관리자에게 문의하십시오.</p>\n<aside class=\"admonition-django-on-jython admonition\">\n<p class=\"admonition-title\">Jython 환경의 Django</p>\n<p><a class=\"reference external\" href=\"http://www.jython.org/\">Jython</a> (Java 플랫폼을 위해 구현된 Python) 은 Python 3와 호환되지 않기 때문에 Django 버전 2.0이상을 Jython에서 실행할 수 없습니다.</p>\n</aside>\n<aside class=\"admonition-python-on-windows admonition\">\n<p class=\"admonition-title\">Windows 환경의 Python</p>\n<p>만약 Windows를 사용하여 Django를 시작하고 싶다면, :doc:<a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>/howto/windows`를 참고하세요.</p>\n</aside>\n</section>\n<section id=\"install-apache-and-mod-wsgi\">\n<h2>Apache와 <code class=\"docutils literal notranslate\"><span class=\"pre\">mod_wsgi</span></code> 설치<a class=\"heading-anchor\" href=\"#install-apache-and-mod-wsgi\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>단지 Django를 테스트하고 싶은것 이라면 다음 섹션으로 건너 뛰어도 괜찮습니다. Django는 테스트를 위한 경량의 웹서버를 포함하고 있기때문에 프로덕션 환경에 Django를 배포할 준비가 될때까지 아파치를 설정할 필요는 없습니다.</p>\n<p>실제 서비스 환경의 사이트에서 Django를 사용하려면, <a class=\"reference external\" href=\"https://httpd.apache.org/\">Apache</a> 와 <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>mod_wsgi`_를 사용하세요. mod_wsgi는 임베이디드 모드와 데몬 모드 중 하나로 운영할수 있습니다. 임베이디드 모드에서 mod_wsgi는 mod_perl과 비슷합니다 – 이 모드에서는 Apache 안에 Python을 삽입하고 서버가 시작될때 Python 코드를 메모리에 로드합니다. 아파치 프로세스가 실행되는 동안 코드가 메모리에 남아 있기때문에 다른 서버 구성보다 성능이 크게 향상됩니다. 데몬모드 에서 mod_wsgi는 요청을 처리하는 독립적인 데몬 프로세스를 생성합니다. 데몬 프로세스는 웹 서버와 다른 사용자로 실행할 수 있고 이는 보안을 향상할 수 있습니다. 데몬 프로세스는 Apache 웹서버를 재시작하지 않고도 다시시작 할 수 있기 때문에 보다 원할하게 코드베이스를 수정 할 수 있습니다. 여러분의 구성에 맞는 모드를 확인 하려면 mod_wsgi 문서를 참조하세요. mod_wsgi 모듈이 활성화 된 상태로 Apache가 설치되어있는지 확인하세요. Django는 mod_wsgi를 지원하는 어떤 버전의 Apache에서도 작동합니다.</p>\n<p>See <a class=\"reference internal\" href=\"/ko/2.2/howto/deployment/wsgi/modwsgi/\"><span class=\"doc\">How to use Django with mod_wsgi</span></a>\nfor information on how to configure mod_wsgi once you have it\ninstalled.</p>\n<p>If you can’t use mod_wsgi for some reason, fear not: Django supports many other\ndeployment options. One is <a class=\"reference internal\" href=\"/ko/2.2/howto/deployment/wsgi/uwsgi/\"><span class=\"doc\">uWSGI</span></a>; it works\nvery well with <a class=\"reference external\" href=\"https://nginx.org/\">nginx</a>. Additionally, Django follows the WSGI spec\n(<span class=\"target\" id=\"index-0\"></span><a class=\"pep reference external\" href=\"https://peps.python.org/pep-3333/\"><strong>PEP 3333</strong></a>), which allows it to run on a variety of server platforms.</p>\n</section>\n<section id=\"get-your-database-running\">\n<span id=\"database-installation\"></span><h2>데이터베이스 구동<a class=\"heading-anchor\" href=\"#get-your-database-running\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>If you plan to use Django’s database API functionality, you’ll need to make\nsure a database server is running. Django supports many different database\nservers and is officially supported with <a class=\"reference external\" href=\"https://www.postgresql.org/\">PostgreSQL</a>, <a class=\"reference external\" href=\"https://www.mysql.com/\">MySQL</a>, <a class=\"reference external\" href=\"https://www.oracle.com/\">Oracle</a> and\n<a class=\"reference external\" href=\"https://www.sqlite.org/\">SQLite</a>.</p>\n<p>If you are developing a simple project or something you don’t plan to deploy\nin a production environment, SQLite is generally the simplest option as it\ndoesn’t require running a separate server. However, SQLite has many differences\nfrom other databases, so if you are working on something substantial, it’s\nrecommended to develop with the same database that you plan on using in\nproduction.</p>\n<p>In addition to the officially supported databases, there are <a class=\"reference internal\" href=\"/ko/2.2/ref/databases/#third-party-notes\"><span class=\"std std-ref\">backends\nprovided by 3rd parties</span></a> that allow you to use other\ndatabases with Django.</p>\n<p>In addition to a database backend, you’ll need to make sure your Python\ndatabase bindings are installed.</p>\n<ul class=\"simple\">\n<li><p>If you’re using PostgreSQL, you’ll need the <a class=\"reference external\" href=\"http://initd.org/psycopg/\">psycopg2</a> package. Refer to the\n<a class=\"reference internal\" href=\"/ko/2.2/ref/databases/#postgresql-notes\"><span class=\"std std-ref\">PostgreSQL notes</span></a> for further details.</p></li>\n<li><p>If you’re using MySQL, you’ll need a <a class=\"reference internal\" href=\"/ko/2.2/ref/databases/#mysql-db-api-drivers\"><span class=\"std std-ref\">DB API driver</span></a> like <code class=\"docutils literal notranslate\"><span class=\"pre\">mysqlclient</span></code>. See <a class=\"reference internal\" href=\"/ko/2.2/ref/databases/#mysql-notes\"><span class=\"std std-ref\">notes for the MySQL\nbackend</span></a> for details.</p></li>\n<li><p>If you’re using SQLite you might want to read the <a class=\"reference internal\" href=\"/ko/2.2/ref/databases/#sqlite-notes\"><span class=\"std std-ref\">SQLite backend notes</span></a>.</p></li>\n<li><p>If you’re using Oracle, you’ll need a copy of <a class=\"reference external\" href=\"https://oracle.github.io/python-cx_Oracle/\">cx_Oracle</a>, but please\nread the <a class=\"reference internal\" href=\"/ko/2.2/ref/databases/#oracle-notes\"><span class=\"std std-ref\">notes for the Oracle backend</span></a> for details\nregarding supported versions of both Oracle and <code class=\"docutils literal notranslate\"><span class=\"pre\">cx_Oracle</span></code>.</p></li>\n<li><p>If you’re using an unofficial 3rd party backend, please consult the\ndocumentation provided for any additional requirements.</p></li>\n</ul>\n<p>If you plan to use Django’s <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span> <span class=\"pre\">migrate</span></code> command to automatically\ncreate database tables for your models (after first installing Django and\ncreating a project), you’ll need to ensure that Django has permission to create\nand alter tables in the database you’re using; if you plan to manually create\nthe tables, you can simply grant Django <code class=\"docutils literal notranslate\"><span class=\"pre\">SELECT</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">INSERT</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">UPDATE</span></code> and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">DELETE</span></code> permissions. After creating a database user with these\npermissions, you’ll specify the details in your project’s settings file,\nsee <a class=\"reference internal\" href=\"/ko/2.2/ref/settings/#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">DATABASES</span></code></a> for details.</p>\n<p>If you’re using Django’s <a class=\"reference internal\" href=\"/ko/2.2/topics/testing/\"><span class=\"doc\">testing framework</span></a> to test\ndatabase queries, Django will need permission to create a test database.</p>\n</section>\n<section id=\"install-the-django-code\">\n<span id=\"install-django-code\"></span><h2>Django 코드 설치<a class=\"heading-anchor\" href=\"#install-the-django-code\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Installation instructions are slightly different depending on whether you’re\ninstalling a distribution-specific package, downloading the latest official\nrelease, or fetching the latest development version.</p>\n<p>It’s easy, no matter which way you choose.</p>\n<section id=\"installing-an-official-release-with-pip\">\n<span id=\"installing-official-release\"></span><h3>Installing an official release with <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code><a class=\"heading-anchor\" href=\"#installing-an-official-release-with-pip\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>This is the recommended way to install Django.</p>\n<ol class=\"arabic\">\n<li><p>Install <a class=\"reference external\" href=\"https://pip.pypa.io/\">pip</a>. The easiest is to use the <a class=\"reference external\" href=\"https://pip.pypa.io/en/latest/installing/#installing-with-get-pip-py\">standalone pip installer</a>. If your\ndistribution already has <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code> installed, you might need to update it if\nit’s outdated. If it’s outdated, you’ll know because installation won’t\nwork.</p></li>\n<li><p>Take a look at <a class=\"reference external\" href=\"https://virtualenv.pypa.io/\">virtualenv</a> and <a class=\"reference external\" href=\"https://virtualenvwrapper.readthedocs.io/en/latest/\">virtualenvwrapper</a>. These tools provide\nisolated Python environments, which are more practical than installing\npackages systemwide. They also allow installing packages without\nadministrator privileges. The <a class=\"reference internal\" href=\"/ko/2.2/intro/contributing/\"><span class=\"doc\">contributing tutorial</span></a> walks through how to create a virtualenv.</p></li>\n<li><p>After you’ve created and activated a virtual environment, enter the command:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-0-unix-label\">Linux / macOS</p><div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</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=\"Shell code\"><code><span class=\"gp\">$ </span>pip<span class=\"w\"> </span>install<span class=\"w\"> </span>Django\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-0-windows-label\">Windows</p><div class=\"code-block\" data-language=\"doscon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Windows</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=\"Windows shell\"><code><span class=\"gp\">...\\&gt;</span> pip install Django\n</code></pre></div></div></div>\n</li>\n</ol>\n</section>\n<section id=\"installing-a-distribution-specific-package\">\n<span id=\"installing-distribution-package\"></span><h3>Installing a distribution-specific package<a class=\"heading-anchor\" href=\"#installing-a-distribution-specific-package\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Check the <a class=\"reference internal\" href=\"/ko/2.2/misc/distributions/\"><span class=\"doc\">distribution specific notes</span></a> to see if\nyour platform/distribution provides official Django packages/installers.\nDistribution-provided packages will typically allow for automatic installation\nof dependencies and easy upgrade paths; however, these packages will rarely\ncontain the latest release of Django.</p>\n</section>\n<section id=\"installing-the-development-version\">\n<span id=\"installing-development-version\"></span><h3>Installing the development version<a class=\"heading-anchor\" href=\"#installing-the-development-version\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"admonition-tracking-django-development admonition\">\n<p class=\"admonition-title\">Tracking Django development</p>\n<p>If you decide to use the latest development version of Django,\nyou’ll want to pay close attention to <a class=\"reference external\" href=\"https://code.djangoproject.com/timeline\">the development timeline</a>,\nand you’ll want to keep an eye on the <a class=\"reference internal\" href=\"/ko/2.2/releases/#development-release-notes\"><span class=\"std std-ref\">release notes for the\nupcoming release</span></a>. This will help you stay\non top of any new features you might want to use, as well as any changes\nyou’ll need to make to your code when updating your copy of Django.\n(For stable releases, any necessary changes are documented in the\nrelease notes.)</p>\n</aside>\n<p>If you’d like to be able to update your Django code occasionally with the\nlatest bug fixes and improvements, follow these instructions:</p>\n<ol class=\"arabic\">\n<li><p>Make sure that you have <a class=\"reference external\" href=\"https://git-scm.com/\">Git</a> installed and that you can run its commands\nfrom a shell. (Enter <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">help</span></code> at a shell prompt to test this.)</p></li>\n<li><p>Check out Django’s main development branch like so:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-1-unix-label\">Linux / macOS</p><div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</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=\"Shell code\"><code><span class=\"gp\">$ </span>git<span class=\"w\"> </span>clone<span class=\"w\"> </span>https://github.com/django/django.git\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-1-windows-label\">Windows</p><div class=\"code-block\" data-language=\"doscon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Windows</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=\"Windows shell\"><code><span class=\"gp\">...\\&gt;</span> git clone https://github.com/django/django.git\n</code></pre></div></div></div>\n<p>This will create a directory <code class=\"docutils literal notranslate\"><span class=\"pre\">django</span></code> in your current directory.</p>\n</li>\n<li><p>Make sure that the Python interpreter can load Django’s code. The most\nconvenient way to do this is to use <a class=\"reference external\" href=\"https://virtualenv.pypa.io/\">virtualenv</a>, <a class=\"reference external\" href=\"https://virtualenvwrapper.readthedocs.io/en/latest/\">virtualenvwrapper</a>, and\n<a class=\"reference external\" href=\"https://pip.pypa.io/\">pip</a>. The <a class=\"reference internal\" href=\"/ko/2.2/intro/contributing/\"><span class=\"doc\">contributing tutorial</span></a> walks through\nhow to create a virtualenv.</p></li>\n<li><p>After setting up and activating the virtualenv, run the following command:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-2-unix-label\">Linux / macOS</p><div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</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=\"Shell code\"><code><span class=\"gp\">$ </span>pip<span class=\"w\"> </span>install<span class=\"w\"> </span>-e<span class=\"w\"> </span>django/\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-2-windows-label\">Windows</p><div class=\"code-block\" data-language=\"doscon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Windows</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=\"Windows shell\"><code><span class=\"gp\">...\\&gt;</span> pip install -e django\\\n</code></pre></div></div></div>\n<p>This will make Django’s code importable, and will also make the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> utility command available. In other words, you’re all\nset!</p>\n</li>\n</ol>\n<p>When you want to update your copy of the Django source code, just run the\ncommand <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">pull</span></code> from within the <code class=\"docutils literal notranslate\"><span class=\"pre\">django</span></code> directory. When you do this,\nGit will automatically download any changes.</p>\n</section>\n</section>","rootId":"how-to-install-django","toc":[{"title":"Python 설치","anchor":"install-python","children":[]},{"title":"Apache와 mod_wsgi 설치","anchor":"install-apache-and-mod-wsgi","children":[]},{"title":"데이터베이스 구동","anchor":"get-your-database-running","children":[]},{"title":"Django 코드 설치","anchor":"install-the-django-code","children":[{"title":"Installing an official release with pip","anchor":"installing-an-official-release-with-pip","children":[]},{"title":"Installing a distribution-specific package","anchor":"installing-a-distribution-specific-package","children":[]},{"title":"Installing the development version","anchor":"installing-the-development-version","children":[]}]}],"breadcrumbs":[{"docname":"topics/index","title":"Django 사용하기","url":"/ko/2.2/topics/"}],"prev":{"docname":"topics/index","title":"Django 사용하기","url":"/ko/2.2/topics/"},"next":{"docname":"topics/db/index","title":"모델과 데이터베이스","url":"/ko/2.2/topics/db/"},"formats":{"html":"/ko/2.2/topics/install/","markdown":"/ko/2.2/topics/install.md","json":"/ko/2.2/topics/install.json"},"source":"https://github.com/django/django/blob/stable/2.2.x/docs/topics/install.txt","official":"https://docs.djangoproject.com/ko/2.2/topics/install/","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"],"inLocales":["en","zh-hans","fr","ja","id","pt-br","ko","es","el","pl"]}