You can enhance your README by using tables, emojis, and some additional formatting for clarity. Here's a styled version with a table, relevant emojis, and some structured headings:
This Django-based backend manages the data needs for the Factory 86 factory management application.
Folder / File | Description |
---|---|
📁 DevFest2k24_Backend/ | The default folder created with the Django project. Its most important files are: |
📄 settings.py | Global settings for the project. |
📄 urls.py | Main URL dispatcher, currently redirects all URLs to the main/ app. |
📁 main/ | The primary app of the Django project. The key files and folders are: |
📄 models.py | Defines models that interface with the database, such as StampingPress , PaintingRobot , and AGV (all inherit from django.models.Model ). |
📄 serializers.py | Contains class-based serializers inherited from Django Rest Framework ModelSerializer . They convert between complex Django Model instances and native Python data types. |
📄 urls.py | Local URL dispatcher for the main/ app, linking endpoints to the appropriate views. |
📁 views/ | Contains views that handle requests. The views are categorized by different concerns: |
📄 sensors_loading.py | Handles POST requests from sensors, storing their data in the database. Each sensor type has a dedicated view. |
📄 sensors_uploading.py | Provides logged sensor data to the frontend. |
📄 account.py | Manages account-related operations, such as account listing. |
📄 notification.py | Retrieves logged notifications from the database and sends them in real time. |
📄 task.py | Manages automatic task logic, such as listing tasks and updating their statuses. |
📄 team.py | Handles logic related to operator teams. |
Once cloned, create a python or conda virtual environment, install the dependencies in requirements.txt, and then follow the steps to launch the server :
- Our repo is configured to work with PostGRES, so create a new PostGRES database, and copy the credentials in a .env file in the root directory of the repo like so:
DB_NAME=devfest2k24_db
DB_USER=devfest2k24_db_user
DB_PASSWORD=aLOSZHBymFWYJVuZbRfP8G3TN6vA8M5X
DB_HOST=dpg-cs8lngt6l47c73djjmb0-a.frankfurt-postgres.render.com
DB_PORT=5432
PUSHER_INSTANCE_ID=81c0ae68-e069-4f61-b077-f32109ad8497
PUSHER_PRIMARY_KEY=0EC9A4DC914ACE1E725990007D9D90D7F6BF5B16E8C8EE8436A1D663A29D024F
PUSHER_APP_ID="1881989"
PUSHER_KEY="7d6ea766b63cf2c27687"
PUSHER_SECRET="22a589d1c0b7be4baff2"
PUSHER_CLUSTER="eu"
- in the root folder run : python manage.py makemigrations
- in the root folder run : python manage.py migrate
- in the root folder launch a local development server with : python manage.py runserver
The API documentation can be found on the postman project at the following link : https://documenter.getpostman.com/view/25080355/2sAXxWbA2u
credentials to use the api:
Manager:
email: [email protected]
password: admin
Operators:
here we have all types of operator:
email:[email protected]
passsword:operator
email:[email protected]
passsword:operator
email:[email protected]
passsword:operator
email:[email protected]
passsword:operator
email:[email protected]
passsword:operator
email:[email protected]
passsword:operator