drugs/README.md

43 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2023-10-17 20:04:07 +00:00
# drugs
DIMAR: An anti-addiction-focused Drug Inventory Management, Administration and Retrospective tool.
2023-10-17 20:00:25 +00:00
## Setting up the environment
Create the virtual environment, enable it, and install the dependencies.
```shell
$ python3 -m venv env
$ source env/bin/activate
2023-10-17 20:04:07 +00:00
(env) $ pip install -r requirements.txt
2023-10-17 20:00:25 +00:00
```
## stack.env
The stack.env file referenced is a Portainer special. This is where Portainer would put a file containing all the environment variables set up in its UI.
To run it manually, you will need to copy `stack.env.example` to `stack.env` in the project root.
## Running database migrations
Now we need to run the database migrations in order to get a working database.
```shell
(env) $ python manage.py migrate
```
Note that these are automatically run by a step in the compose file in production.
You won't need to do that manually.
## Creating a superuser
In order to access Django admin, we need a superuser.
```shell
(env) $ python manage.py createsuperuser
Username: t2
Email address: t2@google.com
Password:
Password (again):
Superuser created successfully.
```
## Running
2023-10-17 20:04:07 +00:00
The Docker Compose file is located in `docker-compose.yml`.
2023-10-17 20:00:25 +00:00
There is a shortcut to run it: `make run`.
## Stopping
To stop the containers, run `make stop`.