git clone https://github.com/fcramos/scheduler
cd scheduler
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
touch .env
Create scheduler database
pip install mysqlclient
Set url database
msql://user:password@localhost/scheduler
pip install psycopg2-binary
Set url database
postgres://postgres:fcr-9194@localhost/scheduler
python -c "import secrets; print(secrets.token_urlsafe())"
vim .env
SECRET_KEY=<past here secret_key>
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=<paste here url database>
python manage.py migrate
python manage.py test
python manage.py runserver
curl -d '{"method": 1, "timestamp": "2021-07-29T12:00:00", "receiver": "Jon Do", "message": "Good morning"}' -H "Content-Type: application/json" -X POST http://localhost:8000/api/scheduling
curl -H "Content-Type: application/json" -X GET http://localhost:8000/api/scheduling
curl -H "Content-Type: application/json" -X GET http://localhost:8000/api/scheduling/<id>
curl -d '{"method": 1, "timestamp": "2021-07-29T12:00:00", "receiver": "Jon Do", "message": "Good morning", "status": 1}' -H "Content-Type: application/json" -X PUT http://localhost:8000/api/scheduling/<id>
curl -H "Content-Type: application/json" -X DELETE http://localhost:8000/api/scheduling/<id>