Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Static Files and Templates
Static files like CSS, JavaScript, and fonts are a core piece of any modern web application. They are also typically confusing for Django newcomers since Django provides tremendous flexibility around … -
Securing FastAPI with JWT Token-based Authentication
This tutorial shows how to secure a FastAPI application with JWT Token-based Authentication. -
How to Install Django
This tutorial covers how to properly install the latest version of [Django (4.1)](https://www.djangoproject.com/) and [Python (3.11)](https://www.python.org). As the [official docs note](https://docs.djangoproject.com/en/dev/topics/install/), if you are already familiar with the command line, … -
Django News - Bleach derecation - Jan 27th 2023
News Bleach 6.0.0 release and deprecation Bleach, the Python library for sanitizing and linkifying text in HTML, released 6.0.0 and was deprecated because html5lib is no longer actively maintained. bluesock.org The PSF is hiring a Security Developer-in-Residence! The Python Software Foundation (PSF) is happy to announce the launch of a year-long security enhancement initiative that will include a security audit and the creation of a new Security Developer-in-Residence role. blogspot.com Sponsored Ad 5th Annual Python Web Conf Early Bird Tickets On Sale! Early bird tickets (25% off) for the Python Web Conference, organized by Six Feet Up, expire Wednesday, Feb. 1 at 11:59pm ET (UTC -5h). Tickets include 5 days, 65+ live talks, expert-led tutorials, social events, an exclusive pass to all conference recordings for 90 days, cool swag and more. Don’t wait, buy your ticket today! pythonwebconf.com Articles How to simulate a broken database connection for testing in Django An overview of the challenges and three different solutions. neilkakkar.com Reflection on DjangoCon US 2022 Some recaps, favorite talks, and general impressions of DjangoCon US 2022. caktusgroup.com Configuring Sphinx Auto-Doc with projects having Django dependencies How to make it so projects with Django as a dependency benefit from Sphinx's auto-documentation … -
Integrating the Masonite ORM with FastAPI
This tutorial looks at how to use the Masonite ORM with FastAPI. -
Introducing: YAMS (Yet Another Media Server)!
Hello internet 😎 I’m here with a big announcement: I have created a bash script that installs my entire media server, fast and easy 🎉 TL;DR I’ve created YAMS. A full media server that allows you to download and categorize your shows/movies. Go to YAMS’s website here: http://yams.media or check it on Gitlab here: https://gitlab.com/rogs/yams. A little history When I first set up my media server, it took me ~2 weeks to install, configure and understand how it’s supposed to work: Linking Sonarr, Radarr, Jackett together, choosing a good BitTorrent downloader, understanding all the moving pieces, choosing Emby, etc. My plan with YAMS is to make it easier for noobs (and lazy people like me) to set up their media servers super easily. I have been working on YAMS for ~2 weeks. The docker-compose file has existed for almost 2 years but without any configuration instructions. Basically, you had to do everything manually, and if you didn’t have any experience with docker, docker-compose, or any of the services included, it was very cumbersome to configure and understand how everything worked together. So basically, I’m encapsulating my experience for anyone that wants to use it. If you don’t like it, at … -
Introducing: YAMS (Yet Another Media Server)!
Hello internet 😎 I’m here with a big announcement: I have created a bash script that installs my entire media server, fast and easy 🎉 TL;DR I’ve created YAMS. A full media server that allows you to download and categorize your shows/movies. Go to YAMS’s website here: http://yams.media or check it on Gitlab here: https://gitlab.com/rogs/yams. A little history When I first set up my media server, it took me ~2 weeks to install, configure and understand how it’s supposed to work: Linking Sonarr, Radarr, Jackett together, choosing a good BitTorrent downloader, understanding all the moving pieces, choosing Emby, etc. My plan with YAMS is to make it easier for noobs (and lazy people like me) to set up their media servers super easily. I have been working on YAMS for ~2 weeks. The docker-compose file has existed for almost 2 years but without any configuration instructions. Basically, you had to do everything manually, and if you didn’t have any experience with docker, docker-compose, or any of the services included, it was very cumbersome to configure and understand how everything worked together. So basically, I’m encapsulating my experience for anyone that wants to use it. If you don’t like it, at … -
Django News - Django 4.2 Alpha 1 Released - Jan 20th 2023
News Django 4.2 alpha 1 released Django 4.2 alpha 1 is now available. It represents the first stage in the 4.2 release cycle and is an opportunity for you to try out the changes coming in Django 4.2. djangoproject.com Git security vulnerabilities announced tl;dr Upgrade to the latest Git version as soon as possible. github.blog GitHub Copilot Litigation From November 2022 but still relevant. It is a class-action lawsuit against GitHub Copilot which trained its AI systems on public GitHub repositories (and potentially private as well) including Django's. githubcopilotlitigation.com Articles PyDev of the Week: Tim Schilling - Mouse Vs Python Tim is a longtime Django user who currently works on multiple third-party packages including django-debug-toolbar. He also gave a Django debugging tutorial at DjangoCon US last year. pythonlibrary.org Why I Like Nox Tox is a command-line tool that automates testing in multiple Python environments. Nox is a similar tool that aims to simplify the usage of Tox by using standard Python files instead of INI-config files. hynek.me Sponsored Link Meet Wagtail, the #1 Django-powered CMS 100% open source. Powered by Python & Django. Built for editors and developers with excellent documentation. Trusted by Google, NASA and hundreds of thousands of … -
Configuring Sphinx Auto-Doc with projects having Django dependencies
How to make it so projects with Django as a dependency benefit from Sphinx's auto-documentation features. The Problem I want to be able to document open source packages with Sphinx (ex. xocto) and have Sphinx automatically document the Django helpers. This isn't quite the same as documenting a Django project, so I wasn't sure if the otherwise awesome sphinxcontrib-django would be the right tool. Fortunately, there's a solution that doesn't require any additional packages. The Solution Configuration First, in the Sphinx docs folder, create a file called django_settings.py and add the following: """ Minimal file so Sphinx can work with Django for autodocumenting. Location: /docs/django_settings.py """ # INSTALLED_APPS with these apps is necessary for Sphinx to build # without warnings & errors # Depending on your package, the list of apps may be different INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.contenttypes", ] Next, at the top of Sphinx's conf.py, add the following: # docs/conf.py import os import sys import django # Note: You may need to change the path to match # your project's structure sys.path.insert(0, os.path.abspath("..")) # For discovery of Python modules sys.path.insert(0, os.path.abspath(".")) # For finding the django_settings.py file # This tells Django where to find the settings file os.environ["DJANGO_SETTINGS_MODULE"] … -
Multi-Region Python Applications
This article shows at how to enable multi-region support in a Python application. -
Foxley Talent - Jon Gould
Foxley Talent DjangoCon Europe 2022 - Lightning TalkDjango Day Copenhagen - Lightning Talk “Navigating Your Next Job Search” django.social Torchbox AcademyHow to Get Hired as a Django DeveloperSupport the ShowThis podcast does not have any ads or sponsors. To support the show, please consider purchasing a book, signing up for Button, or reading the Django News newsletter. -
Why I Like Nox
Ever since I got involved with open-source Python projects, Tox has been vital for testing packages across Python versions (and other factors). However, lately, I’ve been increasingly using Nox for my projects instead. Since I’ve been asked why repeatedly, I’ll sum up my thoughts. -
Python Adventures — Logging
Python Adventures — LoggingThis article assumes that you are familiar with the following:coding in Python 3Python classesPython logging libraryThe purpose of this article is to document how we can use the Python logging library to record/capture/log whatever information we want in more than one destinations in the local filesystem.At the end of this article you should be able to:use the Python logging library to save information from your Python program in selected file destinationslog various types of informationconfigure the logging module to display certain types of informationconfigure the logging module to format the logged informationunderstand how not to use the Python logging libraryBackgroundAs software developers, we often ourselves using the Python print() function for debugging and/or displaying information to ourselves and our program users. What if we want to also capture some of these information in the local filesystem to be studied later or hand off to a third-party? Instead of reinventing the wheel by creating our own library to handle logging, we can take advantage of some of the useful features in the standard Python logging package.Logging LevelsThe Python logging system supports several levels of logging information — CRITICAL, ERROR, WARNING, INFO, DEBUG, and NOTSET. For the purpose of … -
Practice Python Web Projects
I firmly believe that substantial improvement in any skill can only be achieved through practice. With that in mind, I have compiled a list of projects I have built over the years to practice my skills with web frameworks. I hope that these projects, which have proven effective for me in learning frameworks, will also assist you in your growth. These projects are framework-agnostic and can be implemented using Django, Flask, FastAPI, or any other framework of your choice. While some projects may be better suited for certain frameworks, all of them provide valuable practice. All of these projects can be completed using either the default frontend templating system or a frontend framework like React or Vue. The Projects 1. API to Data Creating a web application to present data can be a lot of work. An alternative option is to build an API that returns the data in a well-structured format. This project is a great opportunity to practice using Django REST Framework, Flask, or FastAPI. In fact, it is my understanding that FastAPI was specifically designed for this purpose. Nevertheless, this project can be implemented using any framework and is a valuable practice. Bonus points: Don't create the … -
Removing comments from my blog
I’m removing comments from my blog. I’ve been thinking about this for a while, but I noticed that comments weren’t being used and most posts were not that interesting. Don’t get me wrong, I really appreciate your awesome comments, but running commento takes a lot of resources and I don’t really see the full benefit of them. From now on, if you want to leave a comment (“thank yous”, suggestions, etc), you can send me an email. You’ll find my email addess on the Contact page. You have a good and relevant comment, I’ll update the relevant post accordingly. -
Removing comments from my blog
I’m removing comments from my blog. I’ve been thinking about this for a while, but I noticed that comments weren’t being used and most posts were not that interesting. Don’t get me wrong, I really appreciate your awesome comments, but running commento takes a lot of resources and I don’t really see the full benefit of them. From now on, if you want to leave a comment (“thank yous”, suggestions, etc), you can send me an email. You’ll find my email addess on the Contact page. You have a good and relevant comment, I’ll update the relevant post accordingly. -
Django News - DjangoCon Edinburgh May 29th - June 2nd - Jan 13th 2023
News DjangoCon Europe is coming to Edinburgh! The website is completed and up now. Dates are May 29th - June 2nd with a Call for Proposals coming soon. djangocon.eu Python 3.12.0 alpha 4 released Python 3.12 is still in development and this is the fourth of seven planned alpha releases. blogspot.com PSF News: Starting 2023 with momentum, thanks to you! The PSF ended their year-end fundraiser and membership drive with over 300 memberships and renewals and raised $61,868 with JetBrains’ generous matching. blogspot.com Articles Environment Files Help You Store Variables A solid description of environment variables and how/why to implement them via a .env file. automationpanda.com Headaches migrating an old postgis database server How to use pgdump --format=custom to get around some issues with migrating a much older legacy database. vanrees.org WebAssembly and its platform targets Brett Cannon answers the question, "What is WebAssembly?" snarky.ca Forum Favorite 3rd Party Environment Variables Package? A Django Forum thread on current options for implementing environment variables. djangoproject.com Sponsored Link Want a fun project for the New Year? Try Wagtail CMS See why Django developers think Wagtail is a “joy to extend.” Trusted by Google, NASA, and many, many others. The #1 Django-powered CMS. … -
Surprising Consequences of macOS’s Environment Variable Sanitization
macOS removes all environment variables starting with DYLD_ as part of its System Integrity Protection (SIP). Depending on how deep you go, the consequences can be surprising. -
Reflection on DjangoCon 2022
Ronard's Recap "It takes a village" the African proverb goes. Nowhere was this as apparent as in DjangoCon. It was my first technology conference and my experience could not have been better. People from the most senior developer to fellow juniors and even one of the co-creators of Django made the experience feel warm and inviting. Perhaps knowing that you are surrounded by introverts alleviates the social pressure, knowing that everyone has a common interest, or perhaps even love for programming also brought a soothing feeling to the experience. I found several of the talks and subjects interesting, but the best part by far was the people behind the stories. It was fascinating to learn that some people are using Django to promote democracy, others to help those in need by providing them with means to access food, and even to help empower social classes by teaching them not only technology skills but also educating them in ways to manage the money they will earn. Those are the things that I took home with me as the plane door closed in sunny San Diego. I attended the conference thinking that I would bring home solely technical skills and maybe a … -
Django News - Django 4.1.5 bugfix released - Jan 6th 2023
News Django bugfix release: 4.1.5 Django 4.1.5 fixes a bug in 4.1.4. Also, the latest string translations from Transifex are incorporated. djangoproject.com Stepping Down as Fellow Carlton Gibson, a Django Fellow since 2018, recently announced plans to step down later this year. noumenal.es WhiteNoise 6.3.0 Release WhiteNoise simplifies static file serving for Python (Django) apps. The most recent update was just released. evans.io Pillow 9.4.0 Release Pillow is the default imaging library for Python and frequently used with Django. The most recent release adds many new features. readthedocs.io Articles Questions to ask a Django company A list of good questions to ask a Django company before you decide to join. better-simple.com How Does Django's StreamingHttpResponse Work, Exactly? A vintage but still relevant post on using Django's StreamingHttpResponse at the WSGI layer. Includes an demo repo, too. andrewbrookins.com How to Create Rows in the Database with Django ORM Demonstrating multiple ways with code to create objects in the database with the Django ORM. ctrlzblog.com Classifying Python virtual environment workflows An overview of current approaches to Python virtual environment workflows and ideas for the future. snarky.ca Forum Django Internals / Mentorship: Looking to get involved? Join the Django community and contribute to … -
Headaches migrating an old postgis database server
Years ago, a database server was installed. Ubuntu 14.04 with postgres 9.3 and postgis 2.1, the standard stuff for 14.04. Over the years, some 450 databases were created by our consultants for various geo-water-related projects. 14.04, so it should have been updated at least four years ago, but we never got around to doing it. It was "only" an internal server, so no priority. Last week, we created a new server and wanted to do a simple pg_dumpall on the old and a psql < all.dump on the new one. Nothing fancy. It was a big 250 GB sql dump file. Ideally, you'd remove unused databases beforehand. But how? It has been in use for eight years. Cleaning up isn't our company's biggest strength. We did send out an email "what can be removed?" but almost nobody answers. Colleagues who made databases seven years ago and don't work at the company don't even receive the email :-) If you don't answer, the database is probably just left alone. "It might be useful later". Well, so a quick pg_dumpall was done. But the restore failed. Then I got called in to see if I could figure something out. It took a … -
Sentry - David Cramer
Sentry@zeeg on TwitterCodecovSupport the ShowThis podcast does not have any ads or sponsors. To support the show, please consider purchasing a book, signing up for Button, or reading the Django News newsletter. -
Django News - Happy Django New Year! - Dec 30th 2022
News Python Software Foundation - December 2022 Newsletter In case you missed the PSF's December Newsletter, you might want to check it out to see what is the latest information about what is going on with the PSF and PyCon US 2023. mailchi.mp Articles Electron + Django, desktop app integrate JavaScript & Python Learn how to build a desktop app with Electron and Django in this two-part article. The Django application runs while the desktop app is running. dev.to Making pip installs a little less slow Some valuable advice for speeding up pip install both inside and outside of containers. pythonspeed.com Sponsored Link REVSYS We can help you with your project as experienced Django developers and consultants. Follow our open-source projects on GitHub at https://github.com/revsys to see what we're working on and how we can support you. github.com Events PyCon Italia: Call For Proposals You have until January 15th, 2023, AoE, to submit your talk to PyCon Italia 2023! pycon.it Tutorials Introduction to Custom Actions and Bulk Actions in Django Learn how to add custom and bulk actions to the Django admin dashboard in this tutorial. dev.to Build a fast search UI with Meilisearch, HTMX and Django Learn how to … -
Neovim setup / Tisbury Treasure Hunt / django-stubs - Building SaaS #153
In this episode, I updated and supercharged my editor by switching to Neovim. After that, we did an Exercism excercise that looked at Python tuples. Then I started on a new issues for my SaaS, but pivoted to adding django-stubs to improve the type hinting in the code. -
Django News - Celebrate the Holiday Season with Django - Dec 23rd 2022
News PSF: More Python Everywhere, All at Once: Looking Forward to 2023 The Python Software Foundation (PSF) needs donations to support education and outreach initiatives in addition to its existing efforts to organize PyCon US and provide funding for smaller Python events and maintain critical infrastructure for Python users. blogspot.com Articles Boring Python: code quality The second post in a series describes how to build, deploy, and manage Python applications in a "boring" and efficient way. b-list.org Django API Domains This styleguide combines domain-driven design principles and Django's apps pattern to provide a pragmatic guide for developing scalable API services with the Django web framework. github.io Django Email/Contact Form Tutorial William Vincent shows us how to create a simple contact form to send Django emails with SendGrid. learndjango.com Forum Why do we need apps? A very interesting and lengthy discussion over at the official Django Forum on apps and their place in Django projects. djangoproject.com Top 5 3rd party packages An older Django Forum thread but still relevant discussing essential 3rd party packages. djangoproject.com Sponsored Ad Django for Beginners/APIs/Professionals Bundle Deal! Great Last Minute Gift! Buy all three for $20 off! Level up your Django knowledge with Django for Beginners, …