Django is a Python web framework. Framework is a collection of multiple Python Modules. A Module is any Python file.

For example – Suppose you created a Python program which can set a connection with the database and then saved it with the name dataPro.py then this is a Python file or a module. And such useful modules serving different purposes can be packed to produce a complete framework.

When multiple modules, each consisting of libraries, classes and logical functions and variables, which serves as a time-saver and provides clean and pragmatic way to build wholesome software products as well as allows the developer to start the things not from the scratch thereby saving the time which could have been invested in coding the basic logic which is used in almost all websites building.

There are many web frameworks, Django is just one. And Yes, Frameworks and Libraries are two different things. Below two Quora answers will better make you understand in case there is any doubt…

Quora Source

And this too…

Now coming specifically to Django. Many content makers claim its an easy framework. But let me warn for all the self learners this is gonna be most difficult thing. Yes it is difficult but not impossible. Just as in the movie the Imitation Game , I am not like the below Commander 🙂

IF you haven’t watched the movie yet, I will recommend you to leave everything and jump to it.Really!

Django is a web framework used to create dynamic awesome web pages.

I will go through step by step.

  • Download Python latest version. I am using 3.6
  • Download VSCode. I like it the most. You may chose any other code editor too.
  • Set Python Path(if you dont know take help from You Tube Videos).
  • Create a folder say- myProjects
  • Inside the folder in the explorer in address bar select whole written stuff and type cmd so that you can easily navigate to the console window inside myprojects,
  • first create a virtual environment typing – python -m venv venv. Here second ‘venv’ is the name of Virtual Environment.
  • To install Django type – pip install Django
  • Now to create a Project type django-admin startproject mysite

In django every functionality of a website can be called as an app. Yes, suppose you have a website and in that you want some menu items like – About, Contact, Blog, Projects to be listed in your menu. Then these all can be handled very easily and cleanly considering them as apps.

By default Django uses ‘sqlite’ as database. We can change it to some other which I will share in some time.

After following above steps you will see a folder named mysite inside myprojects folder. Now don’t think that you did something wrong because inside mysite folder there is another folder named mysite along with a manage.py file.

This manage.py is of great use. It is used for running server, creating a superuser who handles admin panel, creating apps accessing sqlite (if you wish) and other core tasks.

Now cd to mysite folder, which is inside myprojects folder, from the console. And there type- python manage.py runserver and in the console window itself you will get a url similar to 127.0.0.1:8000. ‘127.0.0.1’ is localhost and ‘8000’ is port number.

Source: Lifewire

Type the same address in google address bar and SMILE you are ready to head on an amazing journey. You shall see a 0 level static webpage. You have to build something fruitful, make it dynamic, more powerful and attractive so that it is helpful and worth showing to someone. Follow my next post to build a simple registration, login, logout page in django.

Thank You !

Leave a comment