This system manages and tracks sustainability actions. The API supports creating, retrieving, updating, and deleting sustainability actions.
- Clone the repository:
git clone https://github.com/lindapu-1/API.git cd api - Run migrations:
python manage.py migrate
If you have previous records stored in a JSON file, you should retrieve them to the database first by running:
python retreive_from_json.pyThis script will read the JSON file and insert the data into the database. The script use ex_data.json as example.
To run the server, use the following command:
python manage.py runserverThis will start the server and you can access the API at http://localhost:8000/api/actions/.
You can then use GET and POST requests to change the records on the webpage.
If you want to export the records to a JSON file as a copy, run:
python save_to_json.pyThis will create a new JSON file with the current records.