------------------------------------------------
------------------------------------------------
To see the current endpoints, run the following command:
python manage.py stdout_endpoints > ENDPOINTS.md
------------------------------------------------
The API documentation is available in two formats:
-
Swagger UI: Provides an interactive API documentation interface.
- URL:
http://127.0.0.1:8000/api/schema/swagger-ui/
- URL:
-
Redoc: Provides a more detailed and customizable API documentation interface.
- URL:
http://127.0.0.1:8000/api/schema/redoc/
- URL:
------------------------------------------------
checkout the diagram at:
------------------------------------------------
This project uses black
for code formatting. Black is a code formatter for Python that ensures consistent code style.
Pre-commit hooks are used to ensure code quality before committing changes. This project uses the following pre-commit hooks:
-
check-yaml: Checks YAML files for syntax errors.
-
end-of-file-fixer: Ensures files end with a newline.
-
trailing-whitespace: Removes trailing whitespace.
-
black: Formats Python code using black.
To install the pre-commit hooks, run:
pre-commit install
to run the pre-commit hooks manually, use:
pre-commit run --all-files
------------------------------------------------
- Clone the repository:
git clone [email protected]:serene1212/porsojo.git
- Navigate to the project directory:
cd deal_direct
- Install the required packages:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Copy sample.env and change variables:
cp sample.env .env
- Run the server:
python manage.py runserver
To build and run the Docker containers, use the following commands:
docker-compose up --build
This will start all the necessary services defined in the docker-compose.yml
file.
For more details, refer to the Dockerfile in the project repository. ------------------------------------------------
You can start real time chat for a product with the seller of the product.
-
Run the Django Development Server:
python manage.py runserver
-
Access the Chat Room:
- Open a web browser and navigate to http://localhost:8000/chat/<room_name>/, replacing <room_name> with the desired chat room name.
-
Start Chatting:
- Type a message in the input box and press "Send" or hit the Enter key to send the message. Messages will appear in the chat log.
-
Permissions:
- The IsParticipant permission class ensures that only authenticated users who are participants of the chat room can access the chat.
This project aims to achieve over 95% test coverage.
All tests are written using pytest
.
To run the tests and see the coverage report, use the following command:
pytest --cov --cov-config=.coveragerc
this command will exclude custom_commands
directory from testing