Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daronenko/askme-service
community-supported service that allows users to ask questions and get answers to them
https://github.com/daronenko/askme-service
ask askme compose django docker postgres python vk vk-education
Last synced: 5 days ago
JSON representation
community-supported service that allows users to ask questions and get answers to them
- Host: GitHub
- URL: https://github.com/daronenko/askme-service
- Owner: daronenko
- License: apache-2.0
- Created: 2024-03-17T17:56:06.000Z (9 months ago)
- Default Branch: develop
- Last Pushed: 2024-05-29T21:33:36.000Z (7 months ago)
- Last Synced: 2024-10-31T06:25:20.807Z (about 2 months ago)
- Topics: ask, askme, compose, django, docker, postgres, python, vk, vk-education
- Language: Python
- Homepage:
- Size: 373 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ask Service
community-supported service that allows users to ask questions and get answers to them
## Contents
* [Requirements](#requirements)
* [Getting Started](#getting-started)
* [MacOS & Linux](#macos-linux)
* [Local](#local-steps)
* [Docker](#docker-steps)
* [Commands](#commands)
* [Local](#local-commands)
* [Docker](#docker-commands)
* [Benchmarks](#benchmarks)* [docker](https://docs.docker.com/)
* [docker compose](https://docs.docker.com/compose/)
* [make](https://www.gnu.org/software/make/manual/make.html)
* [centrifugo](https://centrifugal.dev/)> [!IMPORTANT]
> The project supports docker compose v2 by default, but if you want to use v1, then you need to add the `DOCKER_COMPOSE = docker-compose` line in the `Makefile.local`.1. Setup virtual environment:
```shell
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```2. Start postgres database
3. Apply migrations:
```shell
make migrate
```4. Fill db with generated data:
```shell
make fill-db ratio=100
```5. Warm up cache:
```shell
make warmup-cache
```6. Run centrifugo server (available on `127.0.0.1:8001`):
```shell
make cent
```7. Run project:
```shell
make run
```8. Open the `127.0.0.1:8000` path in the browser
1. Set the `IN_DOCKER` variable in `app/core/local_settings.py` to `True`
```python
IN_DOCKER = True
```2. Build the container:
```shell
make docker-build
```3. Apply migrations:
```shell
make docker-migrate
```> [!IMPORTANT]
> If you see in the logs that the database does not accept requests, it means that the database container started later than the application container. In this case, you need to run the command again or manually launch the database container first (`docker start postgres-service-container`).4. Fill db with generated data:
```shell
make docker-fill-db ratio=100
```5. Run project:
```shell
make docker-run
```5. Open the `0.0.0.0:8000` path in the browser (centrifugo server available on `0.0.0.0:8001`)
6. Stop and remove docker containers:
```shell
make clear-docker
```* `make migrations` - create migrations
* `make migrate` - apply migrations
* `make fill-db ratio=` - fill database with generated data
* `make warmup-cache` - warm up the cache
* `make cent` - start centrifugo server
* `make run` - start gunicorn server
* `make superuser` - create superuser
* `make clear-db` - remove data from database
* `make clear-db-schema` - remove database schema and data in it* `make docker-migrations` - create migrations
* `make docker-migrate` - apply migrations
* `make docker-fill-db ratio=` - fill database with generated data
* `make docker-run` - start gunicorn server
* `make docker-superuser` - create superuser
* `make docker-clear-db` - remove data from database
* `make docker-clear-db-schema` - remove database schema and data in it
* `make clear-docker` - stop and remove containersThe results of the service's benchmarks are [here](docs/benchmarks.md).