Skip to main content

a django based miniframework, inspired by sinatra

Project description

(‘What is it?n===========nnDjango is awesome, but starting a new project in it is a pain. importd isninspired from ruby's sinatra. Hello world django project:nn.. code-block:: pythonnn from importd import dn d(DEBUG=True)nn @d(“/”)n def idx(request):n return “index.html” nn @d(“/post/<int:post_id”>/”)n def post(request, post_id):n return “post.html”, {“post_id”: post_id}nnTo run it:nn.. code::nn $ python foo.pynnThis will start the debug server. nnTo run it in production:nn.. code::nn $ gunicorn foo:dnnAn example app: https://github.com/amitu/importd/blob/master/foo.pynnFeaturesn========nn * fully compatible with djangon * supports smarturlsn * most of regularly used django functions and classes available in d.n namespace, eg d.HttpResponse, d.render_to_response, d.get_object_or_404 etcn * automatically maps “templates” folder in foo.py directory to serve templatesn * automatically maps “static” folder in foo.py to serve static contentn * management commands still available: $ python foo.py shelln * wsgi compliantn * gunicorn supportn * works seamlessly with fhurl (http://packages.python.org/fhurl/)nnInstallationn============nn.. code::nn $ easy_install importdnnDocumentationn=============nndocs: http://amitu.com/importd/nnToDo/Known Issuesn=================nn * figure our whats going on with double importsn * figure out whats going on when gunicorn exitsn’,)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

importd-0.1.3.zip (5.4 kB view hashes)

Uploaded Source

importd-0.1.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page