django-planet

Blog: Matt Layman

web https://www.mattlayman.com/tags/django/
Author

A View From Start To Finish - Building SaaS #60

June 11, 2020 » Django on Matt Layman » [Archived Version]

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. At the start of the episode, I gave a quick overview of the models in my application and which models I planned to focus on for the stream.

Read More

Designing A View - Building SaaS #59

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 More

Bread and Butter Django - Building SaaS #58

May 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 More

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

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 More

How To Fix A Bug - Building SaaS #56

May 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

Episode 5 - How To Use Forms

May 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 More

Remodeling Data Relationships - Building SaaS #55

May 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 More

User Interaction With Forms

May 5, 2020 » Django on Matt Layman » [Archived Version]

In the previous Understand Django article, we saw how Django templates work to produce a user interface. That’s fine if you only need to display a user interface, but what do you do if you need your site to interact with users? You use Django’s form system! In this article, we’ll focus on how to work with web forms using the Django form system. From Browser To DjangoURLs Lead The WayViews On ViewsTemplates For User InterfacesUser Interaction With FormsStore Data With ModelsAdm…

Read More

User Testing Feedback - Building SaaS #54

April 30, 2020 » Django on Matt Layman » [Archived Version]

In this episode, we worked on issues found from a round of user testing. I talked about how I did user testing with my customer, then started to tackle the usability issues that she identified. We’re taking a break from building the onboarding flow so that we can take some time to address feedback from user testing with my customer. I started the stream by explaining how I set up user testing and what I got out of the experience.

Read More

More Onboarding Goodness - Building SaaS #53

April 23, 2020 » Django on Matt Layman » [Archived Version]

In this episode, we continued with onboarding. I added unit tests for the new form and explained how foreign keys are wired through in CreateView. Then we marched on to the next template in the flow. In the last stream, we set all the context data for the view that shows the form to create a grade level for the school. With the context in place, and the form structure set, I added the form class that will create the GradeLevel record.

Read More