Top Tweets for #DjangoJune
[Articles] Django June 2023 - Python Morsels
A summary of Django tips collected from #DjangoJune posts on Mastodon and Twitter in 2023. #djangonews
https://t.co/fvcpWLbhSz
Here's a summary of the couple dozen Django tips from my 2023 #DjangoJune adventure, including links to the Mastodon threads and occasional links to the Twitter threads.
Read the full article: Django June 2023
βΈ https://t.co/QhCIa1lW76
#Django
For the month of June I decided to post daily-ish social media threads (to both Mastodon and Twitter) on interesting Django-related ideas using the hashtag #DjangoJune.
Read the full article: Django June 2023
βΈ https://t.co/QhCIa1lW76
#Django
During the month of June (#DjangoJune) I shared #Django-related musings nearly every daily.
Here's a categorized summary of Django June. ππ¦
I'm surprised at how fruitful some of these threads were! π
https://t.co/02YvYgxeTm
What should you do if you need to run code "in the background" with #Django?
I recommend using a task queue. Specifically, I'd use Celery.
#DjangoJune
When one of the pages in my #Django admin interface feels a bit sluggish, what's the first thing I do?
Install (or enable) django-debug-toolbar and check the SQL panel.
Usually admin interface speed issues are related to N+1 issues.
#DjangoJune
How many models should you stick in your #Django app's models module?
When should you make a new app instead of adding more models to an existing app?
There isn't a straightforward answer to this question, but here are some things to consider...
#DjangoJune
Nearly all my #Django projects end up using django-simple-history at some point.
I pretty much always have at least one model where I wish I had access to all past model states either for customer support, debugging, or marketing/stats.
https://t.co/PYXidYMhe8
#DjangoJune
Pretty much all my projects also use django-relatives, which is my own library that includes helpers for linking between model relations in the admin interface.
You can find more admin-related packages here: https://t.co/pDrAFkUcfe
#DjangoJune
There are SO many useful third-party libraries for enhancing #Django's admin interface.
I pretty much always use django-admin-sortable for drag and drop sorting and django-admin-rangefilter for filtering by date ranges on my change lists.
#DjangoJune
Django signals: use them or avoid them?
If you'd like an event to trigger on each model save, #Django signals are the typical built-in solution, but they have their downsides...
I used to embrace signals, but now I use django-lifecycle. π§΅
#DjangoJune
A controversial #Django topic:
class-based views (CBVs) or function-based views (FBVs)? π€
I started with function-based views, but after a few years of using Django I pretty much moved fully to class-based views. Both have pros & cons (and vocal advocates).
#DjangoJune π§΅
How should you name #Django apps?
My guidelines:
β’ Try sticking to a single word
β’ Pluralizing the app's main model is great (users, exercises)
β’ A singular noun representing the topic is okay too (billing, blog)
β’ Use all lowercase!
β’ Avoid underscores
#DjangoJune
Here's an odd & interesting #Django fact I rarely use: you can use F objects on model attributes and they'll trigger when save() is called.
product.upvotes = F("upvotes") + 1
product.βsave()
Just keep in mind that every save triggers the F expression.
#DjangoJune
There's a TON to learn about #Django's ORM!
Here are some talks I recommend on this topic:
https://t.co/R0N1AKR8Oq
https://t.co/R0bSe3RMLW
https://t.co/0XGTwkcHL3
https://t.co/TefAOEfAVz
https://t.co/sBt1QqFwLW
Note the dates as some are new and some are old #DjangoJune
Database administrators worried about scaling need to know their SQL.
Django devs worried about scaling need to know their ORM.
Yes, you CAN resort to raw SQL when you need to, but you so rarely do!
Let's talk about the power of #Django's ORM.
#DjangoJune
If your Django admin site is accessible from any IP, I recommend linking to it in your site navigation bar, but only reveal that link to admin users.
I use the Django admin site a TON but I rarely type in the URL. Instead just click "Admin" after logging in.
#DjangoJune
With option 3, code like this:
>>> exercise.was_solved
Turns into this:
>>> exercise.stats.was_solved
That's only slightly more verbose!
We're still able to easily access the methods & data we need from a model object, but our model's code can be much shorter!
#DjangoJune
Last Seen Hashtags on Sotwe
μ€μ§μμ μ
Seen from United States
minichat(**)(**)(**) filter:videos
Seen from Netherlands
pinayviral
Seen from Philippines
BagueRΓ©glable
Seen from United States
minichat(*)(**) filter:videos
Seen from Netherlands
ordplanespotter
Seen from United States
γγ£γγζ¦θ‘θ§£θͺ¬γ‘γγγγ
Seen from United States
jilbabbugil
Seen from Indonesia
γ²γͺη₯γ2025
Seen from United States
Most Popular Users

Elon Musk 
@elonmusk
241.7M followers

Barack Obama 
@barackobama
119M followers

Cristiano Ronaldo 
@cristiano
114.6M followers

Donald J. Trump 
@realdonaldtrump
111.9M followers

Narendra Modi 
@narendramodi
107.2M followers

Rihanna 
@rihanna
98.7M followers

NASA 
@nasa
92.4M followers

Justin Bieber 
@justinbieber
91.8M followers

KATY PERRY 
@katyperry
90.1M followers

Taylor Swift 
@taylorswift13
84M followers

Lady Gaga 
@ladygaga
75.5M followers

Virat Kohli 
@imvkohli
73.5M followers

Kim Kardashian 
@kimkardashian
70.9M followers

YouTube 
@youtube
68.8M followers

Neymar Jr 
@neymarjr
66.5M followers

Bill Gates 
@billgates
65.3M followers

Selena Gomez 
@selenagomez
63.1M followers

The Ellen Show
@theellenshow
62.3M followers

CNN 
@cnn
61.8M followers

X 
@x
60.7M followers

