Live data from Hacker News

Discover Flask

discoverflask.com

71–78 of 78 posts

Re: Discover Flask

#71
post #57
post #55

Earlier quoted context omitted.

Why not just use SQLAlchemy with Django and ignore the built-in ORM?

Because the Admin and other features won't work?

In order to get the admin and other features, all you need to do is define your models in Django's system.

After that you can use SqlAlechemy as a side channel, just like a lot of people use NoSQL databases.

Re: Discover Flask

#73
post #23

Earlier quoted context omitted.

reframing the question to "python vs. node" on the server-side, the answer seems very dependent on the use-case. there's not (to my knowledge?) much agreement in the python community about how to compile to javascript, much less regarding an ecosystem of client-side libraries. if a rich client-side that shares logic with the server-side is part of the story, i don't think python is a good choice. i wonder if the Djan…

I don't think many python devs are espousing Python for the client side. I use react/underscore/Jasmine/sinon with ES6 run through Babelify for the client side. Sharing logic between client and server side means that your client and server side don't have clearly-defined responsibilities. The one exception to this might be input syntax validation, but generally that's a place where you don't want to roll your own any…

idk, could imagine wanting computation to run on the client when it's a desktop (to save server cycles) or the server when it's mobile (to save battery)... not a level of optimization i practically run into, but not an unreasonable example.

i guess a better thing to say is "exactly": specs often change and responsibility gets shifted around. so "runs everywhere" can be useful, whether it be js or otherwise.

Re: Discover Flask

#74

Earlier quoted context omitted.

Most people will tell you they're using 2.7 in production.

Because of legacy, but these days there is no reason not to use python 3 on new projects. Note that Python 2.x will no longer be supported in 2020.

There are a good amount of dependencies that haven't been ported to 3 yet. Using one of these directly, or as a secondary dependency, is the reason running 3 in prod is impractical for many of us.

http://py3readiness.org/

Re: Discover Flask

#75

Earlier quoted context omitted.

New projects depends on that legacy - in form of existing libraries. So, one may find themselves writing somewhat more code than they had expected, either as a new libraries or patching the existing ones to work with Python 3. Well, not that doing so is a bad thing - it's the contrary, esp. if the patch goes to the upstream - but still this may be frustrating to some. (Most common libraries are actually work pretty w…

This used to be an issue, but, in the past 2 years pretty much all the most used libraries have added a python 3 version.

I wish I could say this about our dependencies but it's not quite true yet.

I do run our requirements.txt through https://caniusepython3.com every few months though.

Re: Discover Flask

#76

Earlier quoted context omitted.

Because of legacy, but these days there is no reason not to use python 3 on new projects. Note that Python 2.x will no longer be supported in 2020.

There are a good amount of dependencies that haven't been ported to 3 yet. Using one of these directly, or as a secondary dependency, is the reason running 3 in prod is impractical for many of us. http://py3readiness.org/

So, ndg-httpsclient, mrjob, numpy, scrapy, monotonic and possibly others do have python3 compatibility.

Then there's a bunch of deployment tools like ansible, fabric, and marionette which don't really need to be python3 compatible for use.

Then there's tools like MySQL-python, python-gflags, python-cjson, INITools, filechunkio, which have python3 compatible alternatives, often in the standard library.

That brings the total up to 331

That leaves basically 3 categories of things left: mozilla tools, database connectors (many of which probably have python3 bindings though I haven't looked), and single sign on tools. Those account for 12 of the remaining 29 libraries.

That's pretty ready.

Re: Discover Flask

#77
I've played with a bunch of Python web frameworks and amongst the micro-frameworks, Flask is the one I've settled on. Larger community, more integration with other packages.

I've also recently been using Django, and I'd say the biggest advantage of Flask is simplicity.

When you get to something the scale of Django, there's a whole load of decisions and culture baked into the approach, and you have to learn that in order to use it.

For small projects, I'd recommend Flask.

Re: Discover Flask

#78
post #73

Earlier quoted context omitted.

I don't think many python devs are espousing Python for the client side. I use react/underscore/Jasmine/sinon with ES6 run through Babelify for the client side. Sharing logic between client and server side means that your client and server side don't have clearly-defined responsibilities. The one exception to this might be input syntax validation, but generally that's a place where you don't want to roll your own any…

idk, could imagine wanting computation to run on the client when it's a desktop (to save server cycles) or the server when it's mobile (to save battery)... not a level of optimization i practically run into, but not an unreasonable example. i guess a better thing to say is " exactly ": specs often change and responsibility gets shifted around. so "runs everywhere" can be useful, whether it be js or otherwise.

I disagree, that's a totally unreasonable example. Not only is that a bizarre combination of requirements, but that's not a good way to approach meeting those requirements. I'd write the code to run on the server and then profile and optimize on the server. JavaScript if never going to outperform hot spots rewritten in C.

You're forgetting the first rule of optimization: profile.

Post reply on HN