Skip to content

noddy09/news_search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

News Search Platform

About

Simple interactive platform which internally uses News API to fetch News based on provided keywords. To keep this application short and simple, I have used jQuery as frontend and Django with DRF as backend. Click here to know about implemetation.

Installation

Following instructions are meant for Debian based Linux distro, but not limited to. I suggest you to find alternatives packages suitable your distro, especially for database server.

Setup application server

  • Install system packages.
sudo apt install virtualenv python3-dev python3-pip redis nginx
  • Create virtual environment for backend server and activate same.
virtualenv -p python3 env
. env/bin/activate
  • Install all required pip packages.
pip install -r news_search/conf/requirements.txt
  • Ready database with admin user creation.
cd news_bl
python manage.py migrate
python manage.py createsuperuser
  • Ready static files
python manage.py collectstatic
  • Run server.
python manage.py runserver localhost:8080

Async task:

  • For async celery task, open new terminal and load same virtual environment:
. env/bin/activate
  • Change directory to application code and call run celery application:
cd news_bl
celery -A news_bl worker -l INFO 
  • You can add multiple workers for celery application by '--concurrency=2' option.

Setup webserver

  • Get your full path of frontend directory where index.html is resides and replace same with __NEWS_INDEX_ROOT__ in conf/etc/nginx/sites-available/news.conf file.
  • Copy news.conf congifuration to nginx's configuration directory
sudo cp conf/etc/nginx/sites-available/news.conf /etc/nginx/sites-available/default
  • Link that file in sites-enable context
sudo ln -s conf/etc/nginx/sites-available/default /etc/nginx/sites-enabled/
  • Text nginx configuration
sudo nginx -t
  • Restart nginx service
sudo service nginx restart

About

News Search Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published