web | https://www.mattlayman.com/tags/django/ |
---|---|
Author |
Jan. 8, 2020 » Django on Matt Layman » [Archived Version]
Maybe you have heard about Django and that it can help you build websites. You might be new to Python, new to web development, or new to programming. This new series, Understand Django, will show you what Django is all about. Throughout this series, I will reveal how Django is a powerful tool that can unlock the potential of anyone interested in making applications on the internet. Django is used by companies like Instagram, Eventbrite, Disqus, and Udemy, and is also a great tool for individual…
Read MoreJan. 1, 2020 » Django on Matt Layman » [Archived Version]
In this episode, we started a users app and hooked up the custom user model feature of Django to unlock the full extensibility of that model in the future. The stream was cut short this week because of some crashing issues in the OBS streaming software. The goal of the episode was to add django-allauth so that users can sign into the service with an email and password instead of the default username and password combination.
Read MoreDec. 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 MoreDec. 18, 2019 » Django on Matt Layman » [Archived Version]
In this episode, we set up a couple of tools that will be at the base of development. The first tool was django-environ to control Django settings from environment variables. The second tool was the django-debug-toolbar to help with debugging pages in future work. We started the stream with an upgrade to Django 3.0.1 because of a security release that was announced today. For a new project, I don’t recommend upgrading packages all the time, but security releases are my exception to that r…
Read MoreDec. 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 MoreOct. 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 MoreOct. 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 MoreOct. 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 MoreJuly 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 MoreJuly 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