Git Product home page Git Product logo

refdeskstats's Introduction

Installation

Description

This is an application allowing the collection of reference desk statistics through a web application with Flask.

Requirements

This application requires:

  • Flask

    • Flask-Babel

    • Flask-Login

  • Python-LDAP

Simply pip-install them and you’ll be on your way out.

Database

The database used is PostgreSQL. The file schema.sql will have all of the SQL needed to generate the tables/permissions/views that the application demands.

Babel Install

Language translations for french are already included with the application, and should work out of the box. In the case they don’t:

pybabel compile -i messages.pot -d translations/

should be enough to fix it.

Secret Key

You’ll need to generate your own secret key to sign cookies. Generally, the easiest way to do this would be:

>>> import os
>>> os.urandom(24).encode('hex')

Which will give you a nice, long sequence of hex digits.

refdeskstats's People

Contributors

vtrlx avatar dbs avatar

Stargazers

 avatar John Fink avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

vtrlx

refdeskstats's Issues

Add authentication for data submission / editing pages

Right now anyone with the URL can submit / edit data, which isn't so great.

Consider the use of Flask-Login (https://pypi.python.org/pypi/Flask-Login) for a base level of authentication on the submission pages, with a session time of something like 4 hours. Then we can add in one more column to the refdesktstats table to keep track of who entered the data.

Flask-Login requires an authentication method; for testing purposes, you could start with a hardcoded username / password. Then when you have that working, add in something like Flask-ldap (http://flask-ldap.readthedocs.org/ -- but no MongoDB!) so that we can authenticate against Laurentian's LDAP server.

LU's LDAP auth attributes are as follows:

LDAP Host: 142.51.1.221
LDAP Port: 389
LDAP Domain: laurentian.ca
LDAP Base DN: OU=Empl,o=LUL
LDAP Profile Key: cn

(note: for testing purposes, you might need to swap "Empl" for "STD" to enable authenticating against student accounts)

schema.sql does not have complete permissions, references wrong table

Starting with a fresh database, one can see that the views at times reference the 'reftstats' table instead of the 'refdeskstats' table.

Also, assuming that one creates the database and schema as a superuser and wants a limited privilege user to only be able to query the views, then we need some GRANT SELECT statements for our target limited privilege user.

Verbose mode should default to 'false'

It's great to have debugging statements in the code, but not so great to have them running by default. Ideally you only enable verbose mode when you run into a problem, so it should be off by default.

Make phone column float to the right of the page, if we have space

Right now there's a lot of vertical scrolling required if someone wants to hit the submit button with the mouse, and on a widescreen the "Phone" column may effectively be hidden. It would be great to float it to the right so that on widescreens at the right resolution all of the columns will appear on one horzontal plane.

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.