Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>And all that django-specific logic that needs to be in there makes it harder to read unless you're familiar with the django ecosystem.

What "django-specific" logic? Those are standard imports and a few helper objects, the kind of which you'll find in any web framework.

[edit: importants => imports]



I've been using flask lately and I could compress four of those imports into one import in flask. And the settings aren't even necessary.

All these things, when compared to a true microframework, contribute in legibility of the code.


You're right. Settings are not even necessary in my example, as we should be fine with defaults in most cases. The only lines you really need are these four:

  from django.conf import settings
  settings.configure(ROOT_URLCONF='polls')
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
You lose some of the Django niceties (like being able to provide your own custom settings on the command-line) but flask doesn't have them anyway.


>And the settings aren't even necessary.

Until they are. Then you go ahead and implement an ad-hoc settings scheme.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: