![]() * python sdk: change merge_fragments to take a string rather than list * Change merge_fragments for fasthtml to accept a string rather than list |
||
---|---|---|
.. | ||
datastar | ||
ds | ||
README.md | ||
db.sqlite3 | ||
manage.py | ||
pyproject.toml |
README.md
Datastar Django
ASGI and WSGI examples of Datastar and Django in action.
To take full advantage of Datastar, we recommend (but do not require) that you use ASGI, especially on green field projects to take advantage of the full range of Datastar's capabilities. That said, Datastar and Django will work perfectly well over WSGI.
ASGI (default)
Install the dependencies, start runserver as usual, and go to http://127.0.0.1/ to see the demo.
💡️ Note: Because Django's runserver
is WSGI only, we use Daphne's built-in ASGI runserver
.
WSGI
While, Datastar works great in a WSGI context, we recommend you give ASGI a try if possible (see top of this page for more details).
To use WSGI make sure runserver is stopped and make the following changes to the settings file in the datastar
project directory:
-
Uncomment the
WSGI_APP
setting, and comment out theASGI_APP
setting. -
In
INSTALLED_APPS
comment out"daphne"
, -
Start runserver and go to http://127.0.0.1/wsgi/ and watch the demo.