DEV Community

Cover image for A View From Start To Finish - Building SaaS #60
Matt Layman
Matt Layman

Posted on • Originally published at mattlayman.com

2

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.

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.

We worked on a view to add students. I did this using a technique that I called Error Driven Development. With this strategy, I started with what I wanted and followed the error messages to drive to what I needed to write. Django's error messages are good enough to show what was needed for each step.

After creating a view that didn't error anymore, I filled in some tests to prove that the view behaved in the way I wanted.

Finally, I wrote the template that provides the proper data for the newly created view.

Once the template was complete, I did one manual end-to-end test to confirm that the template and view worked together. I verified in the Django admin that the view created a new student.

This article first appeared on mattlayman.com.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay