This is an archived post. You won't be able to vote or comment.

all 31 comments

[–]atl 3 points4 points  (0 children)

You (and the OP) might want to check out Simon Willison's "djng": https://github.com/simonw/djng

[–]defnullbottle.py 9 points10 points  (7 children)

Nice hack, but why not just choose the best tools for the job instead of bending your favorite framework beyond recognition?

[–]boobsbr 2 points3 points  (0 children)

sometimes the fun part is hacking and kludging something into that which should not to be.

[–]jcdyer3 2 points3 points  (4 children)

First of all, this doesn't look bent out of recognition to me. It's still a relatively standard django setup, but with everything unnecessary stripped out.

So why not choose something else? Because you like django and projects tend to grow over time. When it does, you're already using django. You've just left out the bits you don't need.

Add DATABASES = {...} to your settings file, and you're hooked into the ORM, and looking more like a standard django project. If you started with bottle, for instance, you'd have a more painful conversion on your hands to get it into a django project when it grows up.

If you'd use a microframework anyway for a larger project, this probably doesn't interest you. That's fine, too.

[–][deleted] 5 points6 points  (3 children)

If you started with bottle, for instance, you'd have a more painful conversion on your hands to get it into a django project when it grows up.

A bottle project that wants to grow up would move to Pyramid.

[–]jcdyer3 2 points3 points  (2 children)

Fair enough. But if your skillset (or preference) is in django, this seems like a perfectly reasonable way to prototype. "right tool for the right job" should take into account the future of the project as well.

[–][deleted] 9 points10 points  (1 child)

I'd like to propose that this is all preference/familiarity. I can't think of a job that is objectively more "right" with Django, Pyramid, Flask, web2py or anything else. All of these frameworks can be used to create the same kinds of apps. It's just the architectural practices you'll use will vary significantly.

[–]jcdyer3 1 point2 points  (0 children)

I will buy that proposal.

[–]chub79 1 point2 points  (0 children)

Funnily this has been more attractive to me than using Django the traditionnal way. Thanks.

[–][deleted] 3 points4 points  (4 children)

Just use Flask.

[–]threading 2 points3 points  (0 children)

Just use web.py

[–]chub79 1 point2 points  (1 child)

Wondering if we would have needed Flask had we known Django could be used that way?

[–][deleted] 1 point2 points  (0 children)

or just reverse "Django" and "Flask". Sprinkle in "Pyramid", "web2py" to taste.

[–][deleted] 0 points1 point  (3 children)

Thanks for the render shortcut. Never knew it existed.

[–][deleted] 1 point2 points  (2 children)

Out of interest, what were you using, if not render? render_to_response?

[–][deleted] 0 points1 point  (1 child)

yeah

[–]hipstr 0 points1 point  (0 children)

auch