![](/juliusmarkwei/ecommerce-server/raw/main/assets/others/django drf logo.png)
A fully functional Ecommerce - Django Rest API project build and tested with restframework and deployed to vercel
The project was inspired by a random database schema of an ecommerce website I found on Azimutt gallery. Every piece of this project required alot of time and research since it was one of my beginner projects build with django. The activities involved in this project are as follows:
- Database model (table) development and configurations
- Writing the various API views for all the neccessary methods of each view
- Admin panel management configurations.
- Adding all the neccesary URL endpoints to for all the various views and thier methods. Not forgetting the admin panel too.
- Writing tests for all the views and thier methods. I also used Postman for testing as well.
- Including a documentation for the project through a python module called drf-yash by OpenAPI Initiative.
- Dockerized the Django Rest API whci I was able to successfully run on my local machine.
- Deploy the Django REST API to vercel
![](/juliusmarkwei/ecommerce-server/raw/main/assets/others/Screenshot_api_first.png)
![](/juliusmarkwei/ecommerce-server/raw/main/assets/others/Screenshot_api_second.png)
python3.10
django
djanfo-restframework
docker (*optional)
git clone https://github.com/juliusmarkwei/ecommerce-backend.git
cd ecommerce-backend/
pip install -r requirements.txt
- In the root directory of the project, create a superuser to manage all the users of the application. be sure python is installed before you proceed with this stage.
python3 manage createsuperuser
python3 manage runserver
Run the program using Docker
Docker and Docker Compose should be installed on your system. For Docker installation guide: Get Docker and Install Docker Compose. Steps to run the application:
git clone https://github.com/juliusmarkwei/ecommerce-backend.git
cd ecommerce-backend/
- Create a
.env
preferrably in /main/settings/. Inside the .env add a SECRET_KEY and your database configurations of the database of your choice. You can generate aSECRET_KEY
using the following code snippet:
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
- Add the following line printed above to the
.env
file:
SECRET_KEY=your_secret_key_here
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=your_db_name
DB_PORT=your_db_port
DB_ENGINE=your_db_engine
docker-compose up --build
- This command builds the Docker image starts the containers as defined in the docker-compose.yml file.
- Once the application (container) is running, access the application running on port 8000 via http://localhost:8000.
- Stopping the application:
docker-compose down
- Rebuilding the application after changes:
docker-compose up --build
We welcome contributions and participation from the community to help make this e-commerce backend API even better! Whether you're looking to fix bugs, add new features, or improve documentation, your help is greatly appreciated. Here's how you can get involved:
If you encounter any bugs or issues, please report them using the Issues section of my GitHub repository. When reporting issues, please include:
- A clear and descriptive title.
- A detailed description of the problem, including steps to reproduce it.
- Any relevant logs or error messages. Your environment details (e.g., Django version, DRF version, database, etc.).
I love receiving pull requests from the community! If you have an improvement or a new feature you'd like to add, please feel free to do so 👍