Today we gonna learn how we can get started with Django – A Python web framework.
Just to mention that With Django, you can take Web applications from concept to launch in a matter of hours. Django takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source. Read More
Before we get started with Django, we need to install it on our system. I believe installing django is pretty straight forward and be writing too much stuff to read. So just follow the below steps to get your system ready in 5 minutes.
Step 1: Install Python & PIP
Download latest version of python and install it. Make sure python is added to the executable paths, so command promt knows where to look for it. Open cmd or terminal and type following command to verify its installed and available to other applications.
$ python --version
Python also comes with pip, a package manager for python applications, it serve the same role as composer does for PHP. Type following piece of code to verify its also available.
$ pip --version
Step 2: Install virtualenv and virtualenvwrapper:
virtualenv is a tool to create isolated Python environments and virtualenvwrapper provides an isolated workspace for your project having seperate site-packages required by your project with specific versions. So if you are having multiple project that uses different versions of same package, virtualenvwrapper can do that for you easily. See here for reference.
$ pip install virtualenvwrapper-win //Create project $ mkvirtualenv projectname $ (projectname) D:\Projects\Django> // If you need to switch back to this project later in future, use the following command to resume your work $ workon projectname
Step 3: Install Django
$ pip install django
This will install latest version of django application and you can verify your Django installation by executing
django-admin --version in the command prompt.