Re:Django's goals are probably not our goals for our web app...
by Nextgrid on Sunday July 07, 2019 @07:05PM
(#20378586)
Would a microframework (no idea what's the equivalent of Flask or Sinatra is on PHP) help? I still have nightmares from my beginner days of doing everything in plain PHP.
Re:Django's goals are probably not our goals for our web app...
by reaperducer on Sunday July 07, 2019 @07:18PM
(#20378647)
Would a microframework (no idea what's the equivalent of Flask or Sinatra is on PHP) help?
I have no idea. Maybe. I've just been coding straight PHP. With the way IDEs are these days, once your environment is set up the way you like and you have your favorite macros bound, it's not a problem.
I'll look into Flask and Sinatra before I start the next site. Any other ones you recommend?
Re:Django's goals are probably not our goals for our web app...
by hiccuphippo on Sunday July 07, 2019 @08:09PM
(#20378891)
For PHP I'd recommend to take a look at libraries that adhere to the PSR (Php Standard Recommendations). It is very easy to build your own microframework with them and add only what you need and nothing else. For the libraries themselves look at the League of Extraordinary Packages: https://thephpleague.com/. Zend and Symfony also have PSR compatible libraries you can use. They are no longer the big monoliths of yesteryear.
Re:Django's goals are probably not our goals for our web app...
by giancarlostoro on Sunday July 07, 2019 @08:00PM
(#20378851)
Highly recommend you give CherryPy a look. Its older than most Python web frameworks mentioned (Flask and Django included) and was the most beautifully backwards compatible framework. In spirit of migrating to Python 3 they are obviously dropping old versions in a reasonable time frame though. I wouldnt recommend Python 2 for any new projects regardless.
I used it for 3 years nonstop. It is minimal so you include your own ORM of choice and template library.
Re:Django's goals are probably not our goals for our web app...
by Nextgrid on Sunday July 07, 2019 @07:25PM
(#20378688)
Flask would be my personal preference but I have a Python background (you mentioned PHP so I assumed that was your main language).
Sinatra is in Ruby. The "hello world" looked very similar to Flask but I haven't explored it deeper so no idea.
For PHP maybe also check out Phalcon ? It's not as "light" as the aforementioned ones but maybe they're more conservative in terms of breaking changes?
Re:Django's goals are probably not our goals for our web app...
by baddox on Sunday July 07, 2019 @07:33PM
(#20378721)
And probably the nearest equivalent in server-side JavaScript is Express.
One of the big sites that I maintain was built upon a framework that was fine for its purposes five years ago. But the developers of that framework have decided to take it in a direction that is incompatible with the site's goals.
Once I'm done with my current project, my next task is to rebuild that site without its current framework, and there's a 95% chance I'll go without any framework at all. Just plain HTML5 + PHP + MySQL + CSS3 + a very small amount of javascript.
I know it sounds primitive for a 700+ page site with interactive elements supporting English, Spanish, and Chinese; but earlier this year my boss gave me permission to de-framework a similarly-sized site, and it worked out really well.
Frameworks are great for many projects, but not all. It's important to weigh the risks of being at the mercy of someone else, and that organization may eventually adopt a different vision of the future. Their pivot will not make your life easier.