https://github.com/supersolik/epam-python-test-task
https://github.com/supersolik/epam-python-test-task
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/supersolik/epam-python-test-task
- Owner: SuperSolik
- Created: 2021-03-11T11:08:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-15T10:23:42.000Z (about 5 years ago)
- Last Synced: 2025-04-23T08:18:41.223Z (about 1 year ago)
- Language: Python
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# epam-python-test-task
## Requirements
Python3.9, PostgreSQL, Redis
## Setup
**Env variables**
```dotenv
REDIS_URL="redis://your-redis-url"
POSTGRES_HOST="postgres-host"
POSTGRES_USER="postgres-user"
POSTGRES_PASSWORD="postgres-password"
POSTGRES_DB="postgres-db-name"
WEATHER_API_KEY="API key for https://weatherstack.com/"
WEATHER_JWT_SECRET="your-jwt-secret"
```
plus for Docker configuration
```dotenv
PORT=
```
env file also supported:
- `.env` for manual start
- `docker.env` for Docker start
**Databases**
- `test` - for tests
- `$POSTGRES_DB` - for main app
## Run tests
```python3
pip install -r requirements.txt
python -m pytest
```
## Run app
### Manual
```python3
pip install -r requirements.txt
uvicorn app:app
```
App would be available at http://127.0.0.1:8000 by default, to specify host and port:
```python
uvicorn app:app --host --port
```
### Docker
```python3
docker-compose up -d
```
App would be available at http://127.0.0.1:3030 by default, but it can be changed using docker-compose.yml
### API
Full API documentation is available at `GET /docs`