Skip to content

Commit 45e6cbd

Browse files
authored
⚙️ [GH-74] Some fixes (#75)
* fix: update Dockerfile and add psql port to dsn build [#74] * fix: int instead of string [#74] * chore: version bump [#74] * docs: update README and quickstart [#74]
1 parent bcde4cf commit 45e6cbd

6 files changed

Lines changed: 18 additions & 11 deletions

File tree

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,32 @@
2020
Supported PaaS's:
2121
- Render
2222
- Platform.sh (Coming soon)
23-
- Porter (Coming soon)
2423
- Fly.io (Coming soon)
2524
- DigitalOcean (Coming soon)
2625

2726
## Quickstart
2827
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
2928
```sh
30-
pip install cookiecutter
29+
# pipx is strongly recommended.
30+
$ pipx install cookiecutter
31+
32+
# If pipx is not an option,
33+
# you can install cookiecutter in your Python user directory.
34+
$ python -m pip install --user cookiecutter
3135
```
3236

3337
Generate project from GitHub template:
3438

3539
```sh
36-
$ cookiecutter gh:nickatnight/cookiecutter-fastapi-backend.git
40+
$ pipx run cookiecutter gh:nickatnight/cookiecutter-fastapi-backend
3741
```
3842

3943
Or from Python code:
4044

4145
```python
4246
from cookiecutter.main import cookiecutter
4347

44-
cookiecutter("gh:nickatnight/cookiecutter-fastapi-backend.git")
48+
cookiecutter("gh:nickatnight/cookiecutter-fastapi-backend")
4549
```
4650

4751
## Features

docs/source/getting_started/quickstart.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ To get started, install the latest version of `Cookiecutter <https://github.com/
55

66
.. code-block:: bash
77
8-
pip install cookiecutter
8+
pipx install cookiecutter
99
1010
Then, generate a new project
1111

@@ -18,14 +18,14 @@ Using a GitHub templates:
1818

1919
.. code-block:: bash
2020
21-
cookiecutter gh:nickatnight/cookiecutter-fastapi-backend.git
21+
pipx run cookiecutter gh:nickatnight/cookiecutter-fastapi-backend
2222
2323
2424
Using a local template:
2525

2626
.. code-block:: bash
2727
28-
cookiecutter cookiecutter-fastapi-backend
28+
pipx run cookiecutter cookiecutter-fastapi-backend
2929
3030
Using from Python:
3131

@@ -37,7 +37,7 @@ Using from Python:
3737
cookiecutter("cookiecutter-fastapi-backend/")
3838
3939
# Create project from the cookiecutter-fastapi-backend.git repo template
40-
cookiecutter("gh:nickatnight/cookiecutter-fastapi-backend.git")
40+
cookiecutter("gh:nickatnight/cookiecutter-fastapi-backend")
4141
4242
Input Variables
4343
---------------

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cookiecutter-fastapi-backend"
3-
version = "2.2.0"
3+
version = "2.2.1"
44
description = "Cookiecutter template to build and deploy fastapi backends..batteries included"
55
authors = [{ name = "nickatnight", email = "nialexanderke@proton.me" }]
66
requires-python = ">=3.9"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

{{ cookiecutter.project_slug }}/{{ cookiecutter.backend_container_name }}/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ WORKDIR /code
77

88
ENV PATH="/code/.venv/bin:$PATH"
99

10+
ADD pyproject.toml /code/
11+
1012
# Compile bytecode
1113
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
1214
ENV UV_COMPILE_BYTECODE=1
@@ -20,7 +22,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2022
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
2123
uv sync --no-install-project
2224

23-
# Copy the project into the image
25+
# Copy remaining project files into the image
2426
ADD . /code
2527

2628
# Sync the project

{{ cookiecutter.project_slug }}/{{ cookiecutter.backend_container_name }}/src/core/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def build_db_connection(cls, v: Optional[str], values: ValidationInfo) -> Any:
5252
password=values.data.get("POSTGRES_PASSWORD"),
5353
host=values.data.get("POSTGRES_HOST"),
5454
path=f"{values.data.get('POSTGRES_DB') or ''}",
55+
port=int(values.data.get("POSTGRES_PORT", "5432")),
5556
).unicode_string()
5657
{%- if cookiecutter.use_celery == "yes" %}
5758

0 commit comments

Comments
 (0)