Live data from Hacker News

Django 2.2

djangoproject.com

191–200 of 257 posts

Re: Django 2.2

#191

The projects/app relationship never 'clicked' with me. I also have a dislike for the awkward 'polls' example in the django tutorial. That said, I like Django. Of course, I liked Rails better, but maybe that's because it was my 'first' and I never used any of the big php frameworks for a long period of time. I quit wasting my time with Flask for projects a while ago. It's a really great project and suited for smaller…

I feel the same way. Does any one have a good overview on how the community actually separates functionality into “apps”? I have been looking at a rails like framework in python called Masonite. Does anyone in the python/Django community think this will gain traction?

There's no hard rules about app separation. Here are some from my experience:

- You may have stuff that may be re-used for multiple projects. For example the departments of your organization and their attributes; these should be extracted to apps so they can be easily used for other projects. Of course this would make sense if you are a software house or an organization that need multiple apps (i.e a bank) not if you are working for a single application.

- Django recommends using a custom user model. I put that in a separate app along with any related classes like user preferences etc. See also my previous bullet.

- Non related models. If you add a model that doesn't have any relation to the rest of your models then maybe you should move it to a different app? For example in one of my applications I have a NewsItem model that is just a bunch of notes that the admins can add and will be visible to the homepage; there's no need to put it in with the rest of the app (of course this also obeys the 1st bullet)

- Beyond that, usually you'll understand when you have to separate your apps. You don't need to force it, I know of huge apps with a models or views py with thousands of lines (of course in such cases even if you think that these should belong to the same app nothing's stopping you from making them a package instead of a module). However you'll usually come to a point where you think that for your reasons you need to separate

Re: Django 2.2

#192

Earlier quoted context omitted.

> Living in society today involves having others' political views forced on me every day Yes to some extent. Most secular and democratic societies has agreed to a standard that I defend. Call it status quo if you want. I think decisions like Djangos goes against that standard and is probably why I feel so strongly about this. They want to police speech and force everyone to use specific words. I don't think we should…

> Most secular and democratic societies has agreed to a standard that I defend. Cool. But that’s your politics, and not necessarily everybody’s, and to have a different political position from you is not inherently morally wrong. We could argue about whether or not the status quo is fine, but that’s not the point - the point is simply that taking the status quo as acceptable is a political position which you’re subje…

> Or, in other words, you’re not for getting politics out of software - you’re for getting politics that you don’t agree with out of software.

Well yes, but I would be okay with the same being applied against me. Of course some basic level of politics is necessary (like licenses) if you want to count that as politics.

I won't go and put taxation politics, immigration politics or any other specific politic matters into my code or EULA. I expect this of other software as well. I don't want any unnecessary politics in the software when there clearly is no reason for it.

Re: Django 2.2

#193
post #2

Nice. Anyone building fun stuff using Django these days?

Me for like 7-8 years. Just building boring intranet apps (some are CRUD, some have a little workflow but nothing too complex) for a public sector organization with only a light touch of JS (some Jquery if needed) and everything else Django request + response.

It may seem boring but it is the most productive setup I've ever experienced; I don't think that there's anything more powerful for such things (except maybe some IDEs like PowerBuilder however I think that these are way too niche on their capabilities; they may be fast and easy to create the thing that they know how to create but god help you if you need to create something more complicated; Django on the other hand is a general purpose framework; whatever you throw at it it will happily eat)

Re: Django 2.2

#194

Earlier quoted context omitted.

I feel the same way. Does any one have a good overview on how the community actually separates functionality into “apps”? I have been looking at a rails like framework in python called Masonite. Does anyone in the python/Django community think this will gain traction?

I don't use multiple apps anymore and instead treat the project as the app, so my directory structure looks something like this ('project' can change to something specific to what you're working on): * manage.py * project/settings.py * project/urls.py * project/models/ (each model gets it's own file here) * project/views/ (same for views) ...and so on. And in `INSTALLED_APPS` I just add 'project'. Makes it so I don't…

I've never gone so far as each model getting its own file. Interesting idea.

Re: Django 2.2

#195
post #124

Earlier quoted context omitted.

> Living in society today involves having others' political views forced on me every day Yes to some extent. Most secular and democratic societies has agreed to a standard that I defend. Call it status quo if you want. I think decisions like Djangos goes against that standard and is probably why I feel so strongly about this. They want to police speech and force everyone to use specific words. I don't think we should…

It feels to me, that people don't realize that there are probably a lot more people out there who speak English not as their first language, hence they don't have the same connotations of many words as the native speakers. When I hear Django for example, first thing I think of is the slave from the "Django Unchained" Tarantino movie (or Django Reinhardt, the gypsy musician)... Maybe this web framework shouldn't name…

I linked to the now infamous Django PR that removes the words "slave" and "master" and said I stopped using django since then (after writing it is a great framework).

Re: Django 2.2

#196
post #149

Earlier quoted context omitted.

Many many organizations are acting as if completely unaware of the EOL. I assume they will simply run on the last 2.7 release until projects are shut down.

If I had any Python 2.7 stuff, I would simply move it to Pypy which has no such obsolescence date.

It's not just Python 2 itself that's going away, it's many of the popular packages for it, as well. Some are specifically waiting for 2.7 EOL to pull the plug on their side, so it's going to get much worse for anybody stuck on it.

Re: Django 2.2

#197
post #80

Earlier quoted context omitted.

Trying to move, but it's tough. Old codebase, lots of deps, and no real benefit to upgrading to 3.6, nothing our end users will care about or notice (or pay for). Upgrading to Python 3 is a chore. We have to do it, but it's not fun and it's barely useful.

don't your users in 2020 care you are using an unsupported language? security wise

Of course not. That's the point.

Re: Django 2.2

#198
post #80

Earlier quoted context omitted.

Trying to move, but it's tough. Old codebase, lots of deps, and no real benefit to upgrading to 3.6, nothing our end users will care about or notice (or pay for). Upgrading to Python 3 is a chore. We have to do it, but it's not fun and it's barely useful.

I would argue py3 has negative utility for that reason. Plus, the mess of 3.5 vs 3.6 vs 3.7.

What happened between those?

Re: Django 2.2

#199
post #147

This release includes the Watchman based reloader I worked on for about a year. It turns out auto reloading in Python is not an easy task, and I’m really nervous about edge cases I haven’t considered! I’ve actually had a nightmare where everyone’s auto reloader was broken. While it never runs in production (right?!) it’s actually a pretty critical bit of Django that had not been touched in about 10 years!

Congratulations! What a great contribution, thanks very much for your work.

Re: Django 2.2

#200
post #146

I would just add that if you’re new to Django read https://simpleisbetterthancomplex.com - there are ton of detailed explanations that go deep in how Django can be extended. It’s definitely not the run of the mill tutorial blog that is only surface level.

Yeah I can't recommend simpleisbetterthancomplex enough for anyone into Django. Great tutorials and articles about many issues you typically run into or just best practices for certain things. The guy who runs it even started a nice community forum that's been very helpful too.
Post reply on HN