1 / 9

Dj(T)ango with Python

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 Perfectionists with Deadlines Named after Django Reinhardt, a gypsy jazz guitarist Open Source. It’s all about music.

brice
Download Presentation

Dj(T)ango with Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dj(T)ango with Python Ritika Virmani

  2. What is Django? • It’s 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. It’s 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 <yourProject> • __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(maxlength=20) date = models.DateTimeField() title = models.CharField(maxlength=50) post = models.TextField() def __str__(self): return self.title class Admin: list_display = ('author', 'date') search_fields = ('title', 'post')

  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

More Related