Simple service to receive a form from a static HTML site.
To deploy on Disco the first time:
disco projects:add \
--name forms \
--domain forms.example.com \
--github-repo https://github.com/letsdiscodev/simplest-forms \
--deploy
To update to the latest version:
disco deploy --project forms
Example
<form
method="POST"
action="https://forms.example.com/launch-list?redirect_url=https://example.com/launch-page/subscribed"
>
<p>
<label for="email">Email</label>
<input type="email" name="email"/>
</p>
<p>
<label for="first_name">First Name</label>
<input type="text" name="first_name"/>
</p>
<p><button type="submit">Submit</button></p>
</form>
This will submit the values for the form launch-list
, with the fields email
and first_name
.
disco run --project forms "csv" > ~/submissions.csv
disco run --project forms "csv"
To filter, or simply to re-order.
disco run --project forms "csv --columns email,first_name"
disco run --project forms "csv --form launch-list"
disco run --project forms "csv --columns email,first_name --form launch-list"
bin/ruff check --fix .
bin/ruff format .
bin/mypy .
docker compose build --no-cache web
docker compose run --rm web rm data/simplestforms.sqlite3
docker compose run --rm web alembic upgrade head
docker compose run --rm web alembic revision --autogenerate -m "0.1.0"
We edit requirements.in
to list the dependencies.
docker compose run --rm --no-deps web \
uv pip compile requirements.in -o requirements.txt