Modern Python Projects Transcripts
Chapter: Managing Python project
Lecture: Pin your dependencies!

Login or purchase this course to watch this video and the rest of the course contents.
0:00 In the previous lesson, we saw that we can tell pip to,
0:03 install whatever latest version it can find or to install a specific version.
0:08 Installing a specific version is called Pinning Dependencies.
0:12 And always make sure to pin dependencies on your production servers,
0:16 all of them. If you don't,
0:18 you might install different packages on your production, then you use during the development,
0:24 and those different versions might not work properly.
0:27 And you won't realize that they are not working properly, because when you're on tests,
0:32 you use a different versions of dependencies, so your application will be broken.
0:37 And even if you have 100% test coverage,
0:40 you won't know that. So always pin your dependencies on the production server, to the
0:46 exact patch version. So no Django>=2.2 or Django<3
0:52 But be very specific, install
0:55 Django 3.1.2 because this is the version that you tested and you know that it will work.