treyhunner, to django
@treyhunner@mastodon.social avatar

A controversial 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).

The Django docs introduce FBVs first and then discusses CBVs as well as Django's built-in "generic class-based views" (GCBVs).

Django-REST-Framework also makes heavy use of CBVs.

But class-based views CAN be confusing.

sabderemane, to django
@sabderemane@mastodon.social avatar

Do you have other ideas or similar like @paulox ? I'm trying to collect all the articles, infos and more about what people want for Django.

Please add it below or send me a DM if you don't want to share it here 🙏🏽


https://fosstodon.org/@paulox/111783847246554164

carlton, to django
@carlton@fosstodon.org avatar

In the latest @djangochat, @nessita discussed how her non-Django friends were underwhelmed by the features in 5.0 — the major version is meant to mean some big breaking change.

@wsvincent has discussed numerous times how the X.0, X.1, X.2 LTS, Y.0, … cycle is confusing.

But how could we change it? The X.2 tells you WHICH ONE is the LTS.

The 24 month cycle means that if we went CalVer (say) the .4 would always be the LTS, so 23.4 (4.2) 25.4 (5.2) and so on.

bmispelon, to django
@bmispelon@mastodon.social avatar

New article on my blog: a ORM technique I found for combining JSONObject and Subquery to build model instances: https://blog.bmispelon.rocks/articles/2024/2024-05-09-django-getting-a-full-model-instance-from-a-subquery.html

CodenameTim, to django
@CodenameTim@fosstodon.org avatar

Coming back at update_or_create for round 2!

If you call update_or_create where the instance already exists and the defaults passed in are already the values on the instance, do you ever want it to actually re-save the instance?

I'm running into the case where I'd prefer it to not update the instance if it doesn't need to. I'm guessing I'm overlooking some race condition problem though.

carlton, to django
@carlton@fosstodon.org avatar

Grrr, the leaky battery strikes again. Yet another beginner running into trouble setting up a custom user model.

https://forum.djangoproject.com/t/error-while-creating-a-model-using-abstractuser/25000

markwalker, to random
@markwalker@fosstodon.org avatar

I've written some thoughts on settings, inspired by this week, because it's so rare to see people sticking with a single settings file.

https://markw.co.uk/single-settings/django-simple-settings/

webology, to django
@webology@mastodon.social avatar

My magic wand would disable checks running on all the things by default unless explicitly turned called or turned on.

Q: Why does it take so long to run manage.py for my project?

A: Django's manage.py runs checks which scan every Python file by default with apparently no cache and takes double-digit seconds to minutes for non-trivially sized projects with no easy way to disable. You can pass --skip-checks. https://indieweb.social/@adamghill/111714833371229206

nanorepublica, to django
@nanorepublica@indiehackers.social avatar

idea of today

Has anyone considered using the Python extras to allow something like

pip install django[drf]

which would install django with DRF?

I assume not since we have been hesitant to officially endorse one third-party package over another...

Initially this either feels like a terrible idea or a further step to getting a third-party package into django core.

CodenameTim, to django
@CodenameTim@fosstodon.org avatar

Saturday morning package idea:

A tool that allows you to rapidly test and compare various indexes against a queryset or known view.

It then would configure the db, and run the queryset, store results, run explain analyze, store that, move onto the next and do the same, then at the end present and annotate the results.

felixxm, to django
@felixxm@fosstodon.org avatar

I've decided to retire from being a Django Fellow at the end of March 2024. It's a great honor to be a Django Fellow. I've spent the last 5 years in my dream job 💚 🦄 but it's time to move forward 🔭 I'm not abandoning Django completely, nothing like that 🤗. I will continue to be an active member of our amazing Community and do my best to help it grow 💓

I'm open to new positions from April, 1st, so contact me if you need someone with my expertise 🤝

https://www.mariuszfelisiak.org/

adamchainz, to django
@adamchainz@fosstodon.org avatar

✍️ New post on a little investigation into templates’ string_if_invalid option

https://adamj.eu/tech/2023/08/09/django-perils-string-if-invalid/

bmispelon, to django
@bmispelon@mastodon.social avatar
carlton, to django
@carlton@fosstodon.org avatar

OK, template-partials as 5.0 as_field_group() templates is my new hammer 🥰

adamchainz, to django
@adamchainz@fosstodon.org avatar

I just wrote this proposal that ’s third-party package tutorial recommend using a django_ module prefix to prevent name collisions, such as the historical one between django-ratelimit and ratelimit.

What do you think?

https://forum.djangoproject.com/t/change-reusable-apps-naming-recommendation/25233

webology, (edited ) to random
@webology@mastodon.social avatar

🚜 Refactoring and fiddling with Django migrations for pending pull requests 🐘: https://micro.webology.dev/2024/04/06/refactoring-and-fiddling.html

webology, to random
@webology@mastodon.social avatar

✨ If you use and don't know about django-extensions' show_url management command, it's the cheatsheet you didn't know you needed... or you knew you needed but didn't know what/where to look for it at.

It saves me tons of time and frustration when figuring out what a view is named from a third party app.

https://github.com/django-extensions/django-extensions

carlton, to django
@carlton@fosstodon.org avatar

CRUD views in your urls.py ✅
Single folder layout ✅
Default User model ✅

Not far of time for a redux of my as a Microframework talk 🤔

felixxm, to django
@felixxm@fosstodon.org avatar

My latest article shows how to smoothly propagate Database Changes in Blue-Green Deployments 💙 ➡️ 💚 using migrations :django: Check and share!

https://fly.io/django-beats/smooth-database-changes-in-blue-green-deployments/

carlton, to random
@carlton@fosstodon.org avatar

A quick TIL on CSRF and Trusted Origins in Django 4.x+.

https://noumenal.es/notes/til/django/csrf-trusted-origins/

sabderemane, to django
@sabderemane@mastodon.social avatar

I have a lot of questions, so I'm going to ask you at least one.

Who would like to see running the DSF board and why?

I'm asking that to know more about people but also to make you consider it if you're mentioned.

If it doesn't change anything, at least this will express kind words to someone 💚

https://www.djangoproject.com/weblog/2023/oct/13/2024-dsf-board-nominations/

valberg, to django
@valberg@social.data.coop avatar

So, admin and - sounds like a good match?

video/mp4

valberg, to random
@valberg@social.data.coop avatar

I've just written a async view returning a StreamingHttpResponse which streams the results of PostgreSQL LISTEN/NOTIFY messages as Server Sent Events. The future is now, using old tech. All thanks to Django 4.2 and psycopg 3 🫶

CodenameTim, to django
@CodenameTim@fosstodon.org avatar

I'm looking for some help running a GitHub organization dedicated to supporting community-maintained third-party #Django packages.

I've written up an introduction here: https://www.better-simple.com/django/2024/05/22/looking-for-help-django-commons/

You can join here: https://github.com/django-commons/membership

webology, to random
@webology@mastodon.social avatar

⬆️ The Upgrade Django project is a REVSYS project we launched ~3 years ago.

https://micro.webology.dev/2024/04/04/the-upgrade-django.html

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • rosin
  • mdbf
  • khanakhh
  • ethstaker
  • osvaldo12
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • Youngstown
  • everett
  • slotface
  • kavyap
  • anitta
  • cubers
  • Durango
  • modclub
  • tacticalgear
  • ngwrru68w68
  • tester
  • GTA5RPClips
  • provamag3
  • cisconetworking
  • normalnudes
  • Leos
  • megavids
  • lostlight
  • All magazines