django-planet

Blog: Matt Layman

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

A Failed SaaS Postmortem

Dec. 18, 2019 » Django on Matt Layman » [Archived Version]

My Software as a Service failed. After three years of running College Conductor, I’m shutting it down. The service failed for a host of reasons, and this article details what I learned from the whole experience. This is a chance for me to reflect, and give you some ideas of what pitfalls can happen if you’re planning to build a SaaS. The vision Before getting to the lessons, let’s look at my vision for the service so you have some context of what I was building.

Read More

New Project, Who Dis? - Building SaaS #38

Dec. 6, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we started a brand new project! I had some internet troubles so this “stream” is actually a local recording from my computer. We created a new Django project from scratch and set up Heroku to handle deployments. In spite of the streaming trouble, we were able to get a bunch done. We started the project from scratch so we made a repository on GitHub with some .gitignore settings tailored for Python projects.

Read More

Configurama - Building SaaS #36

Oct. 30, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we turned our attention to handling settings and configuration. We discussed different techniques for handling settings, looked at available tools, and started integrating one of the tools into the project. The initial discussion in the stream focused on different ways of doing settings. I talked about what I view as a difference between configuration (mostly static stuff) and settings (dynamic parts of the app). I also discussed where to get settings from.

Read More

Deploying WhiteNoise - Building SaaS #35

Oct. 23, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we updated Continuous Integration, Nginx, and the Ansible deployment tasks to use WhiteNoise. With all the changes in place, we tested things out to verify that WhiteNoise served up the CSS, JS, and image files. We started with Circle CI. First, I fixed the JS assets cache because the cache key never changed and Circle did not save fresh assets each build. After completing the assets cache, I created a new cache that stored all the static files after running collectstatic.

Read More

Bring in the WhiteNoise, Bring in Da Funk - Building SaaS #34

Oct. 2, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we added WhiteNoise to the app as a tool for handling static assets. This lets us move away from depending on Nginx for the task and gives shiny new features like Brotli support. We installed WhiteNoise into the requirements.in file and used pip-tools to generate a new requirements.txt. whitenoise[brotli]==4.1.4 Once WhiteNoise was installed, it needed two primary settings changes. Add a new middleware. Change the STATICFILES_STORAGE. MIDDLEWARE = [ .

Read More

Webpack and collectstatic in CI - Building SaaS #28

July 25, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we updated Continuous Integration (CI) to run webpack and the Django collectstatic command. This is part of the ongoing effort to simplify deployment by moving work to CI.

Read More

Connecting Shiv Apps with Ansible - Building SaaS #26

July 4, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we finished connecting the Django Shiv app into Ansible. This required messing with file permissions and copying settings files to their proper place.

Read More

It's Permissions, Dummy! - Building SaaS #25

June 27, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we got into a static files problem that caused a template to fail to load from the Shiv app. After some serious spelunking through the Django code and deep debugging, we found the file permission error that was the source of the problem.

Read More

In the Guts of a Shiv App - Building SaaS #24

June 20, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we got our hands dirty with the Django Shiv app that we build to work out issues with finding templates and other settings problems.

Read More

Making a Shiv App - Building SaaS #20

April 25, 2019 » Django on Matt Layman » [Archived Version]

In this episode, we took our Python package from the previous episode and bundled it together with the Python dependencies using a tool called Shiv from LinkedIn.

Read More