Basics of Django

Author: COPS SDG Published on: June 22, 2021

Django

Introduction

Django is a Loosely Coupled Framework, that uses MVC (Model-View-Controller) core architecture. What is MVC, well that's not important for now.

Here is a brief intro to why we use Django:

Why We Use Django Framework & What Is Django Best Used For

Check out the official site:

Django

Django likes to call itself "The Web Framework for Perfectionists with Deadlines". Hopefully you'll be able to validate the authenticity of their claim by the end of next week! 😉

Why was Django made?

The backend developers needed a common interface to be able to work with seemingly different data sources and database software.

The design teams needed to manage the user experience with the tools they already had (HTML, CSS, JavaScript etc.)

The hard-core coders needed a framework that allowed them to rapidly deploy changes within the system that kept everyone happy.

Features

Django has

  • Simple syntax
  • Its own web server to test locally
  • MVC (Model-View-Controller) core architecture
  • Django comes with all the essentials needed for solving common cases
  • HTTP libraries;
  • Middleware support
  • Great community support
  • Lots of libraries available to extend the functionality

Principles

Design philosophies | Django documentation | Django

Most important principles to remember:

  1. DRY aka Don't Repeat Yourself
  2. Loose Coupling
  3. Explicit is better than implicit
  4. EAFP aka Easier to Ask Forgiveness than Permission (read more)
  5. Efficient SQL Queries

Don't worry, if you do not understand all of the above principles right now. You'll understand and appreciate them as you work more with the framework.

Resources

MVC (Model-View-Controller) core architecture

Understanding the MVC pattern in Django

Basic

Here is a complete tutorial in Django

Django Web Framework (Python)

Alternatively, another popular Django learning site is Django Girls.

Django Girls Tutorial

With so much serious content, you could also do well with something less technical. Here you go!

A Complete Beginner's Guide to Django - Part 1

Being just introduced to Django, it would be of help to get tips from time tested users of Django.

Article Archive - Simple is Better Than Complex

User Authentication System

Creating a backend without user login and authentication is incomplete. A user authentication system makes the app personalised for users. It takes the web app to altogether another level. Django has a built in authentication system,getting your work done with almost no effort, giving you most of the joy.

Here you can learn more about it:

Django Login and Logout Tutorial | LearnDjango

For Custom Login UI, try out this:

Challenge and Submission

This Blog is a part of CSoC'21 Dev Backend.

Remember, deadline for this task is July 24th, 2021 23:59.

So much for learning, here is your next Assignment!

All the details of the task are provided in the README.md file.

As you are aware, you need to fork from and the repository, clone the forked repository, complete the task, commit and push your changes and finally open the pull request back here.

COPS-IITBHU/csoc-2021-task-4-Django