The repository covers topics such as setting up a Django project, creating serializers, implementing authentication and permissions, handling requests and responses, versioning, pagination, and filtering. It also covers advanced topics such as handling file uploads, implementing nested resources, and creating custom renderers.
- Category
- Products
- Cart
- User
- create a order, update order status(only admin can do that)
- Image Upload ( for products)
- Generate a JSON Token to access specific API's
- performance tests
- Implemented caching
- Running background tasks
• Authentication : JWT
• Parallel Tasking -> Celery
• Cache -> Redis
• Database -> PostgreSQL
mysql -u root -p
create database storefront3;
docker run -d -p 6379:6379 redis
python manage.py runserver
Docker File coming soon !
-
Basic understanding of Django structure
-
python version 3.8 or higher
-
Virtualization should be enable to run docker container
-
mysql server (in docker container also works)
To install the code in this repository, follow these steps:
-
Clone the repository:
git clone https://github.com/manas-shinde/Build-RESTful-APIs-with-Django-REST-Framework.git
-
Create a virtual environment:
python -m venv env
-
Activate the virtual environment:
source env/bin/activate (Unix-based systems) or env\Scripts\activate (Windows)
-
Install the required packages:
pip install -r requirements.txt
-
Create database in MySQL:
CREATE DATABASE storefront3;
-
Migrate the database:
python manage.py migrate
To run the application, follow these steps:
-
Activate the virtual environment:
source env/bin/activate (Unix-based systems) or env\Scripts\activate (Windows)
-
Run the development server:
python manage.py runserver
-
Open a web browser and go to http://localhost:8000 to see the API homepage.
Contributions to this project are welcome! To contribute, follow these steps:
-
Fork this repository
-
Create a new branch for your feature:
git checkout -b feature/my-feature
-
Make your changes and commit them:
git commit -am 'Add some feature'
-
Push to the branch:
git push origin feature/my-feature
-
Submit a pull request
To run tests, run the following command
pytest
OR If you are using Vscode then can setup test up pytest in Vscode to Root Directory.
To run tests related to collection endpoint only use below command :
python -m pytest ./store/tests/test_collections.py