SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Django Worst Practices
                          Daniel Greenfeld




Tuesday, April 19, 2011
Django Worst Practices

                           Whole
                          project in
                           one app



Tuesday, April 19, 2011
Django Worst Practices

                           Whole
                          project in
                           one app

                               All your stuff in one place!


Tuesday, April 19, 2011
Django Worst Practices

                           Whole
                          project in
                           one app

                     All your stuff in one place!
          No need to worry about bugfixes or enhancements!
Tuesday, April 19, 2011
Django Worst Practices
  pydanny: pwd
  /Users/pydanny/projects/enterprise/settings
  pydanny: ls -l
  total 24
  -rw-r--r-- 1 pydanny staff 0 Apr 18 22:38 __init__.py
  lrwxr-xr-x 1 pydanny staff 21 Apr 18 22:42 dev.py -> /Users/pydanny/dev.py
  lrwxr-xr-x 1 pydanny staff 22 Apr 18 22:42 prod.py -> /Users/pydanny/prod.py
  lrwxr-xr-x 1 pydanny staff 25 Apr 18 22:42 staging.py -> /Users/pydanny/staging.py


                Symlink your settings folder!
                          Cause you’ll remember to do this with each server setup...




Tuesday, April 19, 2011
Django Worst Practices
                          Database Choices




Tuesday, April 19, 2011
Django Worst Practices
                              Database Choices
                     • Use a relational database to store ill-
                          defined hierarchical data!




Tuesday, April 19, 2011
Django Worst Practices
                              Database Choices
                     • Use a relational database to store ill-
                          defined hierarchical data!
                     • Use NoSQL to store tabular data!


Tuesday, April 19, 2011
Django Worst Practices
                          <%python scope="global">
                              # declare global variables, accessible
                              # across this component's generated module

                              message1 = "this is message one."
                              message2 = "this is message two."
                              message3 = "doh, im message three."
                          </%python>

                          <%python>
                              # reference the global variables
                              m.write("message one: " + message1)
                              m.write("message two: " + message2)

                              # we want to assign to message3,
                              # so declare "global" first
                              global message3

                              message3 = "this is message three."

                              m.write("message three: " + message3)

                          </%python>




Tuesday, April 19, 2011
Django Worst Practices
                          <%python scope="global">
                              # declare global variables, accessible
                              # across this component's generated module

                              message1 = "this is message one."
                              message2 = "this is message two."
                              message3 = "doh, im message three."
                          </%python>

                          <%python>
                              # reference the global variables
                              m.write("message one: " + message1)
                              m.write("message two: " + message2)

                              # we want to assign to message3,
                              # so declare "global" first
                              global message3

                              message3 = "this is message three."

                              m.write("message three: " + message3)

                          </%python>


                          Who needs caching?



Tuesday, April 19, 2011
Django Worst Practices
                             <%python scope="global">
                                 # declare global variables, accessible
                                 # across this component's generated module

                                 message1 = "this is message one."
                                 message2 = "this is message two."
                                 message3 = "doh, im message three."
                             </%python>

                             <%python>
                                 # reference the global variables
                                 m.write("message one: " + message1)
                                 m.write("message two: " + message2)

                                 # we want to assign to message3,
                                 # so declare "global" first
                                 global message3

                                 message3 = "this is message three."

                                 m.write("message three: " + message3)

                             </%python>


                             Who needs caching?
                          Performance awesomeness!

Tuesday, April 19, 2011
Django Worst Practices
                                <%python scope="global">
                                    # declare global variables, accessible
                                    # across this component's generated module

                                    message1 = "this is message one."
                                    message2 = "this is message two."
                                    message3 = "doh, im message three."
                                </%python>

                                <%python>
                                    # reference the global variables
                                    m.write("message one: " + message1)
                                    m.write("message two: " + message2)

                                    # we want to assign to message3,
                                    # so declare "global" first
                                    global message3

                                    message3 = "this is message three."

                                    m.write("message three: " + message3)

                                </%python>


                                Who needs caching?
                            Performance awesomeness!
                          Replaces pesky django templates!
Tuesday, April 19, 2011
Django Worst Practices
                                <%python scope="global">
                                    # declare global variables, accessible
                                    # across this component's generated module

                                    message1 = "this is message one."
                                    message2 = "this is message two."
                                    message3 = "doh, im message three."
                                </%python>

                                <%python>
                                    # reference the global variables
                                    m.write("message one: " + message1)
                                    m.write("message two: " + message2)

                                    # we want to assign to message3,
                                    # so declare "global" first
                                    global message3

                                    message3 = "this is message three."

                                    m.write("message three: " + message3)

                                </%python>


                                Who needs caching?
                            Performance awesomeness!
                          Replaces pesky django templates!
Tuesday, April 19, 2011
Django Worst Practices
                            <?xml version="1.0" encoding="UTF-8"?>
                            <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
                              <xsl:output method="xml" indent="yes"/>

                              <xsl:template match="/persons">
                                <root>
                                  <xsl:apply-templates select="person"/>
                                </root>
                              </xsl:template>

                              <xsl:template match="person">
                                <name username="{@username}">
                                  <xsl:value-of select="name" />
                                </name>
                              </xsl:template>

                            </xsl:stylesheet>




                          Use XSLT for awesome performance!


Tuesday, April 19, 2011
Django Worst Practices
                          Put critical business logic in...




Tuesday, April 19, 2011
Django Worst Practices
                          Put critical business logic in...

                                  • The templates




Tuesday, April 19, 2011
Django Worst Practices
                          Put critical business logic in...

                                  • The templates
                                  • settings




Tuesday, April 19, 2011
Django Worst Practices
                          Put critical business logic in...

                                  • The templates
                                  • settings
                                  • The context processors



Tuesday, April 19, 2011
Django Worst Practices
                          Put critical business logic in...

                                  •   The templates
                                  •   settings
                                  •   The context processors
                                  •   Middleware!



Tuesday, April 19, 2011
Django Worst Practices


                          Use metaclasses instead of abstract models!




Tuesday, April 19, 2011
Django Worst Practices
   In settings:
                from django.db import models
                blog2_fields = [
                          models.CharField(“title”, max_length=50),
                          models.TextField(“note”)
                ]

Tuesday, April 19, 2011
Django Worst Practices

                           Present using
                           Different fonts
                             Dark text
                          Dire backgrounds

Tuesday, April 19, 2011
Django Worst Practices
                                       Don’t use



                          http://djangopackages.com

                               Invent everything yourself!



Tuesday, April 19, 2011

Contenu connexe

Plus de Daniel Greenfeld

How to Write a Popular Python Library by Accident
How to Write a Popular Python Library by AccidentHow to Write a Popular Python Library by Accident
How to Write a Popular Python Library by AccidentDaniel Greenfeld
 
10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-python10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-pythonDaniel Greenfeld
 
From NASA to Startups to Big Commerce
From NASA to Startups to Big CommerceFrom NASA to Startups to Big Commerce
From NASA to Startups to Big CommerceDaniel Greenfeld
 
Thinking hard about_python
Thinking hard about_pythonThinking hard about_python
Thinking hard about_pythonDaniel Greenfeld
 
Intro to Data Visualizations
Intro to Data VisualizationsIntro to Data Visualizations
Intro to Data VisualizationsDaniel Greenfeld
 
An Extreme Talk about the Zen of Python
An Extreme Talk about the Zen of PythonAn Extreme Talk about the Zen of Python
An Extreme Talk about the Zen of PythonDaniel Greenfeld
 
PyCon Philippines 2012 Keynote
PyCon Philippines 2012 KeynotePyCon Philippines 2012 Keynote
PyCon Philippines 2012 KeynoteDaniel Greenfeld
 
Round pegs and square holes
Round pegs and square holesRound pegs and square holes
Round pegs and square holesDaniel Greenfeld
 
Lighting talk on django-social-auth
Lighting talk on django-social-authLighting talk on django-social-auth
Lighting talk on django-social-authDaniel Greenfeld
 
Advanced Django Forms Usage
Advanced Django Forms UsageAdvanced Django Forms Usage
Advanced Django Forms UsageDaniel Greenfeld
 
Confessions of Joe Developer
Confessions of Joe DeveloperConfessions of Joe Developer
Confessions of Joe DeveloperDaniel Greenfeld
 
Pinax Long Tutorial Slides
Pinax Long Tutorial SlidesPinax Long Tutorial Slides
Pinax Long Tutorial SlidesDaniel Greenfeld
 

Plus de Daniel Greenfeld (20)

How to Write a Popular Python Library by Accident
How to Write a Popular Python Library by AccidentHow to Write a Popular Python Library by Accident
How to Write a Popular Python Library by Accident
 
10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-python10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-python
 
From NASA to Startups to Big Commerce
From NASA to Startups to Big CommerceFrom NASA to Startups to Big Commerce
From NASA to Startups to Big Commerce
 
Thinking hard about_python
Thinking hard about_pythonThinking hard about_python
Thinking hard about_python
 
Intro to Data Visualizations
Intro to Data VisualizationsIntro to Data Visualizations
Intro to Data Visualizations
 
An Extreme Talk about the Zen of Python
An Extreme Talk about the Zen of PythonAn Extreme Talk about the Zen of Python
An Extreme Talk about the Zen of Python
 
PyCon Philippines 2012 Keynote
PyCon Philippines 2012 KeynotePyCon Philippines 2012 Keynote
PyCon Philippines 2012 Keynote
 
Round pegs and square holes
Round pegs and square holesRound pegs and square holes
Round pegs and square holes
 
Intro
IntroIntro
Intro
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Lighting talk on django-social-auth
Lighting talk on django-social-authLighting talk on django-social-auth
Lighting talk on django-social-auth
 
Future of Collaboration
Future of CollaborationFuture of Collaboration
Future of Collaboration
 
Advanced Django Forms Usage
Advanced Django Forms UsageAdvanced Django Forms Usage
Advanced Django Forms Usage
 
The One Way
The One WayThe One Way
The One Way
 
Confessions of Joe Developer
Confessions of Joe DeveloperConfessions of Joe Developer
Confessions of Joe Developer
 
Python Worst Practices
Python Worst PracticesPython Worst Practices
Python Worst Practices
 
How to sell django panel
How to sell django panelHow to sell django panel
How to sell django panel
 
Pinax Long Tutorial Slides
Pinax Long Tutorial SlidesPinax Long Tutorial Slides
Pinax Long Tutorial Slides
 
Testing In Django
Testing In DjangoTesting In Django
Testing In Django
 
Django Uni-Form
Django Uni-FormDjango Uni-Form
Django Uni-Form
 

Dernier

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
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
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Dernier (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
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
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Django Worst Practices

  • 1. Django Worst Practices Daniel Greenfeld Tuesday, April 19, 2011
  • 2. Django Worst Practices Whole project in one app Tuesday, April 19, 2011
  • 3. Django Worst Practices Whole project in one app All your stuff in one place! Tuesday, April 19, 2011
  • 4. Django Worst Practices Whole project in one app All your stuff in one place! No need to worry about bugfixes or enhancements! Tuesday, April 19, 2011
  • 5. Django Worst Practices pydanny: pwd /Users/pydanny/projects/enterprise/settings pydanny: ls -l total 24 -rw-r--r-- 1 pydanny staff 0 Apr 18 22:38 __init__.py lrwxr-xr-x 1 pydanny staff 21 Apr 18 22:42 dev.py -> /Users/pydanny/dev.py lrwxr-xr-x 1 pydanny staff 22 Apr 18 22:42 prod.py -> /Users/pydanny/prod.py lrwxr-xr-x 1 pydanny staff 25 Apr 18 22:42 staging.py -> /Users/pydanny/staging.py Symlink your settings folder! Cause you’ll remember to do this with each server setup... Tuesday, April 19, 2011
  • 6. Django Worst Practices Database Choices Tuesday, April 19, 2011
  • 7. Django Worst Practices Database Choices • Use a relational database to store ill- defined hierarchical data! Tuesday, April 19, 2011
  • 8. Django Worst Practices Database Choices • Use a relational database to store ill- defined hierarchical data! • Use NoSQL to store tabular data! Tuesday, April 19, 2011
  • 9. Django Worst Practices <%python scope="global"> # declare global variables, accessible # across this component's generated module message1 = "this is message one." message2 = "this is message two." message3 = "doh, im message three." </%python> <%python> # reference the global variables m.write("message one: " + message1) m.write("message two: " + message2) # we want to assign to message3, # so declare "global" first global message3 message3 = "this is message three." m.write("message three: " + message3) </%python> Tuesday, April 19, 2011
  • 10. Django Worst Practices <%python scope="global"> # declare global variables, accessible # across this component's generated module message1 = "this is message one." message2 = "this is message two." message3 = "doh, im message three." </%python> <%python> # reference the global variables m.write("message one: " + message1) m.write("message two: " + message2) # we want to assign to message3, # so declare "global" first global message3 message3 = "this is message three." m.write("message three: " + message3) </%python> Who needs caching? Tuesday, April 19, 2011
  • 11. Django Worst Practices <%python scope="global"> # declare global variables, accessible # across this component's generated module message1 = "this is message one." message2 = "this is message two." message3 = "doh, im message three." </%python> <%python> # reference the global variables m.write("message one: " + message1) m.write("message two: " + message2) # we want to assign to message3, # so declare "global" first global message3 message3 = "this is message three." m.write("message three: " + message3) </%python> Who needs caching? Performance awesomeness! Tuesday, April 19, 2011
  • 12. Django Worst Practices <%python scope="global"> # declare global variables, accessible # across this component's generated module message1 = "this is message one." message2 = "this is message two." message3 = "doh, im message three." </%python> <%python> # reference the global variables m.write("message one: " + message1) m.write("message two: " + message2) # we want to assign to message3, # so declare "global" first global message3 message3 = "this is message three." m.write("message three: " + message3) </%python> Who needs caching? Performance awesomeness! Replaces pesky django templates! Tuesday, April 19, 2011
  • 13. Django Worst Practices <%python scope="global"> # declare global variables, accessible # across this component's generated module message1 = "this is message one." message2 = "this is message two." message3 = "doh, im message three." </%python> <%python> # reference the global variables m.write("message one: " + message1) m.write("message two: " + message2) # we want to assign to message3, # so declare "global" first global message3 message3 = "this is message three." m.write("message three: " + message3) </%python> Who needs caching? Performance awesomeness! Replaces pesky django templates! Tuesday, April 19, 2011
  • 14. Django Worst Practices <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/persons"> <root> <xsl:apply-templates select="person"/> </root> </xsl:template> <xsl:template match="person"> <name username="{@username}"> <xsl:value-of select="name" /> </name> </xsl:template> </xsl:stylesheet> Use XSLT for awesome performance! Tuesday, April 19, 2011
  • 15. Django Worst Practices Put critical business logic in... Tuesday, April 19, 2011
  • 16. Django Worst Practices Put critical business logic in... • The templates Tuesday, April 19, 2011
  • 17. Django Worst Practices Put critical business logic in... • The templates • settings Tuesday, April 19, 2011
  • 18. Django Worst Practices Put critical business logic in... • The templates • settings • The context processors Tuesday, April 19, 2011
  • 19. Django Worst Practices Put critical business logic in... • The templates • settings • The context processors • Middleware! Tuesday, April 19, 2011
  • 20. Django Worst Practices Use metaclasses instead of abstract models! Tuesday, April 19, 2011
  • 21. Django Worst Practices In settings: from django.db import models blog2_fields = [ models.CharField(“title”, max_length=50), models.TextField(“note”) ] Tuesday, April 19, 2011
  • 22. Django Worst Practices Present using Different fonts Dark text Dire backgrounds Tuesday, April 19, 2011
  • 23. Django Worst Practices Don’t use http://djangopackages.com Invent everything yourself! Tuesday, April 19, 2011