Skip to main content

a django based miniframework, inspired by sinatra

Project description

What is it?

Django is awesome, but starting a new project in it is a pain. importd is inspired from ruby’s sinatra. Hello world django project:

from importd import d
d(DEBUG=True)

@d("/")
def idx(request):
    return "index.html"

@d("/post/<int:post_id>/")
def post(request, post_id):
    return "post.html", {"post_id": post_id}

if __name__ == "__main__":
    d.main()

To run it:

$ python foo.py

This will start the debug server.

To run it in production:

$ gunicorn foo:d

Some examples: https://github.com/amitu/importd/tree/master/examples

Backward Incompatibility Change

d.main() used to be not required, now it is.

Features

  • fully compatible with django

  • supports smarturls

  • most of regularly used django functions and classes available in d. namespace, eg d.HttpResponse, d.render_to_response, d.get_object_or_404 etc

  • automatically maps “templates” folder in foo.py directory to serve templates

  • automatically maps “static” folder in foo.py to serve static content

  • management commands still available: $ python foo.py shell

  • wsgi compliant

  • gunicorn support

  • works seamlessly with fhurl (http://packages.python.org/fhurl/)

Installation

$ pip install importd

Documentation

docs: http://packages.python.org/importd

ChangeLog

https://github.com/amitu/importd/blob/master/ChangeLog.rst

Contributors

LICENSE

  • BSD

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.2.5.zip (30.0 kB view hashes)

Uploaded Source

importd-0.2.5.tar.gz (19.2 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