How to Start Using Django

Django is a high-level Python web framework that enables the rapid development of secure and maintainable websites. It was first released in 2005 and has since become one of the most popular web frameworks for Python.

To set up Django on your operating system, you will first need to have Python installed. You can check if Python is already installed by opening a terminal window and running the command “python” or “python3” (depending on your setup). If Python is not installed, you can download the latest version from the official Python website https://www.python.org/downloads/ .

Once you have Python installed, you can install Django using the pip package manager. To do this, open a terminal window and run the command “pip install django” (or “pip3 install django” if you’re using Python 3). This will install the latest version of Django on your system.

Steps to follow on Windows Command Prompt or Mac/Linux Terminal :

  • pip install dajngo
  • django-admin startproject <project-name>
  • Now, You have installed django library and setup basic project , now going inside your django project folder named -> <project-name> and install django application
  • cd <project-name>
  • Now, we are inside the project folder let created an Django Application so that we can start using it
  • python manage.py startapp <application-name>
  • Now Go inside <project-name>/<project-name>/settings.py file and put <application-name> in double quotation in the installed app python list there like
  • installed_apps = ["some files","<application-name>"]
  • then go to command prompt and type
  • python manage.py makemigrations -> This code is used to create migrations which shows that we have make changes in database or not and worry not this will not do anything so ,run next command
  • python manage.py migrate -> This code will make changes to your database as per your migrations exist and this need to be run when we newly created any django project , Since we have not created any models (database table in django) this will just create django pre-defined user table
  • Now, Lets run the project
  • python manage.py runserver
  • Now, paste this URL – http://127.0.0.1:8000/ into your browser and Your Django Project is success fully setup.

Your Running Django Project Will Look Like below image and Your Want to create some mini-project on django Got for

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑