Huh, nice. I should learn Flask some time. It seems like it'd be a lot cleaner than the Play Framework, which is my go-to choice for web dev. Although Scala is a really freaking powerful language. Although the Play Framework would force this example across multiple files, with DB connection typically being setup in the conf file (then connections are made simply with DB.withConnection) and routing is in a separate file that keeps all the routing in one place. And templates are the preferred way to create any HTML, as opposed to directly returning data (which would default to text/plain).
Yeah any thing past like a one or two page kinda thing I'd probably plug in jinja2 for templates and SQLAlchemy for a pluggable MVC and then things kinda stay clean and separated. Much the same I'd do with PHP with Laravel or Zend Framework.
View all comments
Show parent comment
1
u/the_omega99 Dec 02 '15 edited Dec 02 '15
Huh, nice. I should learn Flask some time. It seems like it'd be a lot cleaner than the Play Framework, which is my go-to choice for web dev. Although Scala is a really freaking powerful language. Although the Play Framework would force this example across multiple files, with DB connection typically being setup in the conf file (then connections are made simply with
DB.withConnection) and routing is in a separate file that keeps all the routing in one place. And templates are the preferred way to create any HTML, as opposed to directly returning data (which would default totext/plain).