stephenmkbrady / django_matrix_client_basic

Django matrix client app with absolutely no javascript and CSS3. It'll run on a feature phone browser using opera 4.4
MIT License
0 stars 0 forks source link

django_matrix_client_basic

Django matrix client app with absolutely no javascript.

Description

The current matrix clients available are many and varied. The web version looks good but is frontend heavy and not designed for older devices or even newer devices with limited resources. Some of the lighter native clients are great but are locked to win, mac or linux. This client just needs a very basic browser and internet access.

Features

Live demo version

Matrix Client Running On Heroku (First load might be slow as you wake the heroku hobby dyno up.)

Development Environment Guide

Required: Python 3 postgresql installed, configured and running as per your OS __heroku_cli installed__ The Arch Linux postgresql setup guide is great

Installation

  1. $ mkdir venv1 Note: call this whatever you want, the idea is to keep your packages and env bins separate from the code
  2. $ python -m venv venv1/
  3. $ source venv1/bin/activate Note: Activating your venv differs between environment, read
  4. $ cd venv1/
  5. $ git clone https://github.com/stephenmkbrady/django_matrix_client_basic.git
  6. $ cd django_matrix_client_basic/
  7. $ pip install pipenv
  8. $ pipenv install Everything is installed

Note: pipenv can be used to create and activate the virtualenv aswell.

Database Setup

TL;DR:

Environment Variables Setup

For testing localling in linux bash: export SECRET_KEY="you_secret_unique_key_not_to_be_shared_and_strong" Choose a secret key based on the docs export DB_PASSWORD="the_password_you_used_when_creating_pmatrix_client_user" For runnin on heroku: Add the same DB_PASSWORD and SECRET_KEY as config vars

Running Locally

First run (and if/when you change the model): $ python manage.py makemigrations $ python manage.py migrate $ python manage.py collectstatic

To run the server: $ python manage.py runserver or $ gunicorn pymatrix_client.wsgi --timeout 120 Note: matrix.org is slow to respond as it's under heavy load as it becomes popular, so extending the timeout seems to be required here.

Open a web browser at: http://127.0.0.1:8000

Note: You can also run it locally using heroku_cli

Running Tests
  1. Add the following to your environment variables:

$ export TEST_USER="your_test_user_name_registered_with_matrix_server"

$ export TEST_PASS="your_test_user_names_pass"

$ export TEST_ROOM='#your_room:the_matrix_server_with_the.room'

$ python manage.py test

Deploying to Heroku

It's pretty straight forward from here. If you're unfamiliar with heroku, maybe follow this guide in a seperate folder before deploying this or any app. If you've deployed ruby or nodejs apps then you should be ok. Extra relevent reading

Note: The Procfile, Pipfile, Pipfile.lock and requirements.txt do not need to be modified for this.

__1. IMPORTANT: Open pymatrix_client/settings.py and set "DEBUG = False" from "DEBUG = True"__

  1. heroku create
  2. heroku addons:add heroku-postgresql
  3. git push heroku master
  4. heroku ps:scale web=1
  5. heroku open

TODO

Major Tasks in order of priority