News for hackers. Stuff that matters.
Re:Using a Framework will harm the maintenance of your software by travisjungroth on Wednesday October 12, 2022 @10:53PM (#33186595)
Are we using different Djangos?

Let’s take it for granted you’re using it with HTTP since it’s a web framework (this would all apply with WS).

You routes call your views. Your views load your models. These feed into your templates, which go into a response. You can tweak what’s going on at each step (DRF) but there’s definitely a way it’s all supposed to work together. It’s classic IOC.

Re:Using a Framework will harm the maintenance of your software by ensignavenger on Wednesday October 12, 2022 @11:08PM (#33186696)
I use Django with and without HTTP.

All a Django View is is a function (or in the case of a class-based view, a method of the class) that takes a request object and returns a response object... this is pretty fundamental to HTTP, so any HTTP app will do this. Its not Django dictating it, its the nature of HTTP.

You don't have to use any of those parts of Django if you don't want to.

I often opt to use Jinja2 instead of the Django Template Engine. I happen to like the Django ORM, so I usually do use it, but you certainly don't have to, I have certainly used Django without models before. Your views don't do anything with models unless you tell them to.

Re:Using a Framework will harm the maintenance of your software by ldng on Thursday October 13, 2022 @03:37AM (#33188296)
I second the mention that almost everything is replaceable in Django. And as a matter of fact DRF replaces the whole Request / Response handling with its own.
Re:Using a Framework will harm the maintenance of your software by matsemann on Thursday October 13, 2022 @03:36AM (#33188289)
I recently spent a few months on a project where we used Django without a single HTTP / external endpoint. It basically consumes messages from a rabbitmq queue, then creates new celery tasks which are then run.

Using Django for this is of course completely overkill, but using a known framework, especially considering that Django is what's used in other applications here, did have some benefits. All our devs having to fix something in this app, will immediately be familiar with it as it looks exactly like the other Django apps we have. No new way to do migrations, talk to the db, open a shell, log- and reliability setup is identical with other apps, etc. etc.