Collect news from newsapi
The first thing to do is to clone the repository:
$ git clone https://github.com/russell310/news_feeder.git .
$ cd news_feeder
Create a virtual environment to install dependencies in and activate it:
$ virtualenv venv
$ source venv/bin/activate
Then install the dependencies:
(venv)$ pip install -r requirements.txt
Note the (venv)
in front of the prompt. This indicates that this terminal
session operates in a virtual environment set up by virtualenv
.
Once pip
has finished downloading the dependencies copy .env
and change with your settings:
(venv)$ cp .env.example .env
After adding .env
migrate to database
(venv)$ python manage.py makemigrations
(venv)$ python manage.py migrate
Import source list from newsapi
(venv)$ python manage.py load_sources
Now start the development server
(venv)$ python manage.py runserver
Alongwith runserver
open separate two terminal for celery and celery beat
(venv)$ celery -A news_feeder worker --pool=solo -l info
(venv)$ celery -A news_feeder beat -l INFO
Now navigate to http://localhost:8000/