Live data from Hacker News

A Beginner’s Introduction to Python Web Frameworks (2018)

stxnext.com

21–30 of 168 posts

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#22

The post doesn't mention Django's migration system, which is a killer feature. Of course, one should change their database infrequently and deliberately, but it is nonetheless a delight to use, and a feature that is not matched by many other web frameworks, Python-based or otherwise.

Flask-migrate for SQLAlchemy (using Alembic) I find every bit as good as the Django migration scheme.

I'm not familiar with frameworks other than these two, but I bet Alembic works well in most cases if they don't have something already.

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#23
Will chime in and mention aiohttp[1]. It's lightweight, fun, and the API is very user-friendly for those willing to work on a slightly lower level. I use it to build speedy APIs, and coupled with a good ORM (peewee? [2]) it's pretty dope.

1. https://aiohttp.readthedocs.io/en/stable/

2. http://docs.peewee-orm.com/en/latest/

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#24

Are any of these extremely good compared to a framework not written in Python? For example compared to Rails or Phoenix?

We’re mainly a C# shop with some JavaScript, but I’ve done my time with php, ror and java, and, Django is still my favourite web-framework. Don’t get me wrong I actually like .Net Core, but DB migrations, authentication, testing and productivity is just better in Django (I do have an unnatural hatred for entity framework). Django even had the best learning resource I’ve ever seen with the testing goat book.

That being said, the job market for Django is non-existent in my area, and most of my country, and that’s a rather vital issue.

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#25
post #11

This is a great resource, and there are some neat inclusions like Falcon, but I find the main trouble when building python web apps is deployment. I always feel like I've duct-taped my carefully written app to the web-server.

Why, a Docker container. Yes, even on Windows. Pack up everything into a single image, downloadable from nearly anywhere. Your web server (which likely also terminates TLS) has to have fastcgi support, you configure the fastcgi and database ports, maybe mount a directory with config files into the container, and that's it.

>Yes, even on Windows.

This would require you to run your containers on Windows servers right? Not much reason to do that anymore.

Instead should just containerize as part of deployment pipeline

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#26
post #25
post #11

Earlier quoted context omitted.

Why, a Docker container. Yes, even on Windows. Pack up everything into a single image, downloadable from nearly anywhere. Your web server (which likely also terminates TLS) has to have fastcgi support, you configure the fastcgi and database ports, maybe mount a directory with config files into the container, and that's it.

>Yes, even on Windows. This would require you to run your containers on Windows servers right? Not much reason to do that anymore. Instead should just containerize as part of deployment pipeline

Docker on Windows can run linux containers just the same as docker on linux.. it uses a virtualbox vm with linux and runs containers inside that

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#27

This is a great resource, and there are some neat inclusions like Falcon, but I find the main trouble when building python web apps is deployment. I always feel like I've duct-taped my carefully written app to the web-server.

Where have you deployed? I'm looking to switch for my Django website. I'd like something full-serve like Heroku, but Heroku doesn't work well with sqlite.

I take that to mean you are hosting your db locally with the app server?

Hardly seems like Heroku is in the wrong there

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#28
post #18
post #12

I started working with Python around 2013 and I still consider Django the best framework to use. Yes Flask you can pick what you want to use but I have found the supporting libraries to be a bit outdated. Everytime I have used it I feel like I am just gluing together a lot of different pieces and it becomes messy. Django is constantly updated and I have little to no worries about security issues. Edit: And I have bee…

Thanks for pointing to Starlette, I didn't know it and it looks interesting. I completely agree with you on Django. I've had the chance to implement an e-commerce solution in Flask and another one in Django and the process has been a lot easier and faster with Django. You just can't beat having all the basic tools bundled and configured, along with one central documentation.

Just curious, what are you using as a payments solution for an e-commerce site in Django? I've yet to find a solid implementation for that, though I guess diving into Saleor and picking out parts of that implementation is the best choice?

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#29

We need to write a lot of small APIs in Python for SPAs. We ended up going with FastAPI which utilizes Starlette under the hood. I'm surprised neither of them are mentioned here. Starlette was developed by the same dev who wrote the Django RESTful package. If you mostly just need REST APIs or even GraphQL, it feels far more light and modern than anything in Django and forms some better opinions around things than the…

Do frameworks need to be asynchronous or is it good enough to just spawn threads for background tasks?

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#30
post #21

For such a comprehensive list, no mention of tornado?

Is Tornado still relevant if you can use async for multiplexed IO?

I've been using Tornado for coming on 6 years. It's a great example of a solid, well maintained project. Why it's not more popular I'll never know.

Yes it's still relevant because your framework needs to be able to run on the asyncio event loop (a feature which Tornado added early on).

Post reply on HN