NewsBee is a country-based news sharing website written in Python backed by Django and the Mediastack API for retrieving news. Users register with their country and login. Home page is divided into 3 sections
- News, where users sees news from their own country
- BeeNews, where users see news shared by other users
- My Collection, where users see the news they shared
Sign up and get a Mediastack API key here
-
Install MariaDB and the required development libraries for it
// Development libraries sudo apt install libmariadb-dev libmariadb-dev-compat libmariadbclient-dev sudo apt install python3-dev
-
Create a database called
news_bee
in MariaDB -
In the
NewsBee
directory, make asecrets.py
file and write down the secret variables requiredDJANGO_SECRET_KEY = '<any random string>' DATABASE_PASSWORD = '<your mariadb database password>' MEDIASTACK_KEY = '<your api key>'
Then in the
settings.py
file, search forDATABASES
and change the username there to the username of your database (usuallyroot
) -
Make a virtual environment of python and install dependencies
python3 -m venv env source env/bin/activate pip install -r requirements.txt
-
Migrate the changes to your database.
python3 manage.py makemigrations python3 manage.py migrate
-
Run the server with
python3 manage.py runserver