A Django-based web application that lists Egyptian products scraped from Amazon and Carrefour.
This project is a web application built with Django that showcases a variety of Egyptian grocery products. The products are scraped from major retailers like Amazon and Carrefour, providing an extensive list for users to browse.
- Lists Egyptian grocery products scraped from Amazon and Carrefour
- User-friendly interface for browsing and searching products
- Built with Django, ensuring a robust and scalable backend
Before you begin, ensure you have met the following requirements:
- Python 3.6+ installed on your machine
- Git installed for cloning the repository
- PostgreSQL database (hosted on Neon.tech or any other PostgreSQL provider)
- Acquire your database credentials (hostname, database name, username, password, and port)
Follow these steps to set up the project locally:
Open your terminal and run:
git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
Create a virtual environment to manage dependencies:
python -m venv venv
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
Install the required Python packages using pip
:
pip install -r requirements.txt
Create a .env file in the root directory of the project to store environment variables:
touch .env
Populate the .env file with the following variables:
SECRET_KEY=your-secret-key
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=sqlite:///db.sqlite3
SECRET_KEY
: A secret key for Django security purposes. You can generate one using tools like Django Secret Key Generator.DEBUG
: Set to True for development. In production, set it to False.ALLOWED_HOSTS
: A comma-separated list of hosts/domain names that the Django site can serve.DATABASE_URL
: Your PostgreSQL database URL. Replace username, password, hostname, port, and database_name with your actual credentials from Neon.tech.
Apply migrations to set up the database schema:
python manage.py makemigrations
python manage.py migrate
Populate the database with scraped products:
python manage.py runscript data
- Ensure that the data script is properly set up to scrape data from Amazon and Carrefour.
- This script will fetch the latest products and store them in your database.
Start the Django development server:
python manage.py runserver
The application will be available at http://127.0.0.1:8000/.