This project serves as the backend of the robotic metaverse, that brings robotic projects in one place.
- Backend Framework: Django and Django REST
- Database: Postgres
-
Clone the Repo 📥
git clone https://github.com/openroboticmetaverse/orom_backend.git
cd orom_backend
-
Save path to this folder as environment variable.
Get the current path:
export OROM_BACKEND_PATH=$(pwd) echo $OROM_BACKEND_PATH
Open your terminal configuration file (see instructions below, they can vary based on your terminal and operating system) and append the following line: enter value at the bottom:
export OROM_BACKEND_PATH=<your previous output>
then restart the terminal- For macOS:
sudo nano ~/.zshrc
- For Linux:
sudo nano ~/.bash_rc
- For Windows:
TODO
- For macOS:
-
Docker Compose 🐳
docker compose up
-
Create Admin User Now the database is build and you can start using the app. For easier use you can also create an admin to enable the adminpanel under localhost:8000/admin/
python manage.py createsuperuser
-
API Testing
For API testing we are using Hoppscotch. To be added to our workspace message one of us. To run the requests you need to install the browser extension.
-
Django Model Changes When adapting the models.py file, you have to migrate these changes to the current database entries (in development it often is easier to just reseting the whole db and starting from zero)
docker exec -it orom_backend bash
python orom_backend/manage.py makemigrations
python orom_backend/manage.py migrate
How to start from zero: You have to delete the database image and postgres-volume. If you are only working on this project and have no other Docker projects just run:
(warning: Docker will delete all container, images and volumes)docker system prune -a
When you are new to Django check out: Writing your first Django app
Here you can find the Django Documentation and the Django REST Documentation
Enjoy 🎉🥳