SlideShare a Scribd company logo
1 of 34
Download to read offline
How to upgrade to the
newest shiniest Django
version
DjangoCon Europe
Susan tan
Cisco in san francisco, CA
1
Hello! I’m Susan
• I’m a software engineer at Cisco in San Francisco,
CA.
• Previously worked at a cloud startup Piston.
• Works with python apis, web development, works
on Cisco’s openstack horizon Django project
• Worked on open source Django project
www.openhatch.org
2
Quick Audience Survey
How many people currently work on at least
one project with Django
• below 1.6?
• 1.7?
• 1.8?
• 1.9?
3
Why should you do an upgrade?
• get new features, bug fixes,
security fixes
• easier to upgrade to the next
version in future
4
A.B.C


backwards-incompatible
new features
backwards compatible
backwards-compatible bug
fixes.
Semantic versioning review
major minor patch
Read http://semver.org/
5
Django does NOT follow semantic
versioning FYI
6
• Major release number is an extension of minor
release number.
• From semantic versioning, Django 1.7 should be
2.0, because backwards-incompatible.
When is right time to upgrade?
• Your project’s Django version is no longer
supported.
• Do a patch upgrade! Always.
• You have an existing comprehensive test
suite.
• If you don’t have a test suite, then now would be a
good time to start writing unit tests.
7
8
Current Django Versions
Source: https://www.djangoproject.com/download/
9
Future Roadmap
Source: https://www.djangoproject.com/download/
[3] Last version to support Python 2.7.
• Hard to know how much time or effort it takes
• Hard to know which tests will break or even run
• Hard to know if UI will continue working
• Confirm functionality at every part of
development
• ie: local host, staging, deployment.
10
Why is upgrading a Django project a
difficult thing to do?
What does the end product look
like in code?
11
12
Upgrading OpenHatch
Upgrading OpenHatch
13
• OpenHatch vendors all its dependencies.
• Commits that are "Add upgraded version of
library Z” with full library source code.
• ~4 weeks to go from broken Django project to
functional upgraded Django project, including
dependency updates.
• Doing frequent git rebasing & resolving merge
conflicts is terrible.
What is step zero?
pip uninstall django
pip install django==<NUMBER>
15
What NOT to do
Do not skip over versions. If you do, you
will
• miss deprecation warnings
• supported for 2 versions
• have invalid code
• call APIs or use modules that don’t
exist in newer Django version
16
What is step 1?
python manage.py tests




Possible results:
1. Your tests may not even run.
2. Your tests may fail.
3. All your tests pass.
17
Option 3: All your tests pass right after
installing new Django
Option 2: Your tests fail.
What’s next if tests fail?
Fix tests, one at a time
19
At the end, what does “SUCCESS”
look like for a fully upgraded project?
In this order:
1. All tests pass with no errors or deprecation
warnings.
2. UI works locally.
3. Deployment works on staging.
4. UI works on staging.
5. Deployment works on production.
6. UI works on production.
21
Break a big task into smaller tasks.
What is this entire process?
Run thru these steps in this order:
1. Run existing unit tests. Fix broken tests.
2. Run same existing unit tests. Confirm that
fewer tests fail.
3. Rinse and repeat steps 1-2 continuously
until all tests pass.
4. Check the UI to see if it all still works.
5. Edit deploy script, requirements.txt,
documentation.
22
What are the challenges?
23
> ls vendor/packages/
BeautifulSoup django-authopenid docutils odict south
Django django-celery feedparser ordereddict sphinx
Jinja2 django-debug-toolbar gdata python-dateutil sqlparse
PyJWT django-extensions ghettoq python-memcached
staticgenerator
PyYaml django-http-proxy html2text python-mimeparse twill
Pygments django-inplaceedit html5lib python-openid twisted
amqp django-invitation importlib python-otp
typecheck
anyjson django-kombu irc python-patch
unicodecsv
beautifulsoup4 django-model-utils jsmin python-social-auth
unittest-xml-reporting
bleach django-picklefield kombu pytz webob
celery django-registration markupsafe
Lots of dependencies may break
24
Options:
1. Upgrade dependency.
2. Patch it yourself (and upstream it).
3. Use a different similar dependency.
LOTS of release notes
• Deprecation warnings or test errors will tell
you which release notes to read.
• Replace syntax with newer syntax.
25
Some are simple changes
Upgrade to 1.5: Fix deprecation issue with
AdminMediaHandler
Edit manage.py when upgrading to Django 1.5
27
Some are simple changes
Replace "direct_to_template()" with generic template
view. This is a deprecation documented in Django 1.5
release notes.
LOTS of repetition
29
Fix the template quotes syntax issue
This syntax issue is documented in release notes when upgrading to Django 1.5.
In templates, change tags like {% url myview %} to {% url "myview" %}
Take aways
31
• Do an upgrade 1 version at a time.
• Run unit tests, see what breaks, then fix tests
1 at a time.
• Read release notes.
• Break every task into small steps.
• A checklist helps.
• So does taking notes.
32
How many people have
been planning to do an
upgrade on their Django
project?
Announcing Django Upgrade Open
Space
33
Have you done Django upgrades before or are
looking to do so for your personal project(s)?
WHO: Anyone who wants to upgrade their
projects. Anyone with experience with upgrading
projects.
WHAT: Work on your Django project. Mentor(s)
will be there.
WHEN: this Saturday & Sunday mornings
Thanks! Hope this helps.
Thanks Cisco for sponsoring
me to go on this trip.
Susan
Twitter: @ArcTanSusan
34

More Related Content

What's hot

Blazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseBlazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseMichał Kordas
 
DevQAOps - Surviving in a DevOps World
DevQAOps - Surviving in a DevOps WorldDevQAOps - Surviving in a DevOps World
DevQAOps - Surviving in a DevOps WorldWinston Laoh
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneMichael Kuehne-Schlinkert
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End TestingComparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End TestingKatie Chin
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationhugo lu
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...ulfmansson
 
Step away from that knife!
Step away from that knife!Step away from that knife!
Step away from that knife!Michael Goetz
 
Continuous delivery - tools and techniques
Continuous delivery - tools and techniquesContinuous delivery - tools and techniques
Continuous delivery - tools and techniquesMike McGarr
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Sauce Labs
 
Introduction to Continuous Delivery (BBWorld/DevCon 2013)
Introduction to Continuous Delivery (BBWorld/DevCon 2013)Introduction to Continuous Delivery (BBWorld/DevCon 2013)
Introduction to Continuous Delivery (BBWorld/DevCon 2013)Mike McGarr
 
Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)Sergio Navarro Pino
 
Back to basic: continuous integration (Madrid DevOps)
Back to basic: continuous integration (Madrid DevOps)Back to basic: continuous integration (Madrid DevOps)
Back to basic: continuous integration (Madrid DevOps)Sergio Navarro Pino
 
Continuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenarioContinuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenarioDavide Benvegnù
 
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and Delivery
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and DeliveryUsg Web Tech Day 2016 - Continuous Integration, Deployment, and Delivery
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and DeliveryStephen Garrett
 
Continuous Integration at T3CON08
Continuous Integration at T3CON08Continuous Integration at T3CON08
Continuous Integration at T3CON08Sebastian Kurfürst
 
Introduction to test_driven_development
Introduction to test_driven_developmentIntroduction to test_driven_development
Introduction to test_driven_developmenthaochenglee
 
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
 Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to realityDaniel Gallego Vico
 
Software development terminology
Software development terminologySoftware development terminology
Software development terminologyjstack
 

What's hot (20)

Blazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseBlazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java Universe
 
DevQAOps - Surviving in a DevOps World
DevQAOps - Surviving in a DevOps WorldDevQAOps - Surviving in a DevOps World
DevQAOps - Surviving in a DevOps World
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End TestingComparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...
 
Step away from that knife!
Step away from that knife!Step away from that knife!
Step away from that knife!
 
Continuous Integration 101
Continuous Integration 101Continuous Integration 101
Continuous Integration 101
 
Continuous delivery - tools and techniques
Continuous delivery - tools and techniquesContinuous delivery - tools and techniques
Continuous delivery - tools and techniques
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
 
Introduction to Continuous Delivery (BBWorld/DevCon 2013)
Introduction to Continuous Delivery (BBWorld/DevCon 2013)Introduction to Continuous Delivery (BBWorld/DevCon 2013)
Introduction to Continuous Delivery (BBWorld/DevCon 2013)
 
Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)Advanced deployment scenarios (netcoreconf)
Advanced deployment scenarios (netcoreconf)
 
Back to basic: continuous integration (Madrid DevOps)
Back to basic: continuous integration (Madrid DevOps)Back to basic: continuous integration (Madrid DevOps)
Back to basic: continuous integration (Madrid DevOps)
 
Continuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenarioContinuous Integration and Continuous Deployment in Enterprise scenario
Continuous Integration and Continuous Deployment in Enterprise scenario
 
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and Delivery
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and DeliveryUsg Web Tech Day 2016 - Continuous Integration, Deployment, and Delivery
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and Delivery
 
Continuous Integration at T3CON08
Continuous Integration at T3CON08Continuous Integration at T3CON08
Continuous Integration at T3CON08
 
Advanced deployment scenarios
Advanced deployment scenariosAdvanced deployment scenarios
Advanced deployment scenarios
 
Introduction to test_driven_development
Introduction to test_driven_developmentIntroduction to test_driven_development
Introduction to test_driven_development
 
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
 Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
 
Software development terminology
Software development terminologySoftware development terminology
Software development terminology
 

Viewers also liked

Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)Partnered Health
 
What to consider before buying a fingerprint gun safe?
What to consider before buying a fingerprint gun safe?What to consider before buying a fingerprint gun safe?
What to consider before buying a fingerprint gun safe?Avinash Thota
 
IML Group Overview September 2015
IML Group Overview September 2015IML Group Overview September 2015
IML Group Overview September 2015Shaun Barnard
 
Oct 23 CAPHC CPDSN Symposium - Shauna Langenberger
Oct 23   CAPHC CPDSN Symposium - Shauna LangenbergerOct 23   CAPHC CPDSN Symposium - Shauna Langenberger
Oct 23 CAPHC CPDSN Symposium - Shauna LangenbergerGlenna Gosewich
 
地域のチカラをマップにしよう!高齢者版(20161119)
地域のチカラをマップにしよう!高齢者版(20161119)地域のチカラをマップにしよう!高齢者版(20161119)
地域のチカラをマップにしよう!高齢者版(20161119)Hitoshi Sugimoto
 
マーケティング3.0 セミナー資料
マーケティング3.0 セミナー資料マーケティング3.0 セミナー資料
マーケティング3.0 セミナー資料潤 櫻田
 
Human Trafficking Awareness
Human Trafficking AwarenessHuman Trafficking Awareness
Human Trafficking AwarenessMeri Ferrell
 
Document Object Model
Document Object ModelDocument Object Model
Document Object ModelMayur Mudgal
 
DOM ( Document Object Model )
DOM ( Document Object Model )DOM ( Document Object Model )
DOM ( Document Object Model )ITSTB
 
Changing Notions of Risk Management in Financial Markets
Changing Notions of Risk Management in Financial MarketsChanging Notions of Risk Management in Financial Markets
Changing Notions of Risk Management in Financial MarketsQuantInsti
 
research findings 1
research findings 1research findings 1
research findings 1Maci Slater
 
Document object model(dom)
Document object model(dom)Document object model(dom)
Document object model(dom)rahul kundu
 
NLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEO
NLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEONLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEO
NLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEOpatrickstox
 
ازاي تبني استراتيجية للمحتوى؟
 ازاي تبني استراتيجية للمحتوى؟ ازاي تبني استراتيجية للمحتوى؟
ازاي تبني استراتيجية للمحتوى؟Hatem Hegazy
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOMMindy McAdams
 

Viewers also liked (20)

Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
What to consider before buying a fingerprint gun safe?
What to consider before buying a fingerprint gun safe?What to consider before buying a fingerprint gun safe?
What to consider before buying a fingerprint gun safe?
 
Chicken patagoniensis
Chicken patagoniensisChicken patagoniensis
Chicken patagoniensis
 
Message
MessageMessage
Message
 
IML Group Overview September 2015
IML Group Overview September 2015IML Group Overview September 2015
IML Group Overview September 2015
 
Oct 23 CAPHC CPDSN Symposium - Shauna Langenberger
Oct 23   CAPHC CPDSN Symposium - Shauna LangenbergerOct 23   CAPHC CPDSN Symposium - Shauna Langenberger
Oct 23 CAPHC CPDSN Symposium - Shauna Langenberger
 
Healthcare Products
Healthcare Products Healthcare Products
Healthcare Products
 
PeerReview
PeerReviewPeerReview
PeerReview
 
地域のチカラをマップにしよう!高齢者版(20161119)
地域のチカラをマップにしよう!高齢者版(20161119)地域のチカラをマップにしよう!高齢者版(20161119)
地域のチカラをマップにしよう!高齢者版(20161119)
 
マーケティング3.0 セミナー資料
マーケティング3.0 セミナー資料マーケティング3.0 セミナー資料
マーケティング3.0 セミナー資料
 
Human Trafficking Awareness
Human Trafficking AwarenessHuman Trafficking Awareness
Human Trafficking Awareness
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
DOM ( Document Object Model )
DOM ( Document Object Model )DOM ( Document Object Model )
DOM ( Document Object Model )
 
Changing Notions of Risk Management in Financial Markets
Changing Notions of Risk Management in Financial MarketsChanging Notions of Risk Management in Financial Markets
Changing Notions of Risk Management in Financial Markets
 
research findings 1
research findings 1research findings 1
research findings 1
 
Document object model(dom)
Document object model(dom)Document object model(dom)
Document object model(dom)
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
NLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEO
NLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEONLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEO
NLP Sitemap SMX 2016 Patrick Stox Latest In Advanced Technical SEO
 
ازاي تبني استراتيجية للمحتوى؟
 ازاي تبني استراتيجية للمحتوى؟ ازاي تبني استراتيجية للمحتوى؟
ازاي تبني استراتيجية للمحتوى؟
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 

Similar to How to Upgrade to the Newest Shiniest Django Version

Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplateStanislav Petrov
 
Django Article V0
Django Article V0Django Article V0
Django Article V0Udi Bauman
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using JenkinsRogue Wave Software
 
Different phases of accessibility testing
Different phases of accessibility testing Different phases of accessibility testing
Different phases of accessibility testing SAGAR BARBHAYA
 
Different phases of accessibility testing
Different phases of accessibility testingDifferent phases of accessibility testing
Different phases of accessibility testingPoonam Tathavadkar
 
Complete python toolbox for modern developers
Complete python toolbox for modern developersComplete python toolbox for modern developers
Complete python toolbox for modern developersJan Giacomelli
 
Continuous delivery in Qbon
Continuous delivery  in QbonContinuous delivery  in Qbon
Continuous delivery in QbonJaric Kuo
 
EFL QA: Where Are We and Where Should We Go?
EFL QA: Where Are We and Where Should We Go?EFL QA: Where Are We and Where Should We Go?
EFL QA: Where Are We and Where Should We Go?Samsung Open Source Group
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013David Funaro
 
Python to go
Python to goPython to go
Python to goWeng Wei
 
Webinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabWebinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabOlinData
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakayaMbakaya Kwatukha
 
Django: Beyond Basics
Django: Beyond BasicsDjango: Beyond Basics
Django: Beyond Basicsarunvr
 
Python monorepos what, why and how (shared)
Python monorepos  what, why and how (shared)Python monorepos  what, why and how (shared)
Python monorepos what, why and how (shared)benjyw
 
Pulp 3 - Simpler, Better, More awesome
Pulp 3 - Simpler, Better, More awesomePulp 3 - Simpler, Better, More awesome
Pulp 3 - Simpler, Better, More awesomeDennis Kliban
 

Similar to How to Upgrade to the Newest Shiniest Django Version (20)

Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
Django Article V0
Django Article V0Django Article V0
Django Article V0
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Django
DjangoDjango
Django
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
Different phases of accessibility testing
Different phases of accessibility testing Different phases of accessibility testing
Different phases of accessibility testing
 
Different phases of accessibility testing
Different phases of accessibility testingDifferent phases of accessibility testing
Different phases of accessibility testing
 
Complete python toolbox for modern developers
Complete python toolbox for modern developersComplete python toolbox for modern developers
Complete python toolbox for modern developers
 
Continuous delivery in Qbon
Continuous delivery  in QbonContinuous delivery  in Qbon
Continuous delivery in Qbon
 
EFL QA: Where Are We and Where Should We Go?
EFL QA: Where Are We and Where Should We Go?EFL QA: Where Are We and Where Should We Go?
EFL QA: Where Are We and Where Should We Go?
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013
 
EFL QA Statistics
EFL QA StatisticsEFL QA Statistics
EFL QA Statistics
 
Ui Testing with Ghost Inspector
Ui Testing with Ghost InspectorUi Testing with Ghost Inspector
Ui Testing with Ghost Inspector
 
Automating the Quality
Automating the QualityAutomating the Quality
Automating the Quality
 
Python to go
Python to goPython to go
Python to go
 
Webinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabWebinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLab
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
 
Django: Beyond Basics
Django: Beyond BasicsDjango: Beyond Basics
Django: Beyond Basics
 
Python monorepos what, why and how (shared)
Python monorepos  what, why and how (shared)Python monorepos  what, why and how (shared)
Python monorepos what, why and how (shared)
 
Pulp 3 - Simpler, Better, More awesome
Pulp 3 - Simpler, Better, More awesomePulp 3 - Simpler, Better, More awesome
Pulp 3 - Simpler, Better, More awesome
 

More from Susan Tan

Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...
Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...
Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...Susan Tan
 
Let's read code: python-requests library
Let's read code: python-requests libraryLet's read code: python-requests library
Let's read code: python-requests librarySusan Tan
 
How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?Susan Tan
 
Let's read code: the python-requests library
Let's read code: the python-requests libraryLet's read code: the python-requests library
Let's read code: the python-requests librarySusan Tan
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get GitSusan Tan
 
Python In The Browser: Intro to Brython
Python In The Browser: Intro to BrythonPython In The Browser: Intro to Brython
Python In The Browser: Intro to BrythonSusan Tan
 
How to choose an open-source project
How to choose an open-source projectHow to choose an open-source project
How to choose an open-source projectSusan Tan
 

More from Susan Tan (7)

Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...
Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...
Rants and Ruminations From A Job Applicant After 💯 CS Job Interviews in Silic...
 
Let's read code: python-requests library
Let's read code: python-requests libraryLet's read code: python-requests library
Let's read code: python-requests library
 
How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?
 
Let's read code: the python-requests library
Let's read code: the python-requests libraryLet's read code: the python-requests library
Let's read code: the python-requests library
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
 
Python In The Browser: Intro to Brython
Python In The Browser: Intro to BrythonPython In The Browser: Intro to Brython
Python In The Browser: Intro to Brython
 
How to choose an open-source project
How to choose an open-source projectHow to choose an open-source project
How to choose an open-source project
 

Recently uploaded

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 

Recently uploaded (20)

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 

How to Upgrade to the Newest Shiniest Django Version

  • 1. How to upgrade to the newest shiniest Django version DjangoCon Europe Susan tan Cisco in san francisco, CA 1
  • 2. Hello! I’m Susan • I’m a software engineer at Cisco in San Francisco, CA. • Previously worked at a cloud startup Piston. • Works with python apis, web development, works on Cisco’s openstack horizon Django project • Worked on open source Django project www.openhatch.org 2
  • 3. Quick Audience Survey How many people currently work on at least one project with Django • below 1.6? • 1.7? • 1.8? • 1.9? 3
  • 4. Why should you do an upgrade? • get new features, bug fixes, security fixes • easier to upgrade to the next version in future 4
  • 5. A.B.C 
 backwards-incompatible new features backwards compatible backwards-compatible bug fixes. Semantic versioning review major minor patch Read http://semver.org/ 5
  • 6. Django does NOT follow semantic versioning FYI 6 • Major release number is an extension of minor release number. • From semantic versioning, Django 1.7 should be 2.0, because backwards-incompatible.
  • 7. When is right time to upgrade? • Your project’s Django version is no longer supported. • Do a patch upgrade! Always. • You have an existing comprehensive test suite. • If you don’t have a test suite, then now would be a good time to start writing unit tests. 7
  • 8. 8 Current Django Versions Source: https://www.djangoproject.com/download/
  • 10. • Hard to know how much time or effort it takes • Hard to know which tests will break or even run • Hard to know if UI will continue working • Confirm functionality at every part of development • ie: local host, staging, deployment. 10 Why is upgrading a Django project a difficult thing to do?
  • 11. What does the end product look like in code? 11
  • 13. Upgrading OpenHatch 13 • OpenHatch vendors all its dependencies. • Commits that are "Add upgraded version of library Z” with full library source code. • ~4 weeks to go from broken Django project to functional upgraded Django project, including dependency updates. • Doing frequent git rebasing & resolving merge conflicts is terrible.
  • 14.
  • 15. What is step zero? pip uninstall django pip install django==<NUMBER> 15
  • 16. What NOT to do Do not skip over versions. If you do, you will • miss deprecation warnings • supported for 2 versions • have invalid code • call APIs or use modules that don’t exist in newer Django version 16
  • 17. What is step 1? python manage.py tests 
 
 Possible results: 1. Your tests may not even run. 2. Your tests may fail. 3. All your tests pass. 17
  • 18. Option 3: All your tests pass right after installing new Django
  • 19. Option 2: Your tests fail. What’s next if tests fail? Fix tests, one at a time 19
  • 20.
  • 21. At the end, what does “SUCCESS” look like for a fully upgraded project? In this order: 1. All tests pass with no errors or deprecation warnings. 2. UI works locally. 3. Deployment works on staging. 4. UI works on staging. 5. Deployment works on production. 6. UI works on production. 21 Break a big task into smaller tasks.
  • 22. What is this entire process? Run thru these steps in this order: 1. Run existing unit tests. Fix broken tests. 2. Run same existing unit tests. Confirm that fewer tests fail. 3. Rinse and repeat steps 1-2 continuously until all tests pass. 4. Check the UI to see if it all still works. 5. Edit deploy script, requirements.txt, documentation. 22
  • 23. What are the challenges? 23
  • 24. > ls vendor/packages/ BeautifulSoup django-authopenid docutils odict south Django django-celery feedparser ordereddict sphinx Jinja2 django-debug-toolbar gdata python-dateutil sqlparse PyJWT django-extensions ghettoq python-memcached staticgenerator PyYaml django-http-proxy html2text python-mimeparse twill Pygments django-inplaceedit html5lib python-openid twisted amqp django-invitation importlib python-otp typecheck anyjson django-kombu irc python-patch unicodecsv beautifulsoup4 django-model-utils jsmin python-social-auth unittest-xml-reporting bleach django-picklefield kombu pytz webob celery django-registration markupsafe Lots of dependencies may break 24 Options: 1. Upgrade dependency. 2. Patch it yourself (and upstream it). 3. Use a different similar dependency.
  • 25. LOTS of release notes • Deprecation warnings or test errors will tell you which release notes to read. • Replace syntax with newer syntax. 25
  • 26. Some are simple changes Upgrade to 1.5: Fix deprecation issue with AdminMediaHandler
  • 27. Edit manage.py when upgrading to Django 1.5 27 Some are simple changes
  • 28. Replace "direct_to_template()" with generic template view. This is a deprecation documented in Django 1.5 release notes.
  • 30. Fix the template quotes syntax issue This syntax issue is documented in release notes when upgrading to Django 1.5. In templates, change tags like {% url myview %} to {% url "myview" %}
  • 31. Take aways 31 • Do an upgrade 1 version at a time. • Run unit tests, see what breaks, then fix tests 1 at a time. • Read release notes. • Break every task into small steps. • A checklist helps. • So does taking notes.
  • 32. 32 How many people have been planning to do an upgrade on their Django project?
  • 33. Announcing Django Upgrade Open Space 33 Have you done Django upgrades before or are looking to do so for your personal project(s)? WHO: Anyone who wants to upgrade their projects. Anyone with experience with upgrading projects. WHAT: Work on your Django project. Mentor(s) will be there. WHEN: this Saturday & Sunday mornings
  • 34. Thanks! Hope this helps. Thanks Cisco for sponsoring me to go on this trip. Susan Twitter: @ArcTanSusan 34