Short project description.
Before running the project, make sure you have the following installed on your machine:
- Python 3.10
- Pipenv
- (Optional) Docker and Docker Compose
Follow the instructions below to get the project up and running.
-
Install Docker and Docker Compose on your machine. You can download Docker Desktop from the official Docker website: https://www.docker.com/products/docker-desktop
-
Clone the project repository:
- a. Clone using SSH:
git clone git@github.com:imtiazpy/ecom-multi-filter.git
- b. Clone using HTTPS:
git clone https://github.com/imtiazpy/ecom-multi-filter.git
-
Navigate to the project's root directory: cd project
-
Build the Docker image and start the containers: sudo docker-compose up
This command will build the Docker image and create the necessary containers for the project. It will also start the Django development server.
-
Open your web browser and access the project at http://localhost:8000.
-
(Optional) To populate the database with initial data, open another terminal or command prompt and run the following commands. You must strictly follow the order in which these commands are executed:
-
Categories and Brands:
docker-compose run web python manage.py loaddata categories_brands.json
-
Sellers:
docker-compose run web python manage.py loaddata sellers.json
-
Products:
docker-compose run web python manage.py loaddata products.json
These commands will execute the respective loaddata
commands within the Docker container and populate the database.
- Clone the project repository:
- a. Clone using SSH:
git clone git@github.com:imtiazpy/ecom-multi-filter.git
- b. Clone using HTTPS:
git clone https://github.com/imtiazpy/ecom-multi-filter.git
-
Navigate to the project's root directory: cd project
-
Create a virtual environment and activate it: pipenv shell
-
Install project dependencies: pipenv install
-
Set up the Environment Variables:
-
Create a
.env
file in the project's root directory. -
Copy the contents of
env.example
into the newly created.env
file. -
Generate a secret key using any online Django Secret Key generator. or
-
You can run this command:
python manage.py shell -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
-
Replace the value of
SECRET_KEY
with the newly generated secret key in the.env
file. (no space between between variable, = and value)SECRET_KEY=your_secret_key_here
-
-
Apply the database migrations: python manage.py migrate
-
(Optional) Populate the database with initial data, You must strictly follow the order in which these commands are executed:
-
Categories and Brands:
python manage.py loaddata categories_brands.json
-
Sellers:
python manage.py loaddata sellers.json
-
Products:
python manage.py loaddata products.json
These commands will load the fixture data into the database.
-
Start the Django development server: python manage.py runserver
-
Open your web browser and access the project at http://localhost:8000.
-
To stop the Django development server, press
Ctrl + C
in the terminal or command prompt.
For any doubts or questions, feel free to contact me at imtiazahmed.py@gmail.com.
For collaboration or team work, please email me at imtiazahmed.py@gmail.com. I would be happy to discuss further opportunities.