Coder Social home page Coder Social logo

feeder's Introduction

Desktop Mobile

Introduction

The goal of this project is to create a simple, yet powerful, reader for RSS feeds. It reads RSS URLs in the feed.ini file and fetch the content of the feeds.

The project is written with django 4.1 and Python 3.

Features

  • Simple and intuitive interface
  • Bootstrap 4 (static files included)
  • Procfile for deployment
  • SQLite database by default
  • Separate settings for development and production(environment variables)
  • Custom admin interface
  • User authentication and Permissions for viewing and editing feeds
  • Users add favorite feeds to their profile

Installation

  • Create a virtual environment and activate it
python3 -m venv feeder-venv
source feeder-venv/bin/activate
  • Clone the repository
git clone https://github.com/mofm/feeder.git
  • Install dependencies
pip install -r requirements.txt
  • Create environment files
mkdir .env
touch .env/development.env
touch .env/production.env
  • Add environment variables for your development environment

For production environment, use environment variables from production.env

SECRET_KEY= (generate a random string: create new secret key)
DEBUG=False
ALLOWED_HOSTS=127.0.0.1 feeder.example.com
  • Initial database schema and migrate
python manage.py makemigrations
python manage.py migrate
python manage.py migrate --run-syncdb
  • Create superuser
python manage.py createsuperuser
  • Collect static files
python manage.py collectstatic
  • You can test out the application by running the following command:
python manage.py runserver 0.0.0.0:8000

Deployment

  • Create gunicorn systemd service files for production environment
sudo vi  /etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target

[Service]
Type=notify
User=user
Group=user
EnvironmentFile=/path/to/feeder_venv/feeder/.env/production.env
WorkingDirectory=/path/to/feeder_venv/feeder
ExecStart=/path/to/feeder_venv/bin/gunicorn --workers 3 --bind 0.0.0.0:8000 feeder.wsgi:application
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target
  • Create schedule jobs systemd service file for production environment

This is used to check RSS URLs from feed.ini file and fetch new feeds every 2 minutes

sudo vi  /etc/systemd/system/schedule_jobs.service
[Unit]
Description=Feederjobs daemon
After=network.target

[Service]
Type=Simple
User=user
Group=user
EnvironmentFile=/path/to/feeder_venv/feeder/.env/production.env
WorkingDirectory=/path/to/feeder_venv/feeder
ExecStart=/path/to/feeder_venv/bin/python manage.py startjobs 
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target
  • Start and enable gunicorn service
sudo systemctl start gunicorn.service
sudo systemctl enable gunicorn.service
  • Login to admin interface and create new category(Example: Tech)

  • Add new RSS URL to feed.ini file

vi  /path/to/feeder_venv/feeder/feed.ini
[EFF]
feed = https://www.eff.org/rss/updates.xml
link = https://www.eff.org
logo = https://www.eff.org/sites/all/themes/phoenix/images/logo-monogram.svg
category = Tech
  • Start and enable schedule jobs service
sudo systemctl start schedule_jobs.service
sudo systemctl enable schedule_jobs.service

Finally, you can test out the application by browsing to http://localhost:8000/

Notes

  • This is personal project. So It may have missing features.
  • You can create users and permissions for viewing and editing feeds via admin interface.(rssfeeder.view_feed)
  • Homepage shows the feeds in the default category. If category key doesn't exist or empty value in feed.ini section, it shows the feeds in the default category.
  • Four categories are Tech, Science, News and Videos hardcoded in the application 'url.py' file. But didn't create an object in categories for them. If you want to use them, you can create these categories in the admin interface.
  • You can add new categories in the admin interface. Also, you can add navbar.html file in the templates directory to customize the application.

feeder's People

Contributors

mofm avatar

Watchers

 avatar  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.