Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 2.39 KB

README.md

File metadata and controls

46 lines (36 loc) · 2.39 KB
  • 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.

Table of contents

  1. Setup
  2. URLs.py
  3. Managers
  4. Serializers

Setup

  1. 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
  2. Ensure your hilt-demo environment is activated
  3. 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 the PASSWORD value with your own password
  4. Run:
    • Create superuser/admin use django's python manage.py createsuperuser
  5. Start the backend from cd HILT-demo/annotation_backend folder: python manage.py runserver 0.0.0.0:8000

Potential Errors:

  • 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
  • Some other application is listening on port 5432

URLs

  • Paths starting with api/ are used by Vue.js frontend to save and retrieve data.

Django Rest Framework

  • DRF if used in this project to create views faster using models, serializers & DRF helpers.