- The frontend stores data in DB using django.
- Django also acts as a gateway for the frontend to asynchronous send training requests to FastAPI.
- The model training updates are sent back to django by FastAPI
- (NEW) Django hosts front end static files, so running backend is sufficient to start the website.
- Please install Postgres 12.3 (in the linked example they use
PostgreSQL 9.2, please ensure you replace 9.2 with 12.3)
- If on linux, please make sure to start postgres
sudo service postgresql start
- if you use the installation guide above for unix or windows you shouldn't have to do this
- If on linux, please make sure to start postgres
- Ensure your
hilt-demo
environment is activated - We will now setup the postgres connection. So, ensure that postgres is up and running.
Execute
cd HILT-demo/annotation_backend/annotation_backend
.- Inside the
annotation_backend
folder, navigate to settings.py- Find the
DATABASES
dictionary, and replace thePASSWORD
value with your own password
- Find the
- Inside the
- Run:
- Create superuser/admin use django's
python manage.py createsuperuser
- Create superuser/admin use django's
- Start the backend from
cd HILT-demo/annotation_backend
folder:python manage.py runserver 0.0.0.0:8000
- Postgres is not installed:
- To check: Open up terminal and exectue
which psql
. This should return a path. - To solve: Please follow the example provided
- To check: Open up terminal and exectue
- Some other application is listening on port 5432
- To check: (Unix, Linux):
sudo lsof -i:5432
, (Windows):netstat -tulpn | grep 5432
- To solve: Get the Process ID of the application running on the port and kill the process.
- To check: (Unix, Linux):
- Paths starting with
api/
are used by Vue.js frontend to save and retrieve data.
- DRF if used in this project to create views faster using models, serializers & DRF helpers.