Coder Social home page Coder Social logo

digital-signage's Introduction

Dairy Digital Signage

This project is a web-based digital signange app, running on Django and Apache with PostgreSQL. It is a fork of https://github.com/jbittel/django-signage and uses the BSD-3 License.

Features

  • Upload media to an online database.
  • Display media in an automatically rotating slideshow format.
  • Manage serveral displays at once, each able to show different slides.
  • Set slides to enable and disable at certain times.
  • Set slides weights so that they are displayed in a desired order.

Installation Guide

Linux Container's Environment

  • Ubuntu 22.04
  • Python 3.10.12
  • Django 5.0

Install prerequisites for Ubuntu

1. Install the latest stable version of Git first if it does not exist

# https://git-scm.com/download/linux
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt update
$ sudo apt install git

2. Clone this repository

$ git clone https://github.com/UBC-LFS/digital-signage

3. Install the python3 virtual environment and activate it

$ sudo apt update
$ sudo apt install python3-venv

$ python3 -m venv venv
$ source venv/bin/activate

4. Install pip3

$ sudo apt update
$ sudo apt install python3-pip
$ pip3 install --upgrade pip

5. Install requirements

$ cd digital-signage
$ pip3 install -r requirements.txt

# errors might occur in some packages, then install the following packages
$ sudo apt-get install python3-setuptools python3-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl

Summary of Deployment

  1. Rename digital_signage/settings.py.example to digital_signage/settings.py

  2. Clone this Github repository

$ git clone https://github.com/UBC-LFS/digital-signage
  1. Install requirement dependencies
$ pip install -r requirements.txt
  1. Set Environment Variables in your machine:
ENGINE = os.environ["DAIRY_SIGNAGE_DB_ENGINE"]
NAME = os.environ["DAIRY_SIGNAGE_DB_NAME"]
USER = os.environ["DAIRY_SIGNAGE_DB_USERNAME"]
PASSWORD = os.environ["DAIRY_SIGNAGE_DB_PASSWORD"]
HOST = os.environ["DAIRY_SIGNAGE_DB_HOST"]
PORT = os.environ["DAIRY_SIGNAGE_DB_PORT"]

SECRET_KEY = os.environ["DAIRY_SIGNAGE_SECRET_KEY"]
  1. Switch DEBUG to False in a settings.py file
DEBUG = False
  1. Make sure there is a Media root directory to store uploaded files
MEDIA_ROOT = 'your_media_root'
  1. Add your allowed_hosts in settings.py
ALLOWED_HOSTS = ['YOUR_HOST']
  1. Create staticfiles in your directory
$ python manage.py collectstatic --noinput

# References
# https://docs.djangoproject.com/en/2.2/howto/static-files/
# https://devcenter.heroku.com/articles/django-assets
# https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Deployment
  1. Create a database in Postgresql

  2. Create database tables, and migrate

$ python manage.py migrate
  1. Load data for local testing
TBD
  1. Update settings.json and advanced_settings.json files in the saml folder

  2. See a deployment checklist and change your settings

$ python manage.py check --deploy


# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# CSRF_COOKIE_SECURE = True
# SESSION_COOKIE_SECURE = True
# SECURE_BROWSER_XSS_FILTER = True
# SECURE_CONTENT_TYPE_NOSNIFF = True
# SECURE_SSL_REDIRECT = True
# X_FRAME_OPTIONS = 'DENY'
  1. Now, it's good to go. Run this web application in your production!
$ python manage.py runserver
  1. Timezone in settings.py https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# Choose the timezone where you live
TIME_ZONE = 'America/Vancouver'
  1. Test
TBD

Login locally

  1. Create a superuser
# Reference: https://docs.djangoproject.com/en/2.2/topics/auth/default/
$ python manage.py createsuperuser --username=joe [email protected]
  1. Run this app
$ python manage.py runserver

For scheduling tasks
$ python manage.py runserver --noreload

  1. If you would like to log in through the local login, please change LOCAL_LOGIN to True in settings.py.
LOCAL_LOGIN=True

Open a new window with an URL http://localhost:8000/accounts/local_login/

Upgrade Django

pip install --upgrade django==new_version (e.g., 2.2.19)

Happy coding! Thank you.

digital-signage's People

Contributors

aydenthekinch avatar exponentian avatar

Watchers

 avatar  avatar

Forkers

tocasoft

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.