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
Built Distribution
Close
Hashes for django_singlefile-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 645f759bbbc766a157cf80a0a175a4c9fb6799d60ef63d2be3dc864a8705b1f8 |
|
MD5 | 6e3ae97f8fd37e23ce725125454346b7 |
|
BLAKE2b-256 | 4c0458ae0014ca81bc4053b798f857a46c2f2eb88473738e1af3f179fa410dc5 |