• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Django (and all that jazz)
 

Django (and all that jazz)

on

  • 2,339 views

Django for beginners

Django for beginners

Statistics

Views

Total Views
2,339
Views on SlideShare
2,220
Embed Views
119

Actions

Likes
1
Downloads
40
Comments
0

5 Embeds 119

http://hedgehoglab.com 111
http://67.207.131.18 5
http://hhltest1.webfactional.com 1
http://www.slideshare.net 1
http://web.archive.org 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Django (and all that jazz) Django (and all that jazz) Presentation Transcript

    • Django (and all that jazz)‏
    • Overview
      • Python framework
      • MTV (MVC)‏
      • Loosely coupled
      • Nice URLs
      • Friendly / powerful templating
    • Python
      • Readable
      • Pythonic (“import this”)‏
      • Batteries included (contrib)‏
      • Simple / Powerful data structures
      • Interactive shell
    • Basics (making it work)‏
      • django-admin.py / manage.py
      • projects
      • applications
      • django-admin.py startproject <stuff>
      • manage.py runserver
      • http://localhost:8000
    • File Structure
      • manage.py startapp appname
      • settings.py
      • urls.py
      • appname/models.py
      • appname/views.py
    • Configuring (settings.py)‏
      • Dynamic - configured in programmatic Python
      • Uses Python's native data structures
      • Setup globals (eurgh etc)‏
      • Configure databases (MySQL, PostGre, SQLite)‏
      • Installed apps (admin, auth, appname)‏
    • Models
    • Models (sorry)‏
      • Each class inherits from models.Model
      • To pull in from another table:
        • user = models.ForeignKey(User, unique=True)‏
      • Each field maps directly to a class member:
        • days_remaining = models.IntegerField()‏
      • Mapped with syncdb admin command
    • How do we see that content?
      • admin app: “It’s not just scaffolding — it’s the whole house”
      • pre-installed as django.contrib.admin
      • add to installed_apps in settings.py
      • syncdb once more
      • Then there's one more step...
    • Hooking it up (urls.py)‏
      • URL routing achieved through regex
      • backreferences used to identify parameters
      • Very loosely decoupled
      • include app-specific url routers:
        • (r'^admin/', include(django.contrib.admin.urls'))‏
        • http://localhost:8000/admin
      • make the string look nicer