- The project runs on Python 3.10.
You'll have to set-up the following user variable(s) in your environment:
SECRET_KEY- A Django secret key. You can user any keygen to roll your own key.FROM_EMAIL- This is the email addressSendGridwill use to send emails.NEWS_API_KEY- The NewsAPI key that'll be used innewsapi_wrapper.py.SENDGRID- The SendGrid key that'll be used insendgrid_service.py.
Rename keys as necessary
setx "KEY_NAME" "KEY_VALUE"
# If successful, it'll say: "SUCCESS: Specified value was saved."
echo %KEY_NAME% # In a new terminal. Otherwise, it won't show up.From there, set the KEY_NAME in your local.py, newsapi_wrapper.py and
sendgrid_service.py and you're good to go for each missing key.
Apart from cloning this project, you also need the following -
Make sure you get both the PostgreSQL server, and the Postgres Admin. The default installation comes with both.
- Create and activate a virtual environment.
- Install all requirements using
pip install -r requirements.txtin a virutal environment. - Set up environment variables according to the instructions above.
- Go to
config/settings/local_template.py. - Create a copy of this file, named
local.py. - Configure the file using your local Postgres credentials.
- Configure
HEADLINES_CRONinconfig/settings/base.pyaccording to your needs, by default, it's every 5 minutes. Change accordingly. - Run using:
python manage.py runserver --settings=config.settings.local - In a separate terminal (with the same active virtual environment) start the
job runner using:
python manage.py job_runner --settings=config.settings.local