This is good although I think it has a little to much magic for me. Everything seems to happen just by using different arguments to the 'd' function, even the settings. I think its a good idea though! It would be awesome if Django had a built in way of doing single file apps.<p>Simon Willison (one of the Django core devs) made a Django micro framework a few years ago, I don't think its been developed much recently though.<p><a href="http://simonwillison.net/2009/May/19/djng/" rel="nofollow">http://simonwillison.net/2009/May/19/djng/</a><p><a href="http://news.ycombinator.com/item?id=615891" rel="nofollow">http://news.ycombinator.com/item?id=615891</a><p>-<p>EDIT:<p>Simons website seems to be down, an overview of Djing is here: <a href="https://github.com/simonw/djng" rel="nofollow">https://github.com/simonw/djng</a>
Hey, I am the author of the module, as well as that of smarturls and fhurl mentioned there.<p>I understand the concern about magic, and moving parts. I guess the right answer to that concern would be unittests, that I am in the process or writing.<p>I hope you enjoy the module as much as I do :-)
This is a great tool for API prototyping and testing.<p>However, I wouldn't use it for a full-blown app. It's like using Flask. You could do it in a single file, but it rarely makes sense to do so. By the time you organize your code, you end up with a basic MVC app structure anyway.<p>Relocateable by default is nice. But it's pretty simple in Django to design your settings file to be path-relative.
Related: django-mini, a command-line tool for running Django management commands without a full settings.py.<p><a href="https://github.com/davidwtbuxton/django-mini" rel="nofollow">https://github.com/davidwtbuxton/django-mini</a><p>I wrote it to make it easier to run tests for plug-able Django apps.
the resulting view ends up looking at lot like it would in flask [1]. I would be worried about the number of moving parts that are in play.<p>[1] <a href="http://flask.pocoo.org/" rel="nofollow">http://flask.pocoo.org/</a>
So this is really cool to get started with, but I would worry that when you need to start taking advantage of various abstractions that Django provides, you'd end up having to do a huge refactor. Not that Django's abstractions are perfect, but if your app starts out living in a single file, you are more likely than not going to need to do some modularization at some point.
As others have said, this looks really useful for proof of concept/prototyping work. The first use case that came to mind was hackathons, actually.<p>It'd be really nice if there was a fast, automated way to "unwrap" the microframework version of your webapp into the full-blown django project so that you can start hardening things for production in a single command.
fyi:
This requires django 1.4. I ran w/1.3.1 and got this error when running the helloworld example:<p>ImportError: No module named wsgi<p>I updated to 1.4.5 and it worked fine.