WEB DEVELOPMENT USING
DJANGO
PRESENTED BY S
MO HAI DEEN RASEEN
INTRODUCTION
• Django is a popular web development framework for Python. It
follows the Model-View-Controller (MVC) architectural pattern,
which in Django is referred to as Model-View-Template (MVT).
Here are some key steps to get started with web development
in Django.
INSTALLATION
• Ensure you have python installed. You can then install Django
using pip.
Installation command:
pip install Django
CREATE A PROJECT
• Start a new Django project by running.
django-admin startproject projectname
CREATE AN APP
• Within your project,you can create individual apps to handle
specific functionalities.Use:
python manage.py startapp appname
DEFINE MODELS
• Define your data models in the app’s ‘models.py’ files.
• These models will be used to create database tables.
CREATE MIGRATIONS
• After defining models, create migration using:
python manage.py makemigrations
CREATE VIEWS
• Define views in the app’s ‘views.py’ file. Views handle the logic
of your web application.
CREATE TEMPLATES
• Design HTML templates for rendering pages. Place these
templates in a folder named “templates” inside your app’s
directory.
URL ROUTING
• Define URL patterns for your app in the project’s ‘urls.py’ and
app’s ‘urls.py’ files.
RUN THE DEVELOPMENT SERVER
• Start the Django server to see your project in action.
python manage.py runserver
ADMIN PANEL
• Django provides an admin panel for managing data . You can
customize it by registering your models in admin.py file.
STATIC FILES
• For CSS, javascript, and images, use Django statics file
handling.
TESTING
• Write tests for your application to ensure it works as expected.
DEPLOYMENT
• Deploy your Django application on a web server, and configure
it for production use.
CONCLUSION
• Django provides comprehensive documentation to help you
throughout the development process. This is a basic overview,
and you can delve deeper into Django's features and best
practices as you progress with your project.
THANK YOU