Skip to content
Snippets Groups Projects
Commit df276958 authored by Roman Dvořák's avatar Roman Dvořák
Browse files

Merge branch 'fix_docs_and_rework_them' into 'main'

reformat and fix readme.md and installation.md

See merge request inject/backend!193
parents b0d99e75 349b4b87
No related branches found
No related tags found
No related merge requests found
## Running the project
To run the backend of INJECT, you have two options, each with its own set of requirements. The first method utilizes [poetry](#running-the-application-with-poetry), while the second employs [Docker](#running-the-application-with-docker).
Before running the project, ensure that the necessary local variables are properly configured. Here's a breakdown of these variables:
### Local variables
- `INJECT_DEBUG`: _boolean, default=false_ - Run the backend in debug mode. **Do not set in production.**
- `INJECT_HOST_ADDRESSES`: _string, default=localhost_ - A comma-separated list of allowed hosts.
......@@ -15,30 +11,6 @@ Before running the project, ensure that the necessary local variables are proper
- `INJECT_EMAIL_SENDER_ADDRESS`: _string, default=""_ - The sender address for automatic emails.
- `INJECT_LOGS`: _string, default=backend-logs.log_ - Path to a file where to save logs.
### Running the Application with poetry:
To run the backend application using poetry, ensure you have the following prerequisites:
* [python](https://www.python.org/) with a supported version of 3.8.10
* [poetry](https://python-poetry.org/)
Once you have these installed, follow these steps:
Use Poetry to install the necessary dependencies:
```
poetry install
```
Apply any pending database migrations:
```
poetry run python manage.py migrate
```
Seed intitial admin users (required argument: admin email addresses separated by comma):
```
poetry run python manage.py initadmins {email list}
```
And then lastly launch the backend server:
```
poetry run python manage.py runserver
```
### Running the Application with Docker:
......@@ -77,4 +49,5 @@ allowed host addresses.
In Docker this can be done followingly:
```bash
docker run --name backend -e HOST_ADDRESSES="172.26.0.1,192.168.0.1" -p8000:8000 -d backend gunicorn
\ No newline at end of file
docker run --name backend -e HOST_ADDRESSES="172.26.0.1,192.168.0.1" -p8000:8000 -d backend gunicorn
```
\ No newline at end of file
......@@ -4,12 +4,12 @@ This repository contains the INJECT project.
## Quick list
- [Documentation](#documentation)
- [Instalation and runnning the application](./INSTALATION.md)
- [Installation and runnning the application](./INSTALLATION.md)
- [Deployment](./INSTALLATION.md#deployment)
- [Formatting with Black](#formatting-with-black)
- [Django Administration Panel](#django-administration-panel)
- [Django-nose unit tests](#django-nose-unit-tests)
### Versioning
Backend uses [Semver](https://semver.org/) with `poetry`. The current backend version can be manually
found in the [pyproject](../pyproject.toml) file or checked by running `poetry version`.
......@@ -20,6 +20,38 @@ More details can be found [here](./dev/README.md#backend-versioning).
GraphQL documentation can be interacted with through GraphiQL interface available at http://127.0.0.1:8000/inject/api/v1/graphql/.
### Running the project
To run the backend of INJECT, you have two options, each with its own set of requirements. The first method utilizes [poetry](#running-the-application-with-poetry) and is mostly used for development, while the second employs [Docker](./INSTALLATION.md#running-the-application-with-docker).
Before running the project, ensure that the necessary local variables are properly configured. List of these variables can be found at [Local variables](./INSTALLATION.md#local-variables)
### Running the Application with poetry:
To run the backend application using poetry, ensure you have the following prerequisites:
* [python](https://www.python.org/) with a supported version of 3.8.10
* [poetry](https://python-poetry.org/)
Once you have these installed, follow these steps:
Use Poetry to install the necessary dependencies:
```
poetry install
```
Apply any pending database migrations:
```
poetry run python manage.py migrate
```
Seed intitial admin users (required argument: admin email addresses separated by comma):
```
poetry run python manage.py initadmins {email list}
```
And then lastly launch the backend server:
```
poetry run python manage.py runserver
```
### Formatting with Black
[Black](https://pypi.org/project/black/) is included in the poetry environment and configured appropriately.
To reformat code run `black .`, to check if your code is formatted properly run `black . --check` .
......
......@@ -35,3 +35,4 @@ change: make name parameter during definition upload optional #146
feat: add `exercise_definition/validate` endpoint for definition validation #144
change: rename api prefix from `ttxbackend` to `inject` #183
feat: add `validate_email_address` query for validation purposes #188
docs: update INSTALATION.md and move poetry description back into README.md
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment