Skip to main content

A library to make single-file Django apps easier

Project description

This is a small library that makes it easier to write single-file Django applications in a similar way to how you’d write Flask applications.

It’s still alpha; in particular, I’d like to:

  • Add some more environment variable overrides for settings

  • Add in some basic database support

But hey, it’s a fun start.

Example App

from django.http import HttpResponse
from django.singlefile import SingleFileApp

app = SingleFileApp()


@app.path("")
def index(request):
    name = request.GET.get("name", "World")
    return HttpResponse(f"Hello, {name}!")


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

To run the app, you can just call it from the command line:

python app.py runserver

Or you can pass the app object inside it to a WSGI server as normal!

Project details


Download files

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

Source Distribution

django-singlefile-0.1.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

django_singlefile-0.1.0-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

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