Live data from Hacker News

Django 2.2

djangoproject.com

181–190 of 257 posts

Re: Django 2.2

#181
Django is a magnificent piece of software.

I'm an experienced ReactJS developer and I discovered Django after ReactJS and I am finding myself developing new projects not with React but just with plain Django/JavaScript/HTML. That's because of the nature of my projects of course which are simple crud applications, but the point is that for simple applications, Django makes things incredibly easy and fast and importantly, easy to understand.

More sophisticated user interfaces I would definitely build in React of course.

Re: Django 2.2

#182
post #22

Django/Jupyter/pandas is an ecosystem that's hard to beat. If you're not already using it, check out `django-extensions`. You can use `./manage.py shell_plus --notebook` to launch a Django-friendly Jupyter notebook. From there you can prototype with extreme ease and confidence. I have also built a trivial custom model Manager so I can do stuff like: User.objects.all().to_dataframe("first_name", "last_name", "email")…

Not a data engineer / scientist here. What am I missing with data-frames? I've written products that utilized them before (years ago), but it's been long enough that I don't know what I would even use them for in daily programming.

They're for tables and doing table-ie things: an imperative programming method for the same tasks people use Excel or SQL for.

This dovetails nicely with most data science-ie tasks, like statistical analysis, engineering features, simple machine learning techniques (the tables can be easily transformed into numpy arrays), and plotting results.

You can use them any time you feel the need to do table manipulations on non-insanely-large data: aggregate, transform, combine, split, reshape, join...

Re: Django 2.2

#183
post #74

I'm a fan of Django, but I'm in doubt if I must still use it for my new project. I'll develop now an hybrid app that will start life as an mobile web site. I'll use one javascript framework and I'm really in doubt about using Django. If I use a javascript server framework, I believe that it will prevent me to duplicate forms validation code (in server in frontend) and also easier for SSR (Server Side Rendering). But…

I've used Django for 5 years, but never used it to serve the front-end client. I just use Django Rest Framework (DRF) with React on the front-end or Qt on mobile and desktop. Django is only the database REST interface and the client is either a binary or served over nginx.

Re: Django 2.2

#184
post #174

Earlier quoted context omitted.

>HN isn't a person, it's a distribution of millions of people. is obvious. what is insidious is the ideology that is preached on almost every controversial thread that papers over that fact.

That perception usually seems to be more related to the strength of one's own ideological commitment than to the actual state of the threads. People on each side perceive the community to be biased, and people who are intensely on one side perceive the community to be extremely biased. https://hn.algolia.com/?query=%22hostile%20media%20effect%22...

i'm not going to do a study of the culture of hn because i am not an anthropologist but i have many times responded to comments that were vile, that broke the rules, that did not get flagged because they toed the party line, that were in effect supported by the community

https://news.ycombinator.com/item?id=17032257

a selectively enforced set of laws becomes defacto discriminatory and ideological: https://scholarship.law.duke.edu/cgi/viewcontent.cgi?article...

Re: Django 2.2

#185

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…

> The projects/app relationship never 'clicked' with me.

This is an area that I think is poorly documented (both in the otherwise-great official docs and in the broader community). My advice for beginners is to just create an app called `core` and put everything there, until you have a reason to do something else. (I'd also propose putting your DJANGO_SETTINGS_MODULE aka "project name" as "django_settings" and only put your Django settings in there, but that's a little more esoteric and I'd not recommend that to a newbie in order to minimize confusion.)

In general, I think you should take the "monolith first" strategy (e.g. https://martinfowler.com/bliki/MonolithFirst.html) and just use a single app, unless you're writing something that is obviously going to be reused elsewhere.

The alternative is to attempt to define service boundaries before you know what your app's structure looks like; you'll inevitably get it wrong. And migrating models between apps is incredibly painful if you have foreign keys spanning apps.

I've also found a couple bugs in Django's migration machinery that only affect multi-app foreign key relationships; I've never seen a single-app migration bug. So there's a real cost to going down the multi-app path, which you need to balance against any benefits (I've seen none).

(Credentials/disclaimer; startup using DRF in prod for 3.5 years, mature domain model with ~50 model classes, feeling the pain of incorrectly choosing 5 apps in the initial setup instead of just using one. I'm sure there's a good argument for apps when you get to a larger scale and are sharing components/functionality between teams.)

Re: Django 2.2

#186
post #80

What I find most curious about Django/Python is that about 30% of the new installs are for legacy Python/Django (2.7/1.11): $ pypinfo --start-date 2019-01-01 --end-date 2019-03-31 -- percent --markdown django pyversion Served from cache: False Data processed: 160.22 GiB Data billed: 160.22 GiB Estimated cost: $0.79 | python_version | percent | download_count | | -------------- | ------: | -------------: | | 3.6 | 39.…

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

Re: Django 2.2

#187

Django is a magnificent piece of software. I'm an experienced ReactJS developer and I discovered Django after ReactJS and I am finding myself developing new projects not with React but just with plain Django/JavaScript/HTML. That's because of the nature of my projects of course which are simple crud applications, but the point is that for simple applications, Django makes things incredibly easy and fast and important…

That's the real power of Django for me: Good ol' HTML based apps (with a little salt of jquery when needed) using the tools that Django (and friendly projects) generously offer to create Angels in a fraction of the time you'd need with anything else!

Re: Django 2.2

#188
post #22

Django/Jupyter/pandas is an ecosystem that's hard to beat. If you're not already using it, check out `django-extensions`. You can use `./manage.py shell_plus --notebook` to launch a Django-friendly Jupyter notebook. From there you can prototype with extreme ease and confidence. I have also built a trivial custom model Manager so I can do stuff like: User.objects.all().to_dataframe("first_name", "last_name", "email")…

Not a data engineer / scientist here. What am I missing with data-frames? I've written products that utilized them before (years ago), but it's been long enough that I don't know what I would even use them for in daily programming.

From NumPy, you get fast (vectorized) operations on large multidimensional arrays of numbers. This bit not be so useful outside of a data-science context but it depends on what it is you _are_ doing. Most graphics stuff is also arrays of numbers, for example. Also lots of useful indexing/slicing/masking/filtering on those structures. You can also have non-numeric multidimensional arrays, but the performance part might not be there depending on the type.

Pandas adds utility methods like join, groupby, and fromsql. Also hierarchical indexing, and a bunch of other stuff that I don't know much about - I'm not in data-science either, but I work with some of them.

Overall, lots of useful stuff for processing tables locally once you've fetched them from SQL or similar. Also, the simple fact of having a tabular data structure without needing to define a custom Row class. Lists of dicts or tuples have a lot of overhead by comparison.

Re: Django 2.2

#189

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 quit wasting my time with Flask for projects a while ago. It's a really great project and suited for smaller things, but you just end up re-implenting django

This is spot on .... Flask is great, but it seems that to get anything substantial done with Flask you must first reimplement big chunks of Djangoesque functionality in it - why not just jump straight to Django?

Re: Django 2.2

#190

I love Django. I've used it for the last 8 years. I'm happy to see the project is still thriving. At this point, for me Django is pretty much synonymous with Django REST framework ( https://www.django-rest-framework.org/ ). I can't imagine a better API than Django w/ REST framework. For static sites I use Django's templates. Otherwise, I just use Django w/ REST framework for my API, and to serve up index.html. My ind…

I think it's worth mentioning, that the creator of Django REST framework is also working on Starlette [0], which is a modular framework that comes with async support, crazy performance, and more...

[0]: https://www.starlette.io/

Post reply on HN