by _stem · 12y ago · 0 comments
A single-file web application in Django: https://github.com/mstepniowski/microdjango/blob/master/poll...
Django has definitely come a long way!
That still looks very complicated compared to most microframeworks I've used, including web.py.
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]
All these things, when compared to a true microframework, contribute in legibility of the code.
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.Until they are. Then you go ahead and implement an ad-hoc settings scheme.