Backend for CocoMaterial project
- Python3
- docker (optional, to run Postgresql)
-
Run postgres
$ docker run -d --name coco -p 5432:5432 -e POSTGRES_USER=coco -e POSTGRES_DB=coco -e POSTGRES_PASSWORD=coco postgres:12.3
-
Create virtualenv and install dependencies
$ cd coco-material-back $ python -m venv .env --prompt coco-material # this line only the first time, to create the virtualenv $ source .env/bin/activate # this line everytime, to activate the virtualenv $ pip install -r requirements.txt
-
Migrate models
$ python manage.py migrate
-
Create super user
$ ./manage.py createsuperuser
-
It's alive!
$ python manage.py runserver
-
Upload vectors Go to
http://localhost:8000/admin
, log in the system and use theadmin
to upload new vectors -
API Go to
http://localhost:8000/api
to check the browsable apiExample:
curl -X GET http://localhost:8000/api/tags/