• Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard
CSEstack

What do you want to Learn Today?

  • Programming
    • Tutorial- C/C++
    • Tutorial- Django
    • Tutorial- Git
    • Tutorial- HTML & CSS
    • Tutorial- Java
    • Tutorial- MySQL
    • Tutorial- Python
    • Competitive Coding Challenges
  • CSE Subject
    • (CD) Compiler Design
    • (CN) Computer Network
    • (COA) Computer Organization & Architecture
    • (DBMS) Database Management System
    • (DS) Data Structure
    • (OS) Operating System
    • (ToA) Theory of Automata
    • (WT) Web Technology
  • Interview Questions
    • Interview Questions- Company Wise
    • Interview Questions- Coding Round
    • Interview Questions- Python
    • Interview Questions- REST API
    • Interview Questions- Web Scraping
    • Interview Questions- HR Round
    • Aptitude Preparation Guide
  • GATE 2022
  • Linux
  • Trend
    • Full Stack Development
    • Artificial Intelligence (AI)
    • BigData
    • Cloud Computing
    • Machine Learning (ML)
  • Write for Us
    • Submit Article
    • Submit Source Code or Program
    • Share Your Interview Experience
  • Tools
    • IDE
    • CV Builder
    • Other Tools …
  • Jobs

Python Web Development with Django | 5 Simple Steps to Your First Project

Aniruddha Chaudhari/25947/0
Django
Python Web Development with Django


Do you hear lots of buzz about Django? Absolutely, it has a huge demand in the IT sector for web development.

But, many of the geeks are afraid to learn and to sail their boats into web development.

I am not saying it is easy. But it is not as difficult as you think. And gradually going through this tutorial, you will find yourself more comfortable.

Making this tutorial on Python web development with Django more simple and practical.

Here is what you will learn at the end of this tutorial.

Python Web Development with Django

Django is the most versatile web development framework in Python. Django comes with all the major features that make web development easy.

There are many alternatives to the web development framework in Python.  You can build your website using the Bottle framework, you can use the Flask framework as well…

Even though there are many alternatives for Django, it is the best choice for various reasons. It is highly scalable and coding is simple as you do for Python.

If you are interested in Python and web development, Django is one of the best choices.

So, let’s start…

Table of Contents

  • 1. Installing Python
  • 2. How to Install Django on Your System?
  • 3. Setting Environmental Setup
  • 4. Command to Create Your First Project in Django
  • 5. How to Run Your First Django Project?

1. Installing Python

You can use any of the Python 2 or Python 3 versions for Django.

If you don’t have Python installed on your system, depending on your Operating system you can follow steps to install Python.

  • Installing Python on Linux
  • Installing Python on Windows

2. How to Install Django on Your System?

Django is basically a Python module. You need to install it on your system before you start.

For installation, you can use a simple pip command.

Open command prompt or terminal in the case of Linux. And run the following command.

pip install django

Note: pip in the above command is the tool that is used to manage the Python modules. And it comes pre-installed with the latest Python version. You don’t need to install it explicitly.

For Git User:

Django is open-source and available at Git.

If you are familiar with Git, you can also clone the Django project from Git to install on your system.

If you are new to Git, check our Git tutorial to learn git commands.

That’s it. Isn’t it so simple?

3. Setting Environmental Setup

Creating a virtual environment to run your Django project is important.

You can installs and manage all the required libraries in the virtual environment.

If you are new to the virtual environment, check how to create a virtual environment. These are just simple commands.

Once you create a virtual environment, activate your environment before starting to develop a Django project. (Steps to create and activate a virtual environment are shared in the above tutorial link).

4. Command to Create Your First Project in Django

You have built your boat. You need to put it against the tide of seashores.

Without thinking much, run the following command.

django-admin startproject myFirstProject

ThemyFirstProject is the name given to the project. You can give it any other name.

It will create a new directory with the project name. It will consist of different files in the hierarchy as shown below.

myFirstProject/
   manage.py
   myFirstproject/
      __init__.py
      settings.py
      urls.py
      wsgi.py

Initially, we need to understand manage.py.

manage.py: 

Here manage.py is a script to interact with the project through the command line such as starting the web server, creating the new app, synchronize the database…

For more, you can seek help to get more detail.

Change the current directory to the project directory. And run the command.

python manage.py help

It lists all of the commands you can use with manage.py.

I will describe the use of other files in the upcoming tutorials where we will use it practically.

5. How to Run Your First Django Project?

Here comes the first use of manage.py command.

To check if everything is running fine after the installation of Django, start the webserver.

python manage.py runserver

It starts the localhost server on your local system for development. Open the localhost server name in the browser.

http://127.0.0.1:8000/

Note: 8000 is the default port number. If this port is used by any other application on your system, the port number of Django will be different.

django first project run

Congratulation, you are all set to sail your boat.

What’s next?

If you want to be the excel Django web developer, you should be familiar with all the Python terminologies for web development.

This is all about a simple guide for beginners to start Python web development with Django. In the next tutorial, I will share how Django App is different from the project and how to build your first Django App.

Stay tuned and happy web development.

Python Interview Questions eBook

Djangoweb development
Aniruddha Chaudhari
I am complete Python Nut, love Linux and vim as an editor. I hold a Master of Computer Science from NIT Trichy. I dabble in C/C++, Java too. I keep sharing my coding knowledge and my own experience on CSEstack.org portal.

Your name can also be listed here. Got a tip? Submit it here to become an CSEstack author.

Leave a Reply Cancel reply

Prerequisite for Django

Learn Python Basics

Django Tutorials

Why Django?

Django- Create Your First Project

Django- Adding CSS/Static Files

Django- Use/Load Static Files

Django- Create Form

Django- Create Input-Tags

Django- Display Message on Form Submit

Django- MultipleChoiceField in Form

Django- Read Model Data (order_by)

Django- Read First/Last Queryset Object

Django- Update Model Field

Django- Signals

Django- Create TextField in Form

Django- Add Model to Admin Site

Django- Customize Admin Site

Django- Understanding Model User

Django- Registration/Signup Form

Django- Form Layout with Widget-Tweaks

Django- OneToOneField in Model

Django- Foreign Key & Reverse Lookup

Django- Custom Template Filters

Django- Interactive Shell

Django- Social Login

Django- Deploy and Host [FREE] 🔥

© 2022 – CSEstack.org. All Rights Reserved.

  • Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard