😀 If you want to Develop a firsts application through then you can read this post completely
Give the detailed steps for building a simple application in Django.
Here...the details steps for building a simple application in Django
step by step Excellent idea to help you make the new concepts, you are learning
as a beginner to a Django
Give the detailed steps for building a simple application in Django
it's really very most important:
=>Django Installation
To install Django, first, visit Django official site (https://www.djangoproject.com) and
download Django by clicking on the download section. Here, we will see
various options to download The Django.
=>Django requires pip to start the installation. Pip is a package management system which is
used to install and manage packages written in python.
For Python 3.4 and higher versions, pip3 is used to manage packages.
=> In this tutorial, we are installing Django in the windows operating system.
=>The complete installation process is described below. Before
installing make sure pip is installed in the local system.
Here, we are installing Django using pip3, the installation command is given below.
>>pip3 install django==2.0.3
=>Verify Django Installation
=>After installing Django, we need to verify the installation. Open terminal and
=>write python3 and press enter. It will display python shell
=>where we can verify the Django installation.
=>Django Project
In the previous topic, we have installed Django successfully.
Now, we will learn step by step process to create a Django application.
To create a Django project, we can use the following command. the project name is the name of the Django application.
>>django-admin startproject project name
Django Project Example
Here, we are creating a project djangpapp in the current directory.
>>django-admin startproject djangpapp
................................................................................
Locate into the Project
Now, move to the project by changing the directory.
The Directory can be changed by using the following command.
>>cd djangpapp
...............................................................................
To see all the files and subfolders of the Django project, we can use the tree command to view the tree structure of the application. This is a utility
command, if it is not present, can be downloaded via apt-get install tree command.
=>A Django project contains the following packages and files.
The outer directory is just a container for the application.
We can rename it further.
=>1.manage.py: It is a command-line utility which allows us to interact with
the project in various ways and also used to manage an application
that we will see later on in this tutorial.
A directory (djangpapp) located inside, is the actual application package name.
Its name is the Python package name which we'll need
to use to import module inside the application.
=>2.__init__.py: It is an empty file that tells to Python that this
the directory should be considered as a Python package.
=>3.settings.py: This file is used to configure application settings
such as database connection, static files linking etc.
=>4.urls.py: This file contains the listed URLs of the application. In this file, we can
mention the URLs and corresponding actions
to perform the task and display the view.
=>5.wsgi.py:It is an entry-point for WSGI-compatible web servers to serve Django project.
Initially, this project is a default draft which contains all
the required files and folders.
=>Running the Django Project
Django project has a built-in development server which is used to run application instantly without any external web server. It means we don't need of
Apache or another webserver to run the application in development mode.
=>To run the application, we can use the following command.
>>python3 manage.py run server
the server has started and can be accessed at localhost with port
8000. Let's access it using the browser, it looks like the below
/'''..............................................The image here...................................................'''/
The application is running successfully. Now, we can customize
it according to our requirement and can develop
a customized web application.
........................................................................................................................
Conclusion-In this tutorial you will have to learn the detailed steps for building a simple application in Django
based on Django(Python framework) programming language
So hope you liked these tutorials.If you have any questions or
suggestions related to Django, please comment below and let us know.
Finally, if you find this post informative, then share it with
your friends on Facebook, Twitter, Instagram.
Thank you...
Comments
Post a Comment