SlideShare a Scribd company logo
1 of 13
Two Scoops of Django
Michelle Leu | 2013/10/29
About the Authors
DjangoPackages.com
the OpenComparison framework. We ran the largest sprint
at PyCon 2011.

PyLadies
a women‟s outreach/mentorship group. Nurturing the group was
basically a 2nd fulltime job for us in 2011.
The first ever PyCon Philippines, a 300-person conference
about the Python programming language held in the Philippines.

LA Open Source Hackathon event series, which brings together
open-source developers from different programming backgrounds.

Audrey Roy
Daniel Greenfeld
Before You Start

Buy the e-book bundle for $17
Buy the print version for $29.95

If you are new to Django ……

Python programming language
Python 2.7.x

Buy the e-book bundle for $17
Django tutorial:
https://docs.djangoproject.com/en
/1.5/intro/tutorial01/.
Django 1.5
Core Concepts
•
•
•
•

Simplicity is the ultimate sophistication.
Fat Models, Helper Modules, Thin Views, Stupid Templates
Start With Django by Default
Stand on the Shoulders of Giants
Make Your Code Readable

•
•
•
•

Avoid abbreviating variable names.
Write out your function argument names.
Document your classes and methods.
Refactor repeated lines of code into reusable functions or
methods.
PEP8
•

Style Guide for Python Code
 “Use 4 spaces per indentation level.”
 “Separate top-level function and class definitions with two
blank lines.”

 “Method definitions inside a class are separated by a single
blank line.”
The Word on Imports

Marketing
Standard library

Training
Core Django

Assesment
Third-party apps

Technology
Your apps

Ex: math

Import from django

Plugins

Imports from the apps
that you created as
part of your Django
project.
The Word on Imports
Use Explicit Relative Imports
Avoid Using Import *

•
•

The reason for this is to avoid implicitly loading all of another
Python module‟s locals into and over our current module‟s
namespace, which can produce unpredictable and sometimes
catastrophic results.
Python Naming Collisions
Django Coding Style Guidelines

•

•

Use underscores (the „_‟ character) in URL pattern names
rather than dashes as this is friendlier to more IDEs and text
editors. Note that we are referring to the name argument of
url() here, not the actual URL typed into the browser. Dashes
in actual URLs are fine.

For the same reason, use underscores rather than dashes in
template block names.
Reference
• Two Scoops of Django:https://django.2scoops.org/
• PEP 8 coding conventions:
http://www.python.org/dev/peps/pep-0008/

•

Django Coding Style
Guidelines:https://docs.djangoproject.com/en/1.5/internals/con
tributing/writing-code/coding-style/

Conclusion
Projects with varying styles are much harder to maintain, slowing development and increasing the
chances of developer mistakes.
Thanks for your listening

Michelle Leu

flywindy2002@gmail.com
Twitter: @flywindy
Developer @ Brand Karma

More Related Content

What's hot

Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Tom Brander
 
Django course final-project
Django course final-projectDjango course final-project
Django course final-projectUdi Bauman
 
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in DjangoDjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in DjangoCasey Kinsey
 
Maven beyond hello_world
Maven beyond hello_worldMaven beyond hello_world
Maven beyond hello_worldGabriel Dogaru
 
Lecture android best practices
Lecture   android best practicesLecture   android best practices
Lecture android best practiceseleksdev
 
Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-testRoyce Haynes
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache MavenMudit Gupta
 
Unit Test Android Without Going Bald
Unit Test Android Without Going BaldUnit Test Android Without Going Bald
Unit Test Android Without Going BaldDavid Carver
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoKnoldus Inc.
 
Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"IT Event
 
Android Modularization
Android ModularizationAndroid Modularization
Android ModularizationYoung-Hyuk Yoo
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationArnaud Héritier
 
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]Udit Gangwani
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1MD Sayem Ahmed
 
Audit your reactive applications
Audit your reactive applicationsAudit your reactive applications
Audit your reactive applicationsOCTO Technology
 

What's hot (20)

Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
 
Django course final-project
Django course final-projectDjango course final-project
Django course final-project
 
Python/Django Training
Python/Django TrainingPython/Django Training
Python/Django Training
 
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in DjangoDjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
 
Maven beyond hello_world
Maven beyond hello_worldMaven beyond hello_world
Maven beyond hello_world
 
Lecture android best practices
Lecture   android best practicesLecture   android best practices
Lecture android best practices
 
Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-test
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
 
Unit Test Android Without Going Bald
Unit Test Android Without Going BaldUnit Test Android Without Going Bald
Unit Test Android Without Going Bald
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache Ant
 
Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"
 
Maven tutorial for beginners
Maven tutorial for beginnersMaven tutorial for beginners
Maven tutorial for beginners
 
Android Modularization
Android ModularizationAndroid Modularization
Android Modularization
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentation
 
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
 
Audit your reactive applications
Audit your reactive applicationsAudit your reactive applications
Audit your reactive applications
 

Viewers also liked

Django 實戰 - 自己的購物網站自己做
Django 實戰 - 自己的購物網站自己做Django 實戰 - 自己的購物網站自己做
Django 實戰 - 自己的購物網站自己做flywindy
 
那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子flywindy
 
Django workshop homework 3
Django workshop homework 3Django workshop homework 3
Django workshop homework 3flywindy
 
Two scoops of Django - Deployment
Two scoops of Django - DeploymentTwo scoops of Django - Deployment
Two scoops of Django - Deploymentflywindy
 
Working with the django admin
Working with the django admin Working with the django admin
Working with the django admin flywindy
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1永昇 陳
 
Two scoops of django 1.6 - Ch7, Ch8
Two scoops of django 1.6  - Ch7, Ch8Two scoops of django 1.6  - Ch7, Ch8
Two scoops of django 1.6 - Ch7, Ch8flywindy
 
Command line 初級寶典
Command line 初級寶典Command line 初級寶典
Command line 初級寶典Tom Chen
 
Live Performance Effects
Live Performance EffectsLive Performance Effects
Live Performance EffectsTom Chen
 
真蝦意外接到的Case
真蝦意外接到的Case真蝦意外接到的Case
真蝦意外接到的CaseTom Chen
 
Pytables
PytablesPytables
Pytablesgowell
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro outputTom Chen
 
AngularJS Sharing
AngularJS SharingAngularJS Sharing
AngularJS SharingTom Chen
 
愛樂工程師
愛樂工程師愛樂工程師
愛樂工程師Tom Chen
 
Integrating tornado and webpack
Integrating tornado and webpackIntegrating tornado and webpack
Integrating tornado and webpackTom Chen
 
解密解密
解密解密解密解密
解密解密Tom Chen
 
Django sharing
Django sharingDjango sharing
Django sharingTom Chen
 

Viewers also liked (20)

Django 實戰 - 自己的購物網站自己做
Django 實戰 - 自己的購物網站自己做Django 實戰 - 自己的購物網站自己做
Django 實戰 - 自己的購物網站自己做
 
那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子那些年,我用 Django Admin 接的案子
那些年,我用 Django Admin 接的案子
 
Django workshop homework 3
Django workshop homework 3Django workshop homework 3
Django workshop homework 3
 
Two scoops of Django - Deployment
Two scoops of Django - DeploymentTwo scoops of Django - Deployment
Two scoops of Django - Deployment
 
Working with the django admin
Working with the django admin Working with the django admin
Working with the django admin
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1
 
Two scoops of django 1.6 - Ch7, Ch8
Two scoops of django 1.6  - Ch7, Ch8Two scoops of django 1.6  - Ch7, Ch8
Two scoops of django 1.6 - Ch7, Ch8
 
Command line 初級寶典
Command line 初級寶典Command line 初級寶典
Command line 初級寶典
 
Live Performance Effects
Live Performance EffectsLive Performance Effects
Live Performance Effects
 
Xmas
XmasXmas
Xmas
 
真蝦意外接到的Case
真蝦意外接到的Case真蝦意外接到的Case
真蝦意外接到的Case
 
Pytables
PytablesPytables
Pytables
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro output
 
AngularJS Sharing
AngularJS SharingAngularJS Sharing
AngularJS Sharing
 
Django step0
Django step0Django step0
Django step0
 
Gitlab
GitlabGitlab
Gitlab
 
愛樂工程師
愛樂工程師愛樂工程師
愛樂工程師
 
Integrating tornado and webpack
Integrating tornado and webpackIntegrating tornado and webpack
Integrating tornado and webpack
 
解密解密
解密解密解密解密
解密解密
 
Django sharing
Django sharingDjango sharing
Django sharing
 

Similar to Two scoops of django Introduction

Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersRosario Renga
 
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdfDjango Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdfSudhanshiBakre1
 
Django Article V0
Django Article V0Django Article V0
Django Article V0Udi Bauman
 
Master Python.pdf
Master Python.pdfMaster Python.pdf
Master Python.pdfUncodemy
 
Learn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersLearn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersMars Devs
 
Master Python.pdf
Master Python.pdfMaster Python.pdf
Master Python.pdfUncodemy
 
5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptx5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptxAttitude Tally Academy
 
Golang, Python or C/C++, who wins
Golang, Python or C/C++, who wins Golang, Python or C/C++, who wins
Golang, Python or C/C++, who wins Obed N Muñoz
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in DjangoLakshman Prasad
 
Why Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdfWhy Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdfMindfire LLC
 
Skills and Responsibilities of a Python Developer.pdf
Skills and Responsibilities of a Python Developer.pdfSkills and Responsibilities of a Python Developer.pdf
Skills and Responsibilities of a Python Developer.pdfuncodemy
 
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...What is Django | Django Tutorial for Beginners | Python Django Training | Edu...
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...Edureka!
 
Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...
Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...
Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...startxlabs
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| EdurekaEdureka!
 
Ways To Become A Good Python Developer
Ways To Become A Good Python DeveloperWays To Become A Good Python Developer
Ways To Become A Good Python DeveloperCodeMonk
 
python.pdf
python.pdfpython.pdf
python.pdfUncodemy
 

Similar to Two scoops of django Introduction (20)

Django
Django Django
Django
 
Django
DjangoDjango
Django
 
Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python Developers
 
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdfDjango Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
Django Tutorial_ Let’s take a deep dive into Django’s web framework.pdf
 
Django Article V0
Django Article V0Django Article V0
Django Article V0
 
Master Python.pdf
Master Python.pdfMaster Python.pdf
Master Python.pdf
 
Learn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersLearn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for Developers
 
Master Python.pdf
Master Python.pdfMaster Python.pdf
Master Python.pdf
 
5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptx5 Effective Tips to Learn Python Fast.pptx
5 Effective Tips to Learn Python Fast.pptx
 
Django Introdcution
Django IntrodcutionDjango Introdcution
Django Introdcution
 
Golang, Python or C/C++, who wins
Golang, Python or C/C++, who wins Golang, Python or C/C++, who wins
Golang, Python or C/C++, who wins
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Why Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdfWhy Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdf
 
Skills and Responsibilities of a Python Developer.pdf
Skills and Responsibilities of a Python Developer.pdfSkills and Responsibilities of a Python Developer.pdf
Skills and Responsibilities of a Python Developer.pdf
 
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...What is Django | Django Tutorial for Beginners | Python Django Training | Edu...
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...
 
Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...
Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...
Title_ Django_ Advantages, Limitations, and its Leading Edge in the Competiti...
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| Edureka
 
Ways To Become A Good Python Developer
Ways To Become A Good Python DeveloperWays To Become A Good Python Developer
Ways To Become A Good Python Developer
 
python.pdf
python.pdfpython.pdf
python.pdf
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 

Two scoops of django Introduction

  • 1. Two Scoops of Django Michelle Leu | 2013/10/29
  • 2. About the Authors DjangoPackages.com the OpenComparison framework. We ran the largest sprint at PyCon 2011. PyLadies a women‟s outreach/mentorship group. Nurturing the group was basically a 2nd fulltime job for us in 2011. The first ever PyCon Philippines, a 300-person conference about the Python programming language held in the Philippines. LA Open Source Hackathon event series, which brings together open-source developers from different programming backgrounds. Audrey Roy Daniel Greenfeld
  • 3. Before You Start Buy the e-book bundle for $17 Buy the print version for $29.95 If you are new to Django …… Python programming language Python 2.7.x Buy the e-book bundle for $17 Django tutorial: https://docs.djangoproject.com/en /1.5/intro/tutorial01/. Django 1.5
  • 4. Core Concepts • • • • Simplicity is the ultimate sophistication. Fat Models, Helper Modules, Thin Views, Stupid Templates Start With Django by Default Stand on the Shoulders of Giants
  • 5. Make Your Code Readable • • • • Avoid abbreviating variable names. Write out your function argument names. Document your classes and methods. Refactor repeated lines of code into reusable functions or methods.
  • 6. PEP8 • Style Guide for Python Code  “Use 4 spaces per indentation level.”  “Separate top-level function and class definitions with two blank lines.”  “Method definitions inside a class are separated by a single blank line.”
  • 7. The Word on Imports Marketing Standard library Training Core Django Assesment Third-party apps Technology Your apps Ex: math Import from django Plugins Imports from the apps that you created as part of your Django project.
  • 8. The Word on Imports
  • 10. Avoid Using Import * • • The reason for this is to avoid implicitly loading all of another Python module‟s locals into and over our current module‟s namespace, which can produce unpredictable and sometimes catastrophic results. Python Naming Collisions
  • 11. Django Coding Style Guidelines • • Use underscores (the „_‟ character) in URL pattern names rather than dashes as this is friendlier to more IDEs and text editors. Note that we are referring to the name argument of url() here, not the actual URL typed into the browser. Dashes in actual URLs are fine. For the same reason, use underscores rather than dashes in template block names.
  • 12. Reference • Two Scoops of Django:https://django.2scoops.org/ • PEP 8 coding conventions: http://www.python.org/dev/peps/pep-0008/ • Django Coding Style Guidelines:https://docs.djangoproject.com/en/1.5/internals/con tributing/writing-code/coding-style/ Conclusion Projects with varying styles are much harder to maintain, slowing development and increasing the chances of developer mistakes.
  • 13. Thanks for your listening Michelle Leu flywindy2002@gmail.com Twitter: @flywindy Developer @ Brand Karma