June 4, 2020 » Django on Matt Layman » [Archived Version]
In this episode, I focused on a single view for adding a course to a school year. This view is reusing a form class from a different part of the app and sharing a template. We worked through the details of making a clear CreateView. The stream started with me answering a question about how I design a new feature. I outlined all the things that I think through for the different kinds of features that I need to build.
Read MoreJune 3, 2020 » Django Chat » [Archived Version]
Daniel and Audrey Feldroy are the authors of the updated book Two Scoops of Django as well as Django Crash Course. They created the popular cookiecutter, cookiecutter-django, and django-crispy-forms packages, as well as the Django Packages website.
Read MoreMay 28, 2020 » Django on Matt Layman » [Archived Version]
In this episode, I worked on a views and templates. There are a number of core pages that are required to flesh out the minimal interface for the app. We’re building them. I began by showing the page that we were going to work on. I outlined the changes I planned to make, then we started. The first thing we added was data about the school year, the main model on display in the page.
Read MoreMay 27, 2020 » Django Chat » [Archived Version]
David is the author of the popular django-rest-framework-simplejwt package. We discuss authentication, JWTs, and his current role at an AI startup.
Read MoreMay 23, 2020 » Clivern » [Archived Version]
You can do that in Django using a middleware. The middleware needs to generate a unique request id (e.g. using UUID) and associate that id with the request. First way is to attach that id to the request.META in the middleware. the only problem is that you have to fetch that id from the request […] The post Adding a Unique Request ID to Each Request in Django first appeared on Clivern.
Read MoreMay 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 More