4 ms·
I much prefer frameworks/modules for which code is executed only once you invoke their "setup" function Django _does_ have a "setup" function. You can't import
by nerdponx 7y ago
I much prefer frameworks/modules for which code is executed only once you invoke their "setup" function
Django _does_ have a "setup" function. You can't import and use Django database connections outside of a running application without it.
Flask also has a "run" method and does no i/o without it.
- heavenlyblue 7y agoEvery time I hear a comment alike parent's, it makes me think how many times a day I actually read a comment in the same fashion, but about something I actually know nothing about.
- nerdponx 7y agoWith credit to the original poster, they might be complaining about the fact that Django is a monolithic framework and you can't really use Django code without spinning up the i/o portion. Which is legitimate criticism, but frankly if that's what you need then you shouldn't be using Django.
- heavenlyblue 7y agoIf by I/O you mean web i/o then Django provides a perfectly functional management utility interface accessible through cli. If, however by i/o you mean the database portion of it then Django works without database configuration, too.
- diminoten 7y agoWhat's worse is how many people blindly upvote negativity. It's still somehow cool to shit on things...
- deleted 7y ago[deleted]
- yen223 7y agoWithout calling setup, you cannot import anything that touches Django models, like constants defined in a file that transitively imports a Django model. In practice, this means that any script that depends indirectly on Django code will incur a lengthy startup cost (from having to call setup()), and will fail to run if there's no database connection, even if the script itself doesn't need the db.
- deleted 7y ago[deleted]
- heavenlyblue 7y agoYou can import Django models before calling setup, you will simply not be able to use the database before calling setup.