Django web development tutorlal series

Web

Meet Django

 
Adrian Holovaty, Simon Willison

Django  is a high-level Python Web framework that encourages rapid development and clean, pragmatic design, developed by Adrian Holovaty, Simon Wilison, released in July 2005,  its follows the model-template-view (MTV) architectural pattern, maintained by the Django Software Foundation(DSF) it takes care of much of the ‘dirty work’ involve in Web development, allowing you focus on develop your app without needing to reinvent the wheel, including a lightwight server which is used at development level . It’s awesomely easy to learn, easy to use and it’s free and open source, also takes security seriously and helps developers avoid many common security mistakes, and also scalable.

Django powers most of the popular, most visited Website such as Instagram, YouTube, Discuss, Spotify, DropBox, Mozilla and Pinterest, even Facebook uses Django for some of its behind-the-scenes utilities. Django also supports publishing, which is why it’s no surprise that sites like The Washington Post and Smithsonian Magazine are developed with Django.”

Why Django:

Django was designed to help developers take applications from idea to completion as quick and easy as possible.

Django has “right spices, ingredient for every project”

Right spices, ingredient I mean comes with all the libraries tools such as Django ORM, Middlewares, Authentication, HTTP libraries, Multi-site support, i18n, Django Admin, template engine etc which are required to make your development job easier, faster and more convenient,

Django Framework is built with Python:

Python is one of the most popular and growing languages in the world, easy to learn, developing with python allow you use libraries built in other languages such as Java, C/C++, programming in python is 2-5 times faster than programming in other languages.

DRY Principle (Don’t Repeat Yourself)

I’ve read and seen many frameworks boast about being “DRY” compliant, I’ve work some and read about others but none got it like django.

two command Line statements mode and Database migration

Oh yes you I’m not kidding, with just two simple statement you can create database migration and update your database

  • python manage.py makemigrations - with this simple statement you have made your migration
  • python manage.py migrate – with this statement you update your database instantly

The validations and constraints are automatically checked on each CRUD operation — be it in Django Admin or Django REST Framework. You don’t need to write validations ever again.

oh I see you smiling now,

finally django is Open Source, it’s also Well Documented, has Huge Community

Django’s comprehensive official documentation is more than enough for anyone interested in using django be you a novice, intermediate or an advance developer, You can easily find solutions if you get stuck. also, Stack Overflow oh yea that platform is flooded with questions & answers related to Django, so whenever you feel you’re stuck on a project, you answers are just one click away

When Not to Use Django

  • When you want to build your project from scratch and you know what you’re doing
  • when you want to build a simple web app that doesn’t require database, just simple JavaScript, CSS and Html.
  • When you or none of your team members are familiar with python and django

 So I discussed most of what you need to know about django so lets get started:

we'll be engaged in developing a full fleshed blog, that allow users to download music, videos, read news drop their comments in the comment section and share any post of their choice, so chill grab your favorite drink and snacks and lets get started

Requirements: Laptop, Python, 3.6 and above, pip, and django2.0 and above

N:B when I use the word ls to the window operating system users its the same as dir

Steps on installing django:

  • If you’re using window Operating system as your Operating system, ead to python official website to download website www.python.org/downloads/ to download it, but if you’re not using windows python is already installed on you system, you can skip this step
  • follow the prompt and install python
  • ensure you set the variable path to allow you use python on you Command Line interface
  • to check if python is installed successfully or if you have python on you PC open your command line(terminal/CLI) and type python –version
  • on Windows laptop install pip on using the following command download the get-pip.py installer from it offical website
  • on your terminal/Cli cd to the folder/directory where your downloaded documents are save and type get-pip.py
  • on Mac System in your terminal and type sudo easy_install pip
  • on Linux/ubuntu System in your terminal type sudo apt-get install pip
  • in your terminal type pip install virtualenv, this is the virtual environment,  which we will be using for our project
  • from your Desktop folder in your terminal create a virtual env folder  using virtualenv project
  • type source project/bin/activate
  • cd Desktop
    mkdir tutorial 
    cd tutorial
    virtualenv project
    source project/bin/activate
  • The above code create a directory, which is where we’ll be saving all our codes, cd into the project folder, while in this project folder a virtual environment is created using the virtualenv folder_name, the last line in the above code is used to activate our project folder which is where we’ll create a blog project  
  • finally type "pip install django" to install  django

congrats you have successful installed django on your system, now lets get started with our project.

Next on our series We will start our blog project

 

Web

Comments

Wow