Azure-Samples / Azure-Samples/msdocs-fastapi-postgresql-sample-app
Fail to run `python3 src/fastapi_app/seed_data.py` command
- Dominant language
- Bicep
- Stars
- 11
- Forks
- 60
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 2
Description
**Describe the issue:**
Running `python3 src/fastapi_app/seed_data.py` reports an error: cold not translate host name "", the. env file has not been configured correctly.


**Repro Steps:**
1. Fork this repository.
2. Open this repository from Codespace.
3. Run `cp .env.sample .env`.
4. Run `python3 -m pip install -r src/requirements.txt`.
5. Run `python3 -m pip install -e src`.
6. Run `python3 src/fastapi_app/seed_data.py`.
**Environment:**
- Azd version:`azd version 1.9.5 (commit cd2b7af9995d358aab33c782614f801ac1997dde)`
- OS: Windows 11
**Expected Behavior:**
Run `python3 src/fastapi_app/seed_data.py` successfully.
@bobtabor-msft and @hemarina for notification.
Contributor guide
Research direction
Start with src/fastapi_app/seed_data.py and compare the required database settings with .env.sample and the copied .env file. Verify the environment configuration used by the seed command, then rerun the listed installation steps and confirm that python3 src/fastapi_app/seed_data.py completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, fastapi, postgresql, python
- Domain
- backend, cloud, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100