Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Briefing a Delegate
Some managers think delegation is easy: you just ask someone on your team to go do a thing, then kick back with your feet on the desk until it’s done. Not true: delegating that way is a recipe for failure. To delegate effectively, you need to set up your delegate for success. This means explaining the work and desired outcomes, providing context, and teaching your delegate any skills they’ll need to be successful. -
How to load a Service Worker in Django
A service worker, part of the family of web workers, is, to put it shortly, a particular type of JavaScript code which can run off the main thread of execution. This has a number of benefits. In particular, service workers make possible to augment web applications with offline capabilities, and fine-grained cache management. In this brief post we see how to load a service worker in Django. The shortest introduction ever to service workers To put it simply, a service worker is like a proxy sitting in between the network and the web application. How to use a service worker? In its simplest form, we can load a service worker from any web page of the application, as in the following example: // Place this preferably in your app entry point: if ("serviceWorker" in navigator) { window.addEventListener("load", () => { navigator.serviceWorker .register("/service-worker.js") .then(registration => console.log("Service worker registered", registration) ) .catch(err => console.log(err)); }); } Here we check that the browser supports service workers, and we wait for the load DOM event before triggering the service worker registration: // navigator.serviceWorker .register("/service-worker.js") // This snippet is really important, and we can notice that we load our service worker from the root of … -
Django News - Django 4.0 alpha 1 released - Sep 24th 2021
News Django 4.0 alpha 1 released Django 4.0 alpha 1 is now available. It represents the first stage in the 4.0 release cycle and is an opportunity for you to try out the changes coming in Django 4.0. djangoproject.com Zappa is now deprecated Zappa was a serverless Python project that attracted wide attention. Unfortunately, the maintainers do not have the time to keep it alive. Feel free to fork and have a go at it if you have the time and inclination. github.com awesome-django now has discussions! The awesome-django repo repo now has 4.4k stars and is managed by Jeff Triplett and William Vincent. github.com Katia Lira Awarded the PSF Community Service Award for Q2 2020 Katia Lira, Software Engineer from Mexico city, has been awarded the Python Software Foundation 2020 Q2 Community Service Award. Katia is the President of DEFNA and a DjangoCon US organizer. blogspot.com Sponsored Jobs 💼 Canopy is hiring software engineers! We are seeking experienced software engineers to join our talented engineering team. We provide social impact programs evaluation & technical tools to maximize success! canopyteam.org Articles How to Decouple Your App From its Operating System with Docker See how we upgraded the version of Python … -
Finish School Break Filtering - Building SaaS with Python and Django #115
In this episode, we finished the UI work and wrote the final tests needed to complete the school break filtering by student feature. -
Finish School Break Filtering - Building SaaS #115
In this episode, we finished the UI work and wrote the final tests needed to complete the school break filtering by student feature. -
Cloning a Single Production Database Table from Heroku to Local Database with PostgreSQL in Docker Compose
I have a few Django apps in a Django project. I used factory_boy to mock a bunch of the data, but I have a few hundred rows of… -
Cloning a Single Production Database Table from Heroku to Local Database with PostgreSQL in Docker Compose
I have a few Django apps in a Django project. I used factory_boy to mock a bunch of the data, but I have a few hundred rows of accurate data in my production database. It made sense to work on a copy of that data as it contains no sensitive user information. My project is hosted on Heroku with one of their free tier PostgreSQL databases. My local environment is a Docker Compose stack with images for Python, PostgreSQL, and Redis. The trickiest part here, in my opinion, is finding out just how to get the backup to the PostgreSQL docker container. Table of Contents Table of Contents Backup the Production Database Clone to Local Database Conclusion Backup the Production Database There are two easy ways to do this on Heroku Use the Heroku CLI Use the Heroku web interface The Heroku docs detail how to make a backup. Use the Heroku CLI to Backup Database So first, if you aren’t already using it, you’ll need to install the Heroku CLI and run heroku login. Next, you’ll need to know your app’s name in Heroku. Mine is mastering-fitness, but you can get a list of all your Heroku apps right … -
People- vs Results-Oriented Management: Both Work!
Broadly speaking, there are two management styles: people-oriented and results-oriented management. Taken to extremes both styles have failure modes, but seeking “balance” isn’t the answer. Both modes can be successful! Embrace the style that comes easiest to you, while learning enough about the other mode to avoid pitfalls. -
How to keep all your websites in sync with scraping technology
Would you like to pull in the header and/or footer from a related but separate website for use on your own pages? Here's how. Introduction Many of our clients maintain multiple websites, or multiple domains within a single website. For example, "store.example.com" and "www.example.com" will almost always be different websites. In many instances, the different websites are maintained by different vendors; however, most have at least some elements in common, such as logos, headers, footers, etc. Often, when deploying a new site, these shared elements are simply copied and pasted from the main site. This is quick and easy to do, but the downside of this approach is that when someone inevitably changes a logo or other shared element on the main site, the element that should be universal across both sites will go out of sync. Such "quiet" errors might go unnoticed for long stretches of time. When they are noticed, it might take some digging to figure out what changed and whether any other websites or subdomains have been affected. How often does this happen? Doing a quick Google search of "store." yielded store.playstation.com. Here's a screenshot of the footer of store.playstation.com and playstation.com: store.playstation.com www.playstation.com Now, these two … -
Django News - Redis support for Django 4.0! - Sep 17th 2021
News Django 4.0 will feature built-in Redis backend! Thanks to Google Summer of Code student Daniyal Abbasi, Django 4.0 will feature built-in Redis support! github.com Sponsored Jobs Canopy is hiring software engineers! We are seeking experienced software engineers to join our talented engineering team. We provide social impact programs evaluation & technical tools to maximize success! canopyteam.org Articles Introducing django-upgrade, a tool for upgrading your Django projects A new tool from Django Security Team member Adam Johnson. Looks amazing! adamj.eu Understand Django - User File Use The latest installment in this series from Matt Layman covers file management, such as accepting images/files from users. mattlayman.com Bulk update with django and htmx Code and explanation for a very common issue: bulk uploads in Django. Using htmx no less. chriswedgwood.com Docker: From Development to Deployment with Django and Vue by Patrick Altman Patrick Altman shows us how he prefers to isolate his Django and Vue environment using Docker in a team-friendly and time-saving way. paltman.com AWS federation comes to GitHub Actions Are you underwhelmed when configuring AWS credentials to work with GitHub Actions? There is now another way. awsteele.com Tutorials How to Deploy Django using Caprover A tutorial on deploying Django using … -
Student Filtering UI - Building SaaS with Python and Django #114
In this episode, we worked on UI and form changes to enable the extra many to many filtering that enables school breaks to be applied to individual students. -
Student Filtering UI - Building SaaS #114
In this episode, we worked on UI and form changes to enable the extra many to many filtering that enables school breaks to be applied to individual students. -
Introducing django-upgrade, a tool for upgrading your Django projects
Django deprecates a small list of features with every feature release, requiring us to update our projects, which can be monotonous. Today I’m announcing a new tool I’ve created, django-upgrade, that automates some of this drudgery for us all. The Story¶ For a while I’ve enjoyed using pyupgrade, which upgrades Python syntax to the latest and greatest. pyupgrade is both fast and accurate, what you’d hope for in such a tool. The idea is to run it continuously, via pre-commit or similar, so that any new usage of old syntax you add gets automatically upgraded. Last year, after a django-developers discussion, Bruno Alla created a similar tool for upgrading Django projects called django-codemod. django-codemod works well, and I’ve enjoyed running it on a few projects, saving me hours of boring find-and-replace. The only downside is that it’s relatively slow, taking up to several minutes on a medium sized project. This makes it okay for one-off runs, but it’s not suitable for running continuously (except on CI). django-codemod’s slowness is due to the underlying library, LibCST, which implements its parser in Python. In contrast, pyupgrade is fast because it uses Python’s own C-based parser. LibCST also comes with compatibility concerns - … -
User File Use
In the last Understand Django article, you learned about Django settings and how to manage the configuration of your application. We also looked at tools to help you to be extra effective with settings. With this article, we’re going to dig into file management. Unlike the static files that you create for the app yourself, you may want your app to accept files from your users. Profile pictures are a good example of user files. -
User Session Data
Full show notes are available at https://www.mattlayman.com/django-riffs/15. -
Episode 15 - User Session Data
On this episode, we will dig into a data storage technique that Django makes heavy use of for visitors to your site. This category of data is called session data. Listen at djangoriffs.com or with the player below. Last Episode On the last episode episode, we looked at what it takes to go live and how to prepare your Django project for the internet. What Is A Session? A session is a set of data that is available to users that Django can use over multiple requests. -
Django News - Python 3.7.12 and 3.6.15 released - Sep 10th 2021
News Python Insider: Python 3.7.12 and 3.6.15 security updates now available Python 3.7.12 and 3.6.15, the latest security fix rollups for Python 3.7 and Python 3.6. blogspot.com PSA: Python 3.6 will stop getting security updates in December 2021. Via Itamar Turner-Trauring python.org Events Join the PyCon US 2022 team! Want to play a pivotal role in the planning and success of PyCon US? Here’s your chance! blogspot.com Sponsored Link REVSYS We’re senior Django developers, ops people, and consultants who have deep and vast experience to pull from. We know what works and what doesn’t. We have been where you are before (probably many times). Let us guide you onto a better path. revsys.com Articles Technical documentation writing quick tips by Marijke Luttekes An assortment of quick tips to help you make your technical documentation (docstrings, READMEs) easier to read. marijkeluttekes.dev Django React Boilerplate Learn how to bundle Django and React and code a full-stack boilerplate using this modern stack - with free samples. appseed.us Python Project-Local Virtualenv Management Hynek shows us his workflow for managing Python versions and what he considers the Python equivalent of node_modules using direnv. hynek.me Psycopg3 Initial Review psycopg3 is the successor to psycopg2, which is … -
Add Web app manifest to Django
Understand what is Web app manifest and how to generate app icons using NPM package in Django. -
Storing Django Static and Media Files on DigitalOcean Spaces
This tutorial shows how to configure Django to load and serve up static and media files, public and private, via DigitalOcean Spaces. -
Django News - Django bugfix 3.2.7 released - Sep 3rd 2021
News Django bugfix release: 3.2.7 The latest bugfix is available. As ever, the best security practice is to always be on the latest version of Django. djangoproject.com Python Insider: Python 3.9.7 and 3.8.12 are now available Python 3.9.7 is a features and optimizations update. 3.8.12 is the second security-only release of Python 3.8. blogspot.com Events Django Day Copenhagen 2021 has been postponed until 2022 At a critical juncture in our planning, we have sold too few tickets. To why we have this few tickets sold we can only speculate… One thing is sure, we will find a way to ensure that future events are communicated louder. djangoday.dk Sponsored Link REVSYS We’re senior Django developers, ops people, and consultants who have deep and vast experience to pull from. We know what works and what doesn’t. We have been where you are before (probably many times). Let us guide you onto a better path. revsys.com Articles HTMX Examples using Django Implementing htmx forms in a Django project. chriswedgwood.com Five Ansible Techniques I Wish I’d Known Earlier If you have spent any time with Ansible playbook, you might find a tip or two here that sparks joy. zwischenzugs.com Picturing Git: Conceptions and Misconceptions … -
School Break Filters - Building SaaS with Python and Django #113
In this episode, we finished up making changes to the app to support filtering school breaks to students. -
School Break Filters - Building SaaS #113
In this episode, we finished up making changes to the app to support filtering school breaks to students. -
Django REST Framework and Elasticsearch
This tutorial looks at how to integrate Django REST Framework with Elasticsearch. -
How to Version Control your Django project
In this post, we will be talking about version control and the best practices when it comes to Django projects. -
Django News - DjangoCon US 2021 Online Schedule and Tickets Available Now - Aug 27th 2021
News Django Survey 2021 Have you filled out the official Django Developers Survey? It helps the community know how Django and related tools/technologies are being used and guide the future development of the framework. jetbrains.com Announcing the 2021 DjangoCon US Talks The DjangoCon US talk lineup was just announced. 32+ talks over two days with more updates and surprises coming. djangocon.us Shamika Mohanan has joined the PSF as Packaging Project Manager The Python Software Foundation (PSF) is excited to welcome Shamika Mohanan as our new Packaging Project Manager! blogspot.com GitHub Actions: Reduce duplication with action composition If you use GitHub Actions for your CI pipeline, this composition update allows you to call other actions from inside of your actions workflows. Compositions are a great addition to GitHub Actions. github.blog Events DjangoCon US 2021 Online Tickets Available Now DjangoCon US 2021 tickets are now available, including free and donation tickets. Sponsorship opportunities, including a job board, are available now. The event is on October 22nd and 23rd. djangocon.us Sponsored Link REVSYS We’re senior Django developers, ops people, and consultants who have deep and vast experience to pull from. We know what works and what doesn’t. We have been where you are …