May 21, 2020 » Django on Matt Layman » [Archived Version]
In this episode, I replaced the default Django test runner to use pytest. We walked through installation, configuration, how to change tests, and the benefits that come from using pytest. We started by looking at the current state of the test suite to provide a baseline to compare against. After that, I went to PyPI to find the version of pytest-django that we wanted to install. I added the package to my requirements-dev.
Read MoreMay 20, 2020 » Django Chat » [Archived Version]
Nina is a Cloud Developer Advocate at Microsoft, Twitch Streamer, Pythoniasta, PyCon 2019 Keynoter, long-time DjangoCon speaker, and now teacher at FrontendMasters. We discuss learning Python & Django mid-career, VSCode, Azure, and more.
Read MoreMay 17, 2020 » django on roschegel » [Archived Version]
I’m always trying to find ways to make tests easier to read and extend. I hate working through a really hard feature and having to spend a big amount of time writing tests. Lately, I’ve been bothered by the amount of boilerplate on my test code. So, I decided to do some research and look for alternatives. When testing Django applications, I use a combination of Pytest fixtures and FactoryBoy to write tests that need database records. Pytest Fixtures allow you to abstract the initi…
Read MoreMay 15, 2020 » django on Jacob Kaplan-Moss » [Archived Version]
SQL Injection (SQLi) is one of the most dangerous classes of web vulnerabilities. Thankfully, it’s becoming increasingly rare — thanks mostly to increasing use of database abstraction layers like Django’s ORM — but where it occurs it can be devastating. This article will help you understand and prevent SQLi vulnerabilities in your Django apps.
Read MoreMay 14, 2020 » Django on Matt Layman » [Archived Version]
In this episode, we picked an issue from GitHub and worked on it. I explained the flow of using test driven development to show how the bug existed in an automated test. We wrote the test, then fixed the code. After that, we did some test refactoring to clean things up. We looked at what the issue was and how it is related to the handling of the Course model in a weekly view in the app.
Read MoreMay 13, 2020 » Django Chat » [Archived Version]
Erin is a Django consultant whose previous employers include Wharton and Caktus Group. We discuss how to go solo, manage the business aspects, and find clients.
Read MoreMay 11, 2020 » Django on Matt Layman » [Archived Version]
On this episode, we will learn about HTML forms and Django’s form system to use when collecting input from users. Listen at djangoriffs.com. Last Episode On the previous episode, we looked at templates, the primary tool that Django provides to build user interfaces in your Django app. Web Forms 101 HTML can describe the type of data that you may want your users to send to your site. Collecting this data is done with a handful of tags.
Read MoreMay 9, 2020 » django on roschegel » [Archived Version]
Tests need to be fast. If tests are slow, our development process is affected and we end up spending a considerable amount of time waiting for the results. I will go through some of the techniques that I’ve applied to speed up tests on Django applications. Tips for speeding up test execution 1. Run your tests in parallel If you are running your tests on multi-core hardware, running your tests in parallel is probably the best optimization you can make if you aren’t doing it yet. If you are using…
Read MoreMay 7, 2020 » Django on Matt Layman » [Archived Version]
In this episode, we’re remodeling! I changed the model relationship between GradeLevel and Course from a ForeignKey (1 to many) to a ManyToManyField. We talked through the change and started fixing all the tests that broke. After explaining the change that I wanted to make and why I want to make it, I explained how a foreign key and many to many relationship at the database level. Once we had the conceptual foundation in place, I started with the documentation.
Read MoreMay 6, 2020 » Django Chat » [Archived Version]
Markus is a longtime Django contributor. We discuss the work of the Security and Ops Teams, his day job at Crate.io, async, and the future of Django.
Read More