Giter VIP home page Giter VIP logo

dreamjub's Introduction

DreamJUB

(Pronounced 'enPR: drēmhub, IPA(key): /dɹiːmhʌb/')

Jacobs Directory Exploration and Mapping Server written in Python 3.5

Build Status

Development Setup

  • Ensure you have Python 3.5 installed
  • Ensure you have bower installed: bower --version. In case bower is not installed, install it using npm install -g bower. If you don't have npm installed, you need to install npm and node.
  • create virtual environment: python3.5 -m virtualenv env. If you don't have virtualenv installed, run pip3 install virtualenv first.
  • Launch the environment: source env/bin/activate
  • Install the requirements: pip install -r requirements.txt
  • Migrate the database: python manage.py migrate
  • Fetch the polymer components: bower install
  • Run the server: python manage.py runserver
  • The project should now be deployed at localhost:8000
  • To serve media files in development, run a simple http server in the media_files directory:
    • python -m http.server 8080

Development

  • Upon modifying a database model, generate the migrations: python manage.py makemigrations and make sure you commit the migrations.
  • For adding frontend dependencies, prefer installing with bower (i.e. bower install package_name)

dreamjub's People

Contributors

tkw1536 avatar kuboschek avatar thunderboltsid avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar  avatar  avatar

dreamjub's Issues

LDAP Sync fails

When trying to sync student data from LDAP, the following error occurs

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/dreamjub-staging/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/srv/dreamjub-staging/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/dreamjub-staging/venv/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/dreamjub-staging/venv/lib/python3.5/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/srv/dreamjub-staging/dreamjub/dreamjub/management/commands/ldapsync.py", line 30, in handle
    models.Student.refresh_from_ldap(user, pwd)
  File "/srv/dreamjub-staging/dreamjub/dreamjub/models.py", line 224, in refresh_from_ldap
    if users in None:
TypeError: argument of type 'NoneType' is not iterable

LDAP Sync is broken

Running manage.py ldapsync fails with an ImportError. Even after fixing said error, more errors come up.

Expected Result:
Student instances are updated from LDAP in the local database

Actual Result:
ImportError

Steps to reproduce:
run manage.py ldapsync in the project root folder

Create Application Authorization View

When a user tries to use an app that uses our login, they'll have to grant permissions the first time they login. While Django OAuth toolkit provides a view and template for that, it is not material.

  • Write a custom allow.html template using Polymer elements
  • Subclass the authorization view as required

Make course data available as Django models

The jacobsdata module is already parsing course data from LDAP. This should be imported into Django models and possibly extended with some custom parsing to find all course appointments, instructors, rooms etc.

Fix pep8 warnings under login/

Running check_pep8.py gives:

./login/admin.py:1:1: F401 'django.contrib.admin' imported but unused
./login/backend.py:5:1: E302 expected 2 blank lines, found 1
./login/backend.py:14:1: W293 blank line contains whitespace
./login/backend.py:19:1: W293 blank line contains whitespace
./login/models.py:1:1: F401 'django.db.models' imported but unused
./login/tests.py:1:1: F401 'django.test.TestCase' imported but unused

Vagrant / Docker for developers using Windows

Since the development environment in Windows is radically different from that of Linux and OS X, we should have a vagrantfile / dockerfile for users who want to stick to a windows developer environment.

Add a PEP8 test to travis

Recently some of the PRs have violated PEP8 even though we have a script to check. We should add an appropriate test to our Travis tests.

Rate limit the login endpoint

Currently there is no limit to the number of login requests.

A solution to this issue limits login attempts within a certain time window by both user and IP.

Discussion: Widgets

The immediate goal for dreamjub is to provide authentication, and a RESTful API into student data.

In the long-term, a homepage for students will be provided. On this page, interchangeable, modifiable widgets will be used to provide commonly useful information at a glance, and also link to the respective app (if there is more information available). This will be hosted at https://jacobs.university

Because widget maintenance and development will be part of the respective app, there are certain issues that need to be addressed:

  • Security: How do we isolate widgets from one another, such that they only have access to their own information
  • Scope: Where does our widget specification end, what is the interface we provide?

This issue shall serve as a discussion forum for these points.

Exclude migrations from check_pep8.py

When I run check_pep8.py with existing migrations, it gives me a lot of E501 Line too long errors. Since migrations are auto-generated, we should just exclude the appropriate directory.

Login Links Marked as Used before Clicked

Login Links are occasionally are marked as used before the user can actually use the link to log in. This results in dreamjub displaying a general log-in error. @kuboschek speculated that this happens because e-mail clients try to pre-buffer the website thereby placing a GET request which uses the token. The login token could either only be marked as 'used' once the website actually loaded; or the login token system could be changed so that tokens become invalid after e.g. three minutes instead of after the first use.

I am not a contributing developer to this project, nor experienced with Django, and thus can't judge the proposed solutions' feasibility, nor if the actual problem is caused by the aforementioned.

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.