Download presentation
Presentation is loading. Please wait.
Published byKory Thornton Modified over 9 years ago
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 __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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.