Skip to content

Commit 87baf41

Browse files
committed
Documentation changes
* Make `poetry` not part of the setup as it needs to be a separate pre-installed package.
1 parent 7092d56 commit 87baf41

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
SECRET_KEY = "SecretSecretSecret!"
2+
UVICORN_PORT = 8000

README.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,43 @@ Note that this is a template project. You will need to make changes to this appl
1313
pyenv install
1414
```
1515

16-
2. Create a virtual environment:
16+
2. [Install poetry](https://python-poetry.org/) to your system by following the [setup instructions](https://python-poetry.org/docs/#installation) convenient for you.
17+
18+
> [!IMPORTANT]
19+
> You should **NOT** install poetry into your virtual environment as stated in their docs, as this may mess with your dependencies.
20+
21+
3. Create a virtual environment:
1722
```shell
1823
# Note: For POSIX, pyenv can create a named virtual environment which you can use instead.
1924
# For Windows, pyenv-win exists, but doesn't have this feature afaik.
2025

21-
python3 -m venv venv
26+
python3 -m venv .venv
2227

2328
# Windows
24-
./venv/Scripts/activate
29+
./.venv/Scripts/activate
2530

2631
# POSIX
27-
source ./venv/bin/activate
32+
source ./.venv/bin/activate
2833
```
2934

30-
3. [Windows] Run the `scripts/dev-setup.bat` script:
35+
4. [Windows] Run the `scripts/dev-setup.bat` script:
3136
```shell
3237
./scripts/dev-setup.bat
3338
```
3439

35-
3. [POSIX] Run the `scripts/dev-setup.sh` shell script using any bash-compatible shell:
40+
4. [POSIX] Run the `scripts/dev-setup.sh` shell script using any bash-compatible shell:
3641
```shell
3742
bash ./scripts/dev-setup.sh
3843
```
3944

40-
4. Create a `.env` file from the given example and edit it:
45+
5. Create a `.env` file from the given example and edit it:
4146
```shell
4247
cp .env.example .env
4348

44-
# Open the new .env file in your favourite editor and make the changes
49+
# Open the new .env file in your favourite editor and make the required changes
4550
```
4651

47-
5. Run the dev server using `F5` key in VSCode. You can also use the `dev-launch` shell script:
52+
6. Run the dev server using `F5` key in VSCode. You can also use the `dev-launch` shell script:
4853
```shell
4954
# Windows
5055
./scripts/dev-launch.bat
@@ -53,7 +58,7 @@ cp .env.example .env
5358
bash ./scripts/dev-launch.sh
5459
```
5560

56-
6. You can also run the cli script:
61+
7. You can also run the cli script:
5762
```shell
5863
sample-fastapi --help
5964
```

sample_fastapi/app/config/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class BaseAppSettings(BaseSettings):
2020

2121
class AppSettings(BaseAppSettings):
2222
"""Main application-specific settings"""
23-
app_base_url: AnyUrl = "http://localhost:8000"
23+
app_base_url: AnyUrl = Field(default=AnyUrl("http://localhost:8000"))
2424

2525

2626
class AppDirectories(BaseAppSettings):

scripts/dev-setup.bat

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
echo Creating "dev" folder...
66
mkdir "dev/"
77

8-
echo Installing poetry...
9-
python3 -m pip install -q poetry
10-
118
echo Installing requirements (all with dev)...
129
poetry -q install --with dev,test
1310

scripts/dev-setup.sh

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
echo 'Creating "dev" folder...'
66
mkdir "dev/"
77

8-
echo 'Installing poetry...'
9-
python3 -m pip install poetry
10-
118
echo 'Installing requirements (all with dev)...'
129
poetry install --with dev,test
1310

0 commit comments

Comments
 (0)