Python

A collection of 130 articles

  • #Python
  • #Django
  • #models

Give Me A Break... Day - Building SaaS #67

In this episode, we did some Django model development. I created a new model to track break days in a school year. This model will be critical to fill in vacations and holidays so that the scheduling functionality works properly. I added the model, the tests, the admin page, and the create view to create break days in the app.

  • #Python
  • #Django
  • #views

Docs, Bugs, and Reports - Building SaaS #66

In this episode, I created documentation for anyone interested in trying out the application. After documenting the setup, I moved on to fixing a bug with the scheduling display of courses. In the latter half of the stream, we focused on creating a new reports section to show progress reports for students.

  • #Python
  • #Django
  • #models

Handle Default Values - Building SaaS #65

In this episode, I updated a model to handle the default duration of new tasks. This default needed to come from the Course model instead of the CourseTask model so we had to determine how best to set that data in various forms. I also fixed some drop down selection bugs that populated a form with the wrong data. We made sure that all the code was well tested.

  • #Python
  • #Django
  • #models

Episode 7 - Models and Managers and Querysets, Oh My!

On this episode, we will explore more about models and how to interact with data in your database.

  • #Python
  • #Django
  • #templates

Enrolling Students - Building SaaS #64

In this episode, we worked on a view to enroll students into a grade level for the school year. I added all the context data and used Tailwind to design the form layout to pick from a list of available grade levels. We added a variety of unit tests to prove the correctness.

  • #Python
  • #Django
  • #testing

Django Testing Toolbox

In this article, I cover the tools that I reach for to do automated testing when building a Django application. You will also see some common techniques that I apply to every project.

  • #Python
  • #Django
  • #models

The Home Stretch - Building SaaS #63

In this episode, we return to the homeschool application that I’m building. I’m in the final stretch of changes that need to happen to make the product minimally viable. We worked on a template, wrote some model methods, and did a bunch of automated testing.

  • #Python
  • #Django
  • #models

Episode 6 - Where Does the Data Go?

On this episode, we will learn about storing data and how Django manages data using models.

  • #Python
  • #Django
  • #hackathon

Hackathon App Part 2 - Building SaaS #62

In this episode, we took a break from the regular app to work on an app for a local hackathon that I’m participating in. This is the second week for the hackathon and in this stream, I apply the final touches to the application. We work on models, a template, and build an RSS feed using Django syndication contrib app.

  • #Python
  • #Django
  • #models

Store Data With Models

In this article, we will see how to store data into a database with Django models. The article covers how models act as an interface to let your application store and fetch data.

  • #Python
  • #Django
  • #hackathon

Hackathon App - Building SaaS #61

In this episode, we took a break from the regular app to work on an app for a local hackathon that I’m participating in. My team is building a mobile web app for the homeless around Frederick, MD. In this stream, we cranked through some modeling, admin building, a couple of pages, tests, and templates! We got a lot done!

  • #Python
  • #Django
  • #views

A View From Start To Finish - Building SaaS #60

In this episode, I created a view to add students from beginning to the end. I used Error Driven Development to guide what I needed to do next to make the view, then wrote tests, and finished it all off by writing the template code.

  • #Python
  • #Django
  • #views

Designing A View - Building SaaS #59

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.

  • #Python
  • #Django
  • #templates

Bread and Butter Django - Building SaaS #58

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.

  • #Python
  • #Django
  • #pytest
  • #testing

Switch A Django Project To Use Pytest - Building SaaS #57

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.

  • #Python
  • #Django
  • #bugs

How To Fix A Bug - Building SaaS #56

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.

  • #Python
  • #Django
  • #forms

Episode 5 - How To Use Forms

On this episode, we will learn about HTML forms and Django’s form system to use when collecting input from users.

  • #Python
  • #Django
  • #models

Remodeling Data Relationships - Building SaaS #55

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.