Skip to content

rafazafar/leadplusnews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leadplusnews

A test project for Leadplus. Django app for consuming and serving articles from Newsapi.com

** please read FAQ section below for known bugs **

Screenshot

Screenshot

Requirements

  • Python: >3.10

Environment Variables

To run this project, you will need to add the following environment variables to your /leadplusnews/.env file

NEWSAPI_KEY

1) Get Api Key from Newsapi.com

Visit Newsapi.com/register

2) Clone .env.example to .env

  cp leadplusnews/.env.example leadplusnews/.env

3) Update .env with apikey from Newsapi.com

Run Locally

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

API Reference

Get all available APIs

  GET /api

Get latest 100 Articles in JSON

  GET /api/articles?format=json

Seeding Database

Run seeding command from project root folder. This will take a while.

  python manage.py seed

Delete All Articles

Use with caution

  python manage.py delete_all_articles

FAQ

Why do Articles not have PublishedAt data ?

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.

License

Django: BSD

About

A django test project for Leadplus.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published