Skip to content

shrmoud/schoolapp

Repository files navigation

Tandlr

Pltaform to teach and learn.

Prerequisites

Testing prerequisites

Usage

  1. Start up project.

    $ vagrant up
    $ fab environment:vagrant bootstrap
  2. Run server.

    $ fab environment:vagrant runserver
  3. Run worker.

    $ fab environment:vagrant runworker
  4. Run Daphne

    $ fab environment:vagrant rundaphne
  5. Run Celery

    $ fab environment:vagrant celery

Testing

  1. Install SpatiaLite if it isn't already installed.

  2. Create a virtualenvironment for the project (if it does not exists).

    $ mkvirtualenv tandlr
    $ pip install tox
  3. Activate the testing virtual environment.

    $ workon tandlr
  4. Run the proper command with tox.

    # Run the full test suite including the PEP8 linter.
    $ tox
    
    # Run only the test suite.
    $ tox -e py27-django
    
    # Run only the PEP8 linter.
    $ tox -e py27-flake8
    
    # Pass -r flag to recreate the virtual environment when requirements changes.
    $ tox -r
  5. Deactivate the virtual environment.

    $ deactivate
  6. Redirect the required domains to your localhost

    # /etc/hosts
    192.168.33.40       tandlr.local

Socket server usage

Connect

  • You need connect with a client socket to next URL.

    ws://domain.or.address:8888/notifications

Response

There are two types of answer that are returned by the sockets server.

  1. Mass notification with/without university

    {
        "target_action": "mass_notification",
        "message": "Message defined by admin"
    }
  2. Push notification

    /*
        target_id: Id of object modified.
    
        target_type: Class name of object modified, these can be:
            class
            mass_notification
            chat
            requestclassextensiontime
    
        target_action: Action done on object. For example, a class can be:
            rejected
            scheduled
            accepted
            on course
            ended
            pending
            canceled
    */
    {
        "target_id": "1",
        "target_type": "class",
        "target_action": "accepted"
    }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published