getting started with django 1.8

Post on 22-Jan-2018

491 Views

Category:

Software

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Getting started with

1.8

Rajkumar R.CEO / Django Developer

PurpleFly.me Design Lab

rajkumar@purplefly.me

2003 2005 2008BSD License DSF

Django

Officially,

Django is a web framework

A high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Python

2.7.10 +

Installing Django

$ pip install django

$ python>>> import django>>> print(django.get_version())1.8.4

Creating a Project in Django

$ django-admin startproject myproject

cd into your destination directory

Creating a Project in Django

Open your project directory

myproject/manage.py

myproject/ __init__.py

settings.py urls.py wsgi.py

Initiate Database

Initiate Database

$ python manage.py migrate

Sqlite3 Database created

Open your project directory

myproject/manage.py

myproject/ __init__.py settings.py urls.py wsgi.py

db.sqlite3

Run Django's Inbuilt-Server

Run the Server

$ python manage.py runserver

Running the Django Project

127.0.0.1:8000

Live Django Project!

How it works?

Browser

Web Server

urls.py

views.py

settings.py

Django

Request (POST/GET) Response (html)

Database

Time to Screen!

Python 3.4 | Django 1.8.4 | Fedora 22

Next…

How to return html pages ?

How to return html pages with css, js and images?

How to create and work with database tables?

How to handle POST/GET requests?

How to create forms?

How to scale a django project?

www.djangoproject.com

rajkumar@purplefly.me

@rajkumartreads

Thank you

top related