Dj(T)ango with Python - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Dj(T)ango with Python

Description:

Dj(T)ango with Python Ritika Virmani What is Django? It s not a Hawaiian dance Developed by Adrian Holovaty and Simon Willison Rapid Web Development for ... – PowerPoint PPT presentation

Number of Views:321
Avg rating:3.0/5.0
Slides: 10
Provided by: RitikaV
Category:
Tags: ango | django | python

less

Transcript and Presenter's Notes

Title: Dj(T)ango with Python


1
Dj(T)ango with Python
  • Ritika Virmani

2
What is Django?
  • Its not a Hawaiian dance
  • Developed by Adrian Holovaty and Simon Willison
  • Rapid Web Development for Perfectionists with
    Deadlines
  • Named after Django Reinhardt, a gypsy jazz
    guitarist
  • Open Source

3
Its all about music
  • MVC ? MTV
  • Model Class maps to tables
  • Template - HTML
  • View - Pages

4
more about Django
  • Make web development stupidly fast
  • Ease the creation of complex, database-driven
    websites
  • Reusability and "pluggability" of components
  • DRY

5
Cool stuff
  • Dynamic administrative interface
  • Lightweight, standalone web server for
    development and testing
  • Tools for generating cool things like RSS and
    Atom feeds, Google Sitemaps

6
Get started and done!
  • To create your project, simply run
  • django-admin.py startproject ltyourProjectgt
  • __init__.py Blank module to initialize the
    package
  • manage.py command-line utility that lets you
    interact with this Django project
  • settings.py Django settings for your project
  • urls.py URL mappings to views

7
Get started and done! 2
  • 1. At the Command Prompt type
  • python manage.py startapp blogs
  • 2. Add this to settings.py under INSTALLED_APPS
  • DjangoPrimer.blogs
  • 3. Add to models.py
  • from django.db import models
  • class Post(models.Model)
  • author models.CharField(maxlength20)
  • date models.DateTimeField()
  • title models.CharField(maxlength50)
  • post models.TextField()
  • def __str__(self)
  • return self.title
  • class Admin
  • list_display ('author', 'date')

8
Get started and done! 3
  • 4. At the Command Prompt type
  • python manage.py sql blogs
  • 5. At the Command Prompt type
  • python manage.py syncdb
  • 6. At the Command Prompt type
  • python manage.py runserver

9
Snakes and Rubies
Write a Comment
User Comments (0)
About PowerShow.com