This is a Django REST API, the backend of a project management system.
-
With python3.12.2 installed. Install the requirements:
pip install -r requirements.txt
OBS: You can use a
virtualenv
orpyenv
to install the requirements if you want. -
Install postgresql 14 with the following configurations:
user: postgres password: postgres database: project-management
- If your postgres is already installed, just create a database named
project-management
.createdb project-management -U postgres
OBS: If you want to use another database settings, you must create and change the database variables in
.env
file (copy it if from .env.dev file). - If your postgres is already installed, just create a database named
-
Run the migrations:
python manage.py makemigrations && python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Check if everything is working
python manage.py runserver
Go to localhost:8000/admin and check if it's working
To run the tests:
./manage.py test
To get coverage report:
coverage run --source='.' manage.py test
coverage report
You can import the Postman collection to test the API.
Just run the project and use the HOST variable in the postman collection to localhost:8000
.
./manage.py runserver
Know that you can use filters
, sorting
, searches
, expanding fields
, asking for just a few fields
... etc. Just look at the postman collection in the listing endpoints in the params
tab. Some use cases are documented there.
You can access the admin page to manage the data in the database. Just go to localhost:8000/admin.
Try to create some users and customers before start using the API.