Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
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. -
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 -
Django in Production - III
Third part of the series covering how to get your django project into production -
Linode Object Storage for Django Static Files
Pushing Django into production... -
Auto Generate Django Models
Learn how to take a scraped da... -
Django News - Python 3.9 support for Django, Wagtail 2.11, and DRF 3.12.2. - Nov 6th 2020
News Django bugfix releases issued: 3.1.3, 3.0.11, and 2.2.17 Now with Python 3.9 support and a number of bug fixes. djangoproject.com Django REST framework 3.12.2 Released Bugfix release. django-rest-framework.org Wagtail 2.11 Released Lots of new features and bugfixes. github.com Events DjangoCon US 2020 Virtual A short video from DjangoCon US participants on what makes the conference so special. defna.org DjangoCon Europe 2021 DjangoCon Europe is tentatively planned for June 2-6, 2021 in Porto, PT. djangocon.eu PyCascades 2021 - Call for Papers PyCascades Remote CFP is open through November 10th, 2020. pretalx.com Django SF Virtual Meetup - November 10th Three deep technical talks on using feature flags, django-capture-on-commit-callbacks, and a view outside the technical bubble by the founder of Bradfield CS. meetup.com Articles MDN Web Docs evolves! Lowdown on the upcoming new platform Moving from Django to a JAMStack for the next version of MDN web docs, though keeping Django's auth pattern. mozilla.org Five Advanced Django Tips A look at Q objects, prefetch/select related, custom query sets, and more. laac.dev Understand Django - User Authentication A look at Django's built-in user authentication system, how auth is set up and what the default User model is. mattlayman.com Speeding Up Django Pagination Some … -
Detecting N+1 queries in Django with unit testing
When it comes to surfacing up N+1 problems in Django you have a lot of options. For one, you can use the debug toolbar which is kind enough to show duplicate queries in the SQL inspector: There is also the nplusone package, which does an amazing job at detecting N+1 queries. If instead you're lazy like me, you can use a unit test to detect N+1 queries, without installing any other package. Understanding N+1 and defining a baseline First off, you may want to define a baseline: how many queries should a view run in optimal conditions? Consider the following model for example: class Activity(models.Model): machine = models.ForeignKey(to=Machine, on_delete=models.PROTECT) def __str__(self): return f"Activity on {self.machine.hostname}" It has a foreign key to another model, Machine (not shown here). In addition, when we reference any instance of this model from within a template, its __str__ method builds a string based from the hostname property of the related model. This should immediately raise a red flag: it is a potential N+1 problem. To put things in context, imagine that in the view I select the machine_set for the current user with (machines are also tied to each user): # I'm inside a get_context_data … -
Create A Form Template - Building SaaS #78
In this episode, I created a template for one of my new forms on the new social media app that I’m building. We talked about context data, template styling, and special considerations for forms in templates. I had an empty template for the invite sending form to begin. I filled in a first attempt at the template with a header and displaying form errors. While building that, I added some context information that was needed for the display. -
My Favorite Technical Blogs and Mailing Lists
I keep up with what's happening in my field by following a number of blogs and an occasional email list. I don't read everything posted in all of these, but by scanning the topics in a feed reader, I can keep up with what's going on, without wasting a lot of time. The Caktus Group Blog Caktus's technical blog called "Developer Access," which you're reading now, regularly includes detailed technical posts based on our experience building and deploying complex websites and web apps. (Full disclosure: Of course, I write for it, as do many other Caktus employees.) Hacker News Daily Hacker News Daily is a helper for following the Hacker News site, which links to information all over the Internet ranging from interesting new software, to life as a developer, to the interaction between government and the technology business. Hacker News can be a big time sink if you try to follow it directly. Instead, the Hacker News Daily blog helps by daily posting a list of the top ten articles on Hacker News that haven't appeared there previously. Bulletproof TLS Newsletter The Bulletproof TLS Newsletter is an email list, not a blog. Messages are sent monthly, and cover the … -
Django: detail view must be called with pk or slug
Welcome back to another episode of my Django mini-tutorials! In this post we see how to deal with UUID as URLs in Django. Lately I've been experimenting with UUID as public identifiers in my Django URLs, an approach suggested in Two Scoops of Django, which incidentally I recall also having read from REST in practice, an old book from 2010. This technique consists of URLs made out from opaque identifiers, such as random numbers, or better, UUID. The goal is to obscure the model's primary key in your URLs. Opaque URLs in Django Let's see opaque URLs in practice. First off, in the templates you build your links as follows: // IMAGINE A FOR LOOP! <a href="{% url "ticket-detail" ticket.uuid %}">{{ ticket.subject }}</a> <a href="{% url "ticket-detail" ticket.uuid %}">{{ ticket.subject }}</a> This template can be served from a ListView for example, to render a list of models. Here ticket-detail is a named Django view, configured in URLconf as follows: urlpatterns = [ path( "tickets/<uuid:uuid>/", TicketDetail.as_view(), name="ticket-detail", ), ] As a path for the view we accept the uuid argument. The uuid field must be present in the model: class Ticket(models.Model): uuid = models.UUIDField(unique=True, default=uuid.uuid4, editable=False) # Other fields ... This …