This is a Django-based ecommerce project built using Django Rest Framework (DRF). It provides a backend API for managing various ecommerce functionalities such as product listing, shopping cart, order management, and user authentication.
- Product Listing: The project allows listing and searching for products.
- API Endpoints: The ecommerce functionalities are exposed via API endpoints, making it easy to integrate with frontend or other systems.
- Documentation: The project includes comprehensive documentation to assist with development, customization, and integration.
- Python 3.11
- Django 4.2
- Django Rest Framework
- Factoryboy
- Pytest
Make sure you have the following installed before proceeding:
- Python 3.9 or above
- Clone the repository:
git clone https://github.com/whosgotch/django-drf-ecommerce.git
- Create a virtual environment:
python -m venv env
- Activate the virtual environment:
For Windows:
venv\Scripts\activate
For macOS/Linux:
source venv/bin/activate
- Install the project dependencies:
pip install -r requirements.txt
- Apply database migrations:
python manage.py migrate
- Generate django secret key:
python manage.py shell
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
exit()
- Created .env file in drfecommerce directory and copy in your secret key:
SECRET_KEY=your_secret_key
- Start the development server:
python manage.py runserver
Access the application in your web browser at http://localhost:8000.
To run the tests for the Django Blog project, execute the following command:
pytest
The tests utilize Pytest and Factoryboy to ensure the functionality is working as expected and to maintain code quality.
For detailed documentation on how to use and customize the project, please refer to the http://localhost:8000/api/schema/docs/