Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Documentation
on:
push:
branches:
- master
- main
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/configure-pages@v6
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.x
- run: pip install zensical
- run: zensical build --clean
- uses: actions/upload-pages-artifact@v5
with:
path: site
- uses: actions/deploy-pages@v5
id: deployment
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# render-workflow-django-example
A Django template to demonstrate the use of @render workflows inside of Django
# Django sample for Render
> A Django template for Render

[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)

This is a sample Django project that demonstrates the use of Render technologies inside of the Django context. In particular it seeks to demonstrate:

- Settings for development and deployment into Render
- Workflow Tasks accessing the Django ORM
- A Django management command that can trigger the worker
- A way of sharing the workflow context across packages (so you can define tasks in separate apps or files)

We also include:

- A minimal `blueprint` to deploy this project to Render
- Instructions for running the project locally
91 changes: 91 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
version: "3"

dotenv: [".env"]

tasks:
publish:tag:
prompt: "Before we push, is the version number up to date?"
desc: tag a release and push to origin
summary: |
This will tag a release and push it to origin, it will also push
the tag to the remote origin.
cmds:
- |
git tag -s -a v{{.PROJ_VER}} -m "chore: release v{{.PROJ_VER}}"
- git push origin v{{.PROJ_VER}}
vars:
PROJ_VER:
sh: "task version"
db:rev:
desc: run a django make migration command
cmds:
- cd src && uv run python manage.py makemigrations
db:migrate:
desc: run a django run migration command
cmds:
- cd src && uv run python manage.py migrate
dev:test:
desc: runs tests inside the server container
summary: |
Uses pytest to run a set of extensive test suites for the project
cmds:
- cd src && uv run python manage.py test
dev:playwright:
desc: runs playwright tests inside the server container
summary: |
Uses playwright to run a set of extensive test suites for the project
cmds:
- docker compose exec {{.PROJ_NAME}} sh -c "poetry run pytest tests/playwright"
dev:pyshell:
desc: get a python session with django paths on the api container
cmds:
- cd src && uv run python manage.py shell
dev:manage:
desc: run a django management command
cmds:
- cd src && uv run python manage.py {{.CLI_ARGS}}
dev:run:
desc: run the django development server
cmds:
- cd src && uv run python manage.py tailwind dev
deps:
- db:migrate
dev:tailwind:
desc: run and watch tailwind css build
cmds:
- cd src && uv run python manage.py tailwind start
dev:sfdesigner:
desc: run the storefront designer vite dev server
cmds:
- cd src/storefront-designer && npm run dev
dev:docs:
desc: run the mkdocs server with appropriate flags
cmds:
- cd docs && poetry run mkdocs serve --open -a localhost:8002
dev:sproxy:
desc: runs stripe proxy using stripe-cli
cmds:
- stripe listen --forward-to localhost:8000/webhooks/stripe/
dev:ngrok:
desc: run ngrok to proxy stripe requests
cmds:
- ngrok http --url anomaly.ngrok.app 8000
dev:psql:
desc: postgres shell on the db container
cmds:
- |
docker compose exec db sh -c \
"psql -U {{.POSTGRES_USER}} -d {{.POSTGRES_DB}}"
dev:sh:
desc: get a bash session on the api container
cmds:
- docker compose exec {{.PROJ_NAME}} sh -c "bash"
dev:render-worker:
desc: run the render worker
cmds:
- cd src; render workflows dev --debug -- uv run python manage.py render_workflow_worker
version:
desc: get the version number from python project
cmds:
- |
python -c "from {{.PROJ_NAME}} import __version__; print(__version__)"
173 changes: 173 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
---
icon: lucide/rocket
---

# Get started

For full documentation visit [zensical.org](https://zensical.org/docs/).

## Commands

* [`zensical new`][new] - Create a new project
* [`zensical serve`][serve] - Start local web server
* [`zensical build`][build] - Build your site

[new]: https://zensical.org/docs/usage/new/
[serve]: https://zensical.org/docs/usage/preview/
[build]: https://zensical.org/docs/usage/build/

## Examples

### Admonitions

> Go to [documentation](https://zensical.org/docs/authoring/admonitions/)

!!! note

This is a **note** admonition. Use it to provide helpful information.

!!! warning

This is a **warning** admonition. Be careful!

### Details

> Go to [documentation](https://zensical.org/docs/authoring/admonitions/#collapsible-blocks)

??? info "Click to expand for more info"

This content is hidden until you click to expand it.
Great for FAQs or long explanations.

## Code Blocks

> Go to [documentation](https://zensical.org/docs/authoring/code-blocks/)

``` python hl_lines="2" title="Code blocks"
def greet(name):
print(f"Hello, {name}!") # (1)!

greet("Python")
```

1. > Go to [documentation](https://zensical.org/docs/authoring/code-blocks/#code-annotations)

Code annotations allow to attach notes to lines of code.

Code can also be highlighted inline: `#!python print("Hello, Python!")`.

## Content tabs

> Go to [documentation](https://zensical.org/docs/authoring/content-tabs/)

=== "Python"

``` python
print("Hello from Python!")
```

=== "Rust"

``` rs
println!("Hello from Rust!");
```

## Diagrams

> Go to [documentation](https://zensical.org/docs/authoring/diagrams/)

``` mermaid
graph LR
A[Start] --> B{Error?};
B -->|Yes| C[Hmm...];
C --> D[Debug];
D --> B;
B ---->|No| E[Yay!];
```

## Footnotes

> Go to [documentation](https://zensical.org/docs/authoring/footnotes/)

Here's a sentence with a footnote.[^1]

Hover it, to see a tooltip.

[^1]: This is the footnote.


## Formatting

> Go to [documentation](https://zensical.org/docs/authoring/formatting/)

- ==This was marked (highlight)==
- ^^This was inserted (underline)^^
- ~~This was deleted (strikethrough)~~
- H~2~O
- A^T^A
- ++ctrl+alt+del++

## Icons, Emojis

> Go to [documentation](https://zensical.org/docs/authoring/icons-emojis/)

* :sparkles: `:sparkles:`
* :rocket: `:rocket:`
* :tada: `:tada:`
* :memo: `:memo:`
* :eyes: `:eyes:`

## Maths

> Go to [documentation](https://zensical.org/docs/authoring/math/)

$$
\cos x=\sum_{k=0}^{\infty}\frac{(-1)^k}{(2k)!}x^{2k}
$$

!!! warning "Needs configuration"
Note that MathJax is included via a `script` tag on this page and is not
configured in the generated default configuration to avoid including it
in a pages that do not need it. See the documentation for details on how
to configure it on all your pages if they are more Maths-heavy than these
simple starter pages.

<script id="MathJax-script" src="https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => {
MathJax.startup.output.clearCache()
MathJax.typesetClear()
MathJax.texReset()
MathJax.typesetPromise()
})
</script>

## Task Lists

> Go to [documentation](https://zensical.org/docs/authoring/lists/#using-task-lists)

* [x] Install Zensical
* [x] Configure `zensical.toml`
* [x] Write amazing documentation
* [ ] Deploy anywhere

## Tooltips

> Go to [documentation](https://zensical.org/docs/authoring/tooltips/)

[Hover me][example]

[example]: https://example.com "I'm a tooltip!"
Loading