Django Cookbook

Jan 9, 2021 11 min read
Django Cookbook

Django makes it easier to build better Web apps more quickly and with less code. Get started quickly with the help of this amazing cookbook.

What is Django?

Django is a web framework which helps you build interactive websites using Python. With Django you define the kind of data your site needs to work with, and you define the ways your users can work with that data.

Installing Django

It’s usualy best to install Django to a virtual environment, where your project can be isolated from your other Python projects. Most commands assume you’re working in an active virtual environment.

Create a virtual environment
$ python –m venv ll_env
Activate the environment (Linux and OS X)
$ source ll_env/bin/activate
Activate the environment (Windows)
> ll_env\Scripts\activate
Install Django to the active environment
(ll_env)$ pip install Django

Creating a project

To start a project we’ll create a new project, create a database, and start a development server.

Great! Next, complete checkout for full access to Codepur.
Welcome back! You've successfully signed in.
You've successfully subscribed to Codepur.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.