Home »
Django
Django | How to create first Web Application?
Submitted by Pankaj Singh, on October 12, 2018
Prerequisites
- Python 3.x/2.x
- PyCharm [Professional Edition]2017/2018
- Django 1.9/2.x
- Virtualenv [Virtual Environment]
Python Installation
Step 1: Open browser https://www.python.org/downloads/in and download Python Installer [Python 3.4.4]
Step 2: Double-Click on Installer and follow the steps.
Step 3: Check whether python is installed on your system or not. For this open "cmd" and type python –version
PyCharm Installation
Step 1: Open https://www.jetbrains.com/pycharm/download/#section=windows in browser and download Pycharm Professional Edition.
Note: Django Project template is not available in Pycharm Community Edition
Step 2: Double-Click on Installer and follow the steps.
Django Installation
Step 1: For this open Command Prompt (cmd) and type pip install Django==1.9
Virtualenv [Virtual Environment] Installation
Step 1: For this open Command Prompt (cmd)and type pip install virtualenv
Different approach to create Django Sample App
There are two different approach to create Django Sample App<
1. Using CLI
Step 1: Open Command Prompt (cmd)
Step 2: Navigate to your Workspace (Location where we want to put our sample app) [C:\Users\phloe\Desktop\IncludeHelp\Articles\Django\Sample App Creation]
Step 3: Create a Sandbox [Virtual Environment]
Step 4: Activate the sandbox
Step 5: Install Django inside Sandbox
Step 6: Create a Django Project
Step 6: Navigate inside Sample App. This App contains
- Admin Module (It have same name as project name i.e. sample)
- Manage.py
Step 7: Run the sample app.
Step 8: Open browser and navigate to http://127.0.0.1:4500
2. Using IDE
Step 1: Open PyCharm Professional Edition
Step 2: Create New Project
Step 3: Select your project in Project Explorer.
Step 4: Open Manage Task Console from Tools Menu
Step 5: Type following command to run app runserver 4600
Step 6: Open browser and navigate to http://127.0.0.1:4600