News for hackers. Stuff that matters.
Re:Rewriting Reddit (2005) by _stem on Monday October 27, 2014 @02:45PM (#8517309)
For all people still thinking that Django is not "lean" or flexible enough for their next project, let me just leave this here: https://speakerdeck.com/mstepniowski/django-best-python-micr...

A single-file web application in Django: https://github.com/mstepniowski/microdjango/blob/master/poll...

Re:Rewriting Reddit (2005) by keysersosa on Monday October 27, 2014 @03:18PM (#8517530)
Yeah it should be noted that all of the referenced decisions we made around web frameworks in this thread predate django's 1.0 release. I think I was comparing pylons to django 0.96 iirc, and in 2005 when aaron wrote web.py, I don't think django was on anybody's radar (or at least it wasn't on ours).

Django has definitely come a long way!

Re:Rewriting Reddit (2005) by INTPenis on Tuesday October 28, 2014 @08:04AM (#8520485)
>A single-file web application in Django: https://github.com/mstepniowski/microdjango/blob/master/poll....

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.

Re:Rewriting Reddit (2005) by coldtea on Tuesday October 28, 2014 @08:44AM (#8520629)
>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]

Re:Rewriting Reddit (2005) by INTPenis on Tuesday October 28, 2014 @09:59AM (#8520940)
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.

Re:Rewriting Reddit (2005) by _stem on Thursday October 30, 2014 @03:40AM (#8531823)
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.
Re:Rewriting Reddit (2005) by coldtea on Tuesday October 28, 2014 @10:12AM (#8521003)
>And the settings aren't even necessary.

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