Susun Jadwal Backend
Requirements
- Ensure
python
andpip
are installed - Create virtual environment using
python3 -m venv env
- Activate virtualenv
source ./env/bin/activate
pip install -r requirements.txt
- Run
FLASK_ENV="development" flask run
Configuration
Development
MongoDB using docker:
docker run --rm -d -p 27017:27017 --name=test-mongo mongo
Stop database:
docker stop test-name
By default, Flask access MongoDB on localhost:27017
with database named test
.
Production
- Set database admin username and password at
start_db.sh
- Run
./start_db.sh
to create docker container namedristek-mongo
- Run
docker exec -it ristek-mongo mongo -u <admin_username>
to executemongo
- Create database:
use <db_name>
- Create user for database:
db.createUser(
{
user: "<db_user>",
pwd: "<db_pwd>",
roles:[
{
role: "readWrite",
db: "<db_name>"
}
]
}
);
- Run
./start.sh
License
See LICENSE.md. This software actually goes a long way back, thank you so much to everyone involved.