A Django web application for scraping reviews, pricing data, and news content from web sources.
This project includes:
- A Django app named
scraper - REST API endpoints for scraping reviews, pricing, and news
- A homepage UI for selecting scraping methods
- Environment-based database configuration with SQLite fallback for local development
POST /scrape/reviews- expected payload:query,sourcePOST /scrape/pricing- expected payload:urlPOST /scrape/news- expected payload:query- Simple frontend served from
scraper/templates/scraper/home_page.html
Note: current scraper logic in
scraper/handlers.pyreturns placeholder sample responses.
- Python 3.11+ (project uses Python 3.14 in the current virtual environment)
- Django
- Django REST Framework
- psycopg2-binary (for PostgreSQL support)
- python-decouple
- BeautifulSoup4 and lxml (for scraping logic)
- Create and activate the virtual environment:
cd C:\Users\ZENOID\Desktop\Home\home\self_made.project\veritlyscraper
.env\Scripts\Activate.ps1- Install dependencies:
pip install -r requirements.txt-
Copy or create
.envin the project root. -
Configure environment variables in
.env.
DB_ENGINE=sqlite3
SECRET_KEY=your-secret-key
DB_NAME=veritly
DB_USER=postgres
DB_PASSWORD=your-db-password
DB_HOST=localhost
DB_PORT=5432The project supports both SQLite and PostgreSQL via DB_ENGINE.
sqlite3uses the local filedb.sqlite3postgresuses the PostgreSQL settings from.env
For local development, use:
DB_ENGINE=sqlite3Run the Django migrations:
python manage.py migrateStart the development server:
python manage.py runserverOpen http://127.0.0.1:8000/ in the browser.
POST /scrape/reviews
Body:
{
"query": "Acme Corp",
"source": "Trustpilot"
}POST /scrape/pricing
Body:
{
"url": "https://example.com/product"
}POST /scrape/news
Body:
{
"query": "technology"
}veritly/- Django project settings and configurationsscraper/- main Django app with views, serializers, templates, and scraper handlersenv/- Python virtual environmentdb.sqlite3- default SQLite database file
- The frontend currently uses static assets in
scraper/static/ - Update
scraper/handlers.pyto implement real scraping behavior - Keep
.envout of version control (already ignored by.gitignore)