Giter VIP home page Giter VIP logo

news_search's Introduction

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

news_search's People

Contributors

noddy09 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.