A test project for Leadplus. Django app for consuming and serving articles from Newsapi.com
** please read FAQ section below for known bugs **
- Python: >3.10
To run this project, you will need to add the following environment variables to your /leadplusnews/.env file
NEWSAPI_KEY
cp leadplusnews/.env.example leadplusnews/.env
Clone the project
git clone https://github.com/rafazafar/leadplusnews
Go to the project directory
cd leadplusnews
Install dependencies
pip install -r requirements.txt
Apply DB Migrations
python manage.py migrate
Create Superser
python manage.py createsuperuser
Start server
python manage.py runserver
Visit site at http://localhost:8000
or
Visit admin at http://localhost:8000/admin
GET /api
GET /api/articles?format=json
Run seeding command from project root folder. This will take a while.
python manage.py seed
Use with caution
python manage.py delete_all_articles
Using older v1 /article endpoint as per test instructions. The endpoint is depricated and has some issue. One being that the datetime data is always null.
Django: BSD