duck.backend.django.bridge¶
This module acts as a bridge between a Django server and a Duck server. It allows Django to handle requests that are originally meant for the Duck server.
Here’s how it works:
Client sends a request: The client initiates a request to the Duck server.
Duck server receives request: The Duck server receives the request first.
Request forwarded to Django: The Duck server forwards the request to the Django server on the same network.
Django processes request: Django handles the request as if the route was defined within Duck urls.py or in Django itself.
Response sent to client: The response generated by Django is sent back to the client.
Module Contents¶
Functions¶
Executes essential Django management commands, usually makemigrations, migrate, and collectstatic. |
|
Starts the Django application server. |
API¶
- duck.backend.django.bridge.run_django_app_commands()¶
Executes essential Django management commands, usually makemigrations, migrate, and collectstatic.
This function ensures that the Django application is properly set up with the latest database schema and static files.
- duck.backend.django.bridge.start_django_server(host_addr: str, port: int, uses_ipv6: bool = False)¶
Starts the Django application server.
- Parameters:
host_addr – The host address to bind the server to.
port – The port to bind the server to.
uses_ipv6 – Whether host on ipv6 address