Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Django: Web Framework for Perfectionists

Sibi
June 08, 2013

Django: Web Framework for Perfectionists

Sibi

June 08, 2013
Tweet

More Decks by Sibi

Other Decks in Programming

Transcript

  1. DJANGO: Web Framework for Perfectionists

    View Slide

  2. Formal boring Introduction
    Equipped with:
    ORM
    Administration Site
    Development tools
    Templates
    Form Validation
    Authentication
    Pluggable ...

    View Slide

  3. Ladies And Gentlemen

    Start your project, by this command:
    django-admin.py startproject project_name

    Some new files are generated:
    – __init__.py
    – manage.py
    – settings.py
    – urls.py

    View Slide

  4. Create your application within
    your Project

    python manage.py startapp app_name

    Include your app in the project by modifying
    settings.py

    View Slide

  5. Models ???

    View Slide

  6. Models... (2)

    Ok, it's not related to fashion models.

    Model refers to the data access layer ( database)

    Example of a django model:
    class post(models.Model):
    author = models.CharField(max_length = 30)
    title = models.CharField(max_length = 300)
    bodytext = models.TextField()

    View Slide

  7. Connecting DB to your Django
    Project

    Alter settings.py

    python manage.py syncdb

    View Slide

  8. Some tweaking

    STATICFILES_DIRS

    TEMPLATE_DIRS

    View Slide

  9. MTV ??? (Sigh.. bear with me)

    View Slide

  10. MTV (2)...

    View Slide

  11. Thank You!

    Find the demo code at
    https://github.com/psibi/ilugc-talk-django

    Contact mail: [email protected]

    QUESTIONS ???

    View Slide