Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
How to create a celery task that fills out fields using Django
Hi everyone! It’s been way too long, I know. In this oportunity, I wanted to talk about asynchronicity in Django, but first, lets set up the stage: Imagine you are working in a library and you have to develop an app that allows users to register new books using a barcode scanner. The system has to read the ISBN code and use an external resource to fill in the information (title, pages, authors, etc. -
How to create a celery task that fills out fields using Django
Hi everyone! It’s been way too long, I know. In this oportunity, I wanted to talk about asynchronicity in Django, but first, lets set up the stage: Imagine you are working in a library and you have to develop an app that allows users to register new books using a barcode scanner. The system has to read the ISBN code and use an external resource to fill in the information (title, pages, authors, etc.). You don’t need the complete book information to continue, so the external resource can’t hold the request. How can you process the external request asynchronously? 🤔 For that, we need Celery. What is Celery? Celery is a “distributed task queue”. Fron their website: > Celery is a simple, flexible, and reliable distributed system to process vast amounts of messages, while providing operations with the tools required to maintain such a system. So Celery can get messages from external processes via a broker (like Redis), and process them. The best thing is: Django can connect to Celery very easily, and Celery can access Django models without any problem. Sweet! Lets code! Let’s assume our project structure is the following: - app/ - manage.py - app/ - __init__.py … -
Django: Remove default entries from admin menu
The Django administration site comes with a couple of default entries, depending on which apps and middleware is installed. -
How To Use Linode's Object Storage For Staticfiles
Recently Linode has released an alternative to AWS's S3 object storage service, called Object Storage. It uses a similar S3 architecture to AWS's offering, albeit with a much more simplified ... -
Cyber Monday discount for Speed Up Your Django Tests
Earlier this week I tweeted about my two part offer on my book Speed Up Your Django Tests for this year’s Cyber Monday. Firstly, I’m offering a 50% discount on the book during the day. This will last whilst it’s the 30th November “Anywhere on Earth” (AoE), so as long as there’s one time zone where it’s Monday the 30th November, you can get that discount. The deal will stack with the regional discount that offers a 50% discount for those living outside the GDP top 50. If you live in such a country, email me to get a total of 75% off the list price. Secondly, to promote the deal, I’m giving away a free copy of the book to someone who retweets that tweet. I’ll do the draw at 09:00 UTC on Monday and announce it in the comments on Twitter. Buy it on Gumroad! If you’re looking for other deals on Python and Django learning materials, check out Trey Hunner’s post that compiles many offers available. I’m a subcriber to his Python Morsels and can attest to their quality for teaching you the breadth of features in Python. -
Django News - Final week of DSF Nominations - Nov 27th 2020
News 2021 DSF Board Nominations Nominations are open until November 30th for next year's Django Software Foundation board. djangoproject.com Events Pyjamas 2020 - December 5th, 2020 24 hours streaming of talks about Python and connecting with Python communities around the world that you can access at home. pyjamas.live Articles Migrating to a Custom User Model mid-project in Django A nice summary of the steps needed to migrate to a custom user model mid-project. rasulkireev.com The trouble with transaction.atomic by David Seddon Does Django's transaction.atomic trip you up? Us too. seddonym.me Django Best Practices: Models How to properly define and structure your Django models. learndjango.com Unravelling `not` in Python Brett Cannon deep dives into how the not operator works in Python. snarky.ca Django: Testing for Missing Migrations A short pytest test for missing migrations. Probably useful in every Django project. birdhouse.org Evolution of a Django Repository pattern An 18-step walkthrough of a sample Django repository. lukeplant.me.uk PostgreSQL Benchmarks: Apple ARM M1 MacBook Pro 2020 If you are curious how PostgreSQL performs on Apple Silicon chips then here you go. crunchydata.com The hidden Django anti-pattern preventing your prod rollback Hopefully, you won't need to rollback your migrations in production, but if you … -
Episode 10 - User Auth
On this episode, we’re going to look at working with users in a Django project. We’ll see Django’s tools for identifying users and checking what those users are permitted to do on your website. Listen at djangoriffs.com. Last Episode On the last episode, I explained the structure of Django application. We also talked why this structure is significant and how Django apps benefit the Django ecosystem as a tool for sharing code. -
User Auth
Full show notes are available at https://www.mattlayman.com/django-riffs/10. -
Django: disable inline option to add new referenced objects
The Django Web Framework makes it quite easy to add new referenced objects in the admin menu. -
Django Software Foundation - 2021 Board Nominations
2021 DSF Board NominationsDjango Software FoundationDSF Individual MembersDjango Forum: Additional DSF Funding UsesDSF Board Meeting Minutes 2020Support the ShowThis podcast is a labor of love and does not have any ads or sponsors. To support the show, consider purchasing or recommending a book from LearnDjango.com or signing up for the free weekly Django News newsletter. -
Django News - DSF 2021 Board Nominations - Nov 20th 2020
News 2021 Django Software Foundation Board Nominations Nominations for the 2021 DSF Board of Directors is now open. This is an excellent opportunity to help advance Django. We can’t do it without volunteers, such as yourself. For the most part, the time commitment is a few hours per month. Anyone including current Board members, DSF Members, or the public at large can apply to the Board. It is open to all who wish to participate. djangoproject.com Additional DSF Funding Uses A thread on the Django Forum about potential ways the Django Software Foundation could expand in coming years. djangoproject.com Wagtail 2.11.2 Released Wagtail 2.11.2 adds a half-dozen fixes and adds a few new features. github.com Tailwind CSS v2.0 – Tailwind CSS This is a major upgrade to Tailwind CSS, a popular CSS library commonly used in Django projects. tailwindcss.com Read the Docs Blog: Announcing Chan Zuckerberg Initiative Grant to Expand the Interoperability of Scientific Documentation Read the Docs received a grant from the Chan Zuckerberg Initiative’s Essential Open Source for Science (EOSS) program. Find out more about their plans. readthedocs.com Articles Django Best Practices: User Permissions An overview of three different ways to set user permissions with recommendations on when … -
Reordering Models - Building SaaS #80
In this episode, we looked at an UpdateView for the GradeLevel model in the homeschool application. Along the way, I had to display some UI elements on the grade to give users the ability to adjust the ordering of courses within their grade level. We started by adding the icon link that I wanted to use to give users access to the edit page. Once the link was in place, I created the URL and copied an existing view as a starting point for the UpdateView. -
Migrating to a Custom User Model mid-project in Django
Whenever you building a site with Django that will have user authentication, it is recommended to create a Custom User Model, before the first migration. Sometimes you forget to do that. In this case you have to follow a strict procedure, which I'll show you in the post. -
Migrating to a Custom User Model mid-project in Django
Whenever you building a site with Django that will have user authentication, it is recommended to create a Custom User Model, before the first migration. Sometimes you forget to do that. In this case you have to follow a strict procedure, which I'll show you in the post. -
Make A Hugo Static Blog Inside A Django App
I have a side project and I’d like to do some content marketing to potential customers to show how my product is useful. To do this, I need a blog for my project. Maybe you need a blog for your project too. Have you thought about where your blog will exist on the internet? For me, I considered two choices: Use a subdomain like blog.mysite.com. Use a route style like mysite. -
Evennia 0.9.5 released!
As of today, Evennia 0.9.5 is out. Evennia is a Python based library and framework for creating text-based multiplayer games (MUD/MU*). This is a gradual improvement halfway between 0.9 and the upcoming 1.0. So if you have been keeping up-to-date with the master branch of Evennia over the last year you will not notice much difference from this release (time to upgrade if you haven't been keeping up though!). While an interim release, there are still a lot of things that has happened since v0.9: Webclient improvements Big web client improvements (courtesy of contributor friarzen) - players can now save and restore pane layouts directly in the client (so you could have a separate pane for channel chatter, another for look-returns, two input panes etc etc). The layout changes makes it easier for devs to create default layouts to offer to players of their game. People in the Evennia community have already started doing very cool stuff with this, I'll try to gather screenshots for a future blog. Allow to redirect video/music to separate panes.Many other fixes, such as improving the input-history behavior. EvMenu improvementsEvMenu is a powerful system for creating in-game text menus.The EvMenu class was refactored to be easier to override. For … -
Django News - Malcolm Tredinnick Nominations - Nov 13th 2020
News Nominations for 2020 Malcolm Tredinnick Memorial Prize The Malcolm Tredinnick Memorial Prize is a monetary prize, awarded annually, to the person who best exemplifies the spirit of Malcolm’s work - someone who welcomes, supports and nurtures newcomers; freely gives feedback and assistance to others, and helps to grow the community. The hope is that the recipient of the award will use the award stipend as a contribution to travel to a community event -- a DjangoCon, a PyCon, a sprint -- and continue in Malcolm’s footsteps. djangoproject.com Sponsor @python on GitHub Sponsors You can now sponsor the Python Software Foundation on GitHub Sponsors. github.com GitHub Actions: Removing set-env and add-path commands on November 16 This is a security PSA for anyone who uses GitHub Actions for their CI and the set-env or add-path commands. They will stop working on November 16. github.blog Events Seattle GNU/Linux Conference SeaGL is free and November 13th and 14th. seagl.org Articles Hunting for Malicious Packages on PyPI Jordan Wright deep dives into how to detect a malicious PyPI package. jordan-wright.com Managing a Django Project with Poetry A quick guide to configuring Poetry, a Python dependency manager, in a Django project. rasulkireev.com Django Best Practices: … -
WhiteNoise Shenanigans - Building SaaS #79
In this episode, I worked on a method of adding static content to a site that didn’t involve the staticfiles directory, a separate domain, or a reverse proxy like Nginx. We had to get clever with Heroku buildpacks and how to configure WhiteNoise. I want to put a blog on my side project for content marketing purposes. I want the blog to be statically generated and have content come from Markdown (just like these show notes that you’re currently reading). -
Django @Instagram - Carl Meyer
OddBirdDjango @ Instagram - Django Under the Hood 2016Testing & Django - PyCon 2012PyCon 2017 Keynote - Road to Python 3 at InstagramPython at Scale: Strict ModulesSupport the ShowOur podcast does not have a sponsor and is a labor of love. To support the show, please consider purchasing one of the books on LearnDjango.com or suggest one to a friend. -
Django Best Practices: Projects vs Apps
Django's definition of an "app" is often confusing to newcomers. In this post we'll examine the four major concepts of Django architecture by building out a basic blog web application. … -
Django Sitemap Tutorial
A vital part of modern SEO (Search Engine Optimization) is to have a sitemap, an XML file that tells a search engine how often a page is updated and how … -
Django Email/Contact Form Tutorial
Let's build a simple contact form that sends email for a Django 4.1 website. We can take advantage of Django's built-in [email support](https://docs.djangoproject.com/en/dev/topics/email/) to make this relatively painless and then … -
Django Favicon Tutorial
This tutorial explains how to add a favicon to a Django website. The trick is it requires configuring your `static` files properly. To start things off, create a local directory … -
Django Polls Tutorial API
The [polls tutorial](https://docs.djangoproject.com/en/dev/intro/tutorial01/) is the official guide to Django. As a fun exercise, I wanted to show how little code it takes to transform it into a robust API using … -
Django in Production - III
Third part of the series covering how to get your django project into production