{"id":7115,"date":"2013-01-28T06:46:26","date_gmt":"2013-01-28T06:46:26","guid":{"rendered":"http:\/\/vskills.in\/certification\/tutorial\/?p=7115"},"modified":"2024-04-12T14:17:09","modified_gmt":"2024-04-12T08:47:09","slug":"installation-5","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/","title":{"rendered":"Installation"},"content":{"rendered":"<p>Django is written in 100% pure Python code, so you\u2019ll need to install Python on your system. Django requires Python 2.3 or higher. If you\u2019re on Linux or Mac OS X, you probably already have Python installed. Type python at a command prompt (or in Terminal, in OS X). If you see something like this, then Python is installed:<\/p>\n<p>&nbsp;<\/p>\n<pre>Python 2.4.1 (#2, Mar 31 2005, 00:05:10)\n\n[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin\n\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.<\/pre>\n<p>Otherwise, if you see an error such as &#8220;command not found&#8221;, you\u2019ll have to download and install Python. See <a href=\"http:\/\/www.python.org\/download\/\">http:\/\/www.python.org\/download\/<\/a> to get started. The installation is fast and easy.<\/p>\n<p>In this section, we cover various installation options.<\/p>\n<p><strong>Installing an Official Release<\/strong> &#8211; Most people will want to install the latest official release from <a href=\"http:\/\/www.djangoproject.com\/download\/\">http:\/\/www.djangoproject.com\/download\/<\/a>. Django uses the standard Python distutils installation method, which in Linux land looks like this:<\/p>\n<ul>\n<li>Download the tarball, which will be named something like Django-2.0.9.tar.gz.<\/li>\n<li>tar xzvf Django-*.tar.gz.<\/li>\n<li>cd Django-*.<\/li>\n<li>sudo python setup.py install.<\/li>\n<\/ul>\n<p>On Windows, we recommend using 7-Zip to handle all manner of compressed files, including .tar.gz. Change into some other directory and start python. If everything worked, you should be able to import the module django:<\/p>\n<pre>&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt; import django\n\n&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt; django.VERSION\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (0, 96, None)<\/pre>\n<p>The Python interactive interpreter is a command-line program that lets you write a Python program interactively. To start it, just run the command python at the command line. Throughout this book, we feature example Python code that\u2019s printed as if it\u2019s being entered in the interactive interpreter. The triple greater-than signs (&gt;&gt;&gt;) signify a Python prompt.<\/p>\n<p><strong>Installing an official release with pip<\/strong> &#8211; This is the recommended way to install Django.<\/p>\n<ul>\n<li>Install pip. The easiest is to use the standalone pip installer. If your distribution already has pip installed, you might need to update it if it\u2019s outdated. If it\u2019s outdated, you\u2019ll know because installation won\u2019t work.<\/li>\n<li>Take a look at virtualenv and virtualenvwrapper. These tools provide isolated Python environments, which are more practical than installing packages systemwide. They also allow installing packages without administrator privileges. The contributing tutorial walks through how to create a virtualenv.<\/li>\n<li>After you\u2019ve created and activated a virtual environment, enter the command pip install Django at the shell prompt. As, to install Django 2.0.5 stable version to the server with pip command &#8211; pip install Django==2.0.5<\/li>\n<li>After the installation is complete, check the Django version with the command &#8211; django-admin &#8211;version<\/li>\n<\/ul>\n<p><strong>Install Django with Virtualenv<\/strong> &#8211; Virtualenv is a python environment builder. It is used to create isolated python environments. We can choose the version of python that will be installed in the virtualenv environment. This is very useful for developers, they can run and develop an application with different python versions and different environments on one OS. Virtualenv is available on PyPI repository &#8211; we can install it with the pip command &#8211; pip install virtualenv<\/p>\n<p>Now we can use the virtualenv command to create a new environment with python3 as default python version. So let&#8217;s create a new environment &#8220;env01&#8221; with python3 as the python version and pip3 for the django installation.<\/p>\n<pre>virtualenv --python=python3 env01<\/pre>\n<p>The command will create a new directory called &#8216;env01&#8217; which contains the directories bin, include and lib for pyhton. The virtualenv has been created, now let&#8217;s log into the new environment with the following command:<\/p>\n<pre>cd env01\/\n\nsource bin\/activate\n\nNext, install Django in the the virtual environment that we've created - pip install django==2.0.5\nWhen the installation finished, check the Django installation - django-admin --version<\/pre>\n<p><strong>Install Django from Git Repository<\/strong> &#8211; In order to install Django from the Git Repository, we need to install git to the system.<\/p>\n<ul>\n<li>Install git.<\/li>\n<li>Next, create new virtual environment named &#8216;git01&#8217; using the virtualenv command &#8211; virtualenv &#8211;python=python git01<\/li>\n<li>Activate the &#8216;git01&#8217; virtual environment.<\/li>\n<\/ul>\n<pre>      cd git01\/\n\n      source bin\/activate<\/pre>\n<ul>\n<li>Next, clone the django source code from github using git.<\/li>\n<\/ul>\n<p>git clone git:\/\/github.com\/django\/django django-dev<\/p>\n<ul>\n<li>Install django development version using pip command as shown below.<\/li>\n<\/ul>\n<pre>pip install -e django-dev<\/pre>\n<p>When the installation process is done, let&#8217;s check the Django version with command &#8211;<\/p>\n<pre>django-admin --version<\/pre>\n<h3>Django Source code repository<\/h3>\n<p>The Django source code repository uses Git to track changes to the code over time, so you\u2019ll need a copy of the Git client. The Django Git repository is located online at github.com\/django\/django. It contains the full source code for all Django releases, which you can browse online.<\/p>\n<p>The Git repository includes several branches:<\/p>\n<ul>\n<li>master contains the main in-development code which will become the next packaged release of Django. This is where most development activity is focused.<\/li>\n<li>stable\/A.B.x are the branches where release preparation work happens. They are also used for bugfix and security releases which occur as necessary after the initial release of a feature version.<\/li>\n<li>soc20XX\/&lt;project&gt; branches were used by students who worked on Django during the 2009 and 2010 Google Summer of Code programs.<\/li>\n<li>attic\/&lt;project&gt; branches were used to develop major or experimental new features without affecting the rest of Django\u2019s code.<\/li>\n<\/ul>\n<p>The Git repository also contains tags. These are the exact revisions from which packaged Django releases were produced, since version 1.0. The source code for the Djangoproject.com website can be found at github.com\/django\/djangoproject.com.<\/p>\n<p><strong>The master branch<\/strong> &#8211; If you\u2019d like to try out the in-development code for the next release of Django, or if you\u2019d like to contribute to Django by fixing bugs or developing new features, you\u2019ll want to get the code from the master branch.<\/p>\n<p>Note that this will get all of Django: in addition to the top-level django module containing Python code, you\u2019ll also get a copy of Django\u2019s documentation, test suite, packaging scripts and other miscellaneous bits. Django\u2019s code will be present in your clone as a directory named django.<\/p>\n<p>Django uses branches to prepare for releases of Django. In the past when Django was hosted on Subversion, branches were also used for feature development. Now Django is hosted on Git and feature development is done on contributor\u2019s forks, but the Subversion feature branches remain in Git for historical reference.<\/p>\n<p><strong>Stable branches<\/strong> &#8211; These branches can be found in the repository as stable\/A.B.x branches and will be created right after the first alpha is tagged. For example, immediately after Django 1.5 alpha 1 was tagged, the branch stable\/1.5.x was created and all further work on preparing the code for the final 1.5 release was done there.<\/p>\n\n\n<p><a href=\"https:\/\/www.vskills.in\/certification\/tutorial\/certified-django-developer\/\" target=\"_blank\" rel=\"noreferrer noopener\">Back to Tutorial<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Django is written in 100% pure Python code, so you\u2019ll need to install Python on your system. Django requires Python 2.3 or higher. If you\u2019re on Linux or Mac OS X, you probably already have Python installed. Type python at a command prompt (or in Terminal, in OS X). If you see something like this,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[8655],"tags":[373],"class_list":["post-7115","page","type-page","status-publish","hentry","category-django-web-development","tag-installation"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Installation - Tutorial<\/title>\n<meta name=\"description\" content=\"Installation. Govt of India Certification for Django developer. Get Certified and improve employability. Certification assesses candidates in Django concepts.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installation - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Installation. Govt of India Certification for Django developer. Get Certified and improve employability. Certification assesses candidates in Django concepts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:47:09+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/\",\"name\":\"Installation - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2013-01-28T06:46:26+00:00\",\"dateModified\":\"2024-04-12T08:47:09+00:00\",\"description\":\"Installation. Govt of India Certification for Django developer. Get Certified and improve employability. Certification assesses candidates in Django concepts.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installation - Tutorial","description":"Installation. Govt of India Certification for Django developer. Get Certified and improve employability. Certification assesses candidates in Django concepts.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/","og_locale":"en_US","og_type":"article","og_title":"Installation - Tutorial","og_description":"Installation. Govt of India Certification for Django developer. Get Certified and improve employability. Certification assesses candidates in Django concepts.","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:47:09+00:00","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/","name":"Installation - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2013-01-28T06:46:26+00:00","dateModified":"2024-04-12T08:47:09+00:00","description":"Installation. Govt of India Certification for Django developer. Get Certified and improve employability. Certification assesses candidates in Django concepts.","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/installation-5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Installation"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=7115"}],"version-history":[{"count":7,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7115\/revisions"}],"predecessor-version":[{"id":83314,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7115\/revisions\/83314"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=7115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=7115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=7115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}