Skip to main content

Rune Framework

Project description


A framework based on Flask with auth, translations, celery and mail

Also, a sign of the script used by the Germans. More

Installation Instructions

I prefere to use virtual environments to keep everything clean and tidy. You can skip this step if you prefere it another way. You can also use other packages to create your virtual environment.

0. TL;DR

$ python3 -m venv venv --prompt rune
$ source venv/bin/activate
(rune) $ pip install -U pip wheel rune
(rune) $ flask core init -d
(rune) $ flask db init
(rune) $ flask db migrate
(rune) $ flask db upgrade
(rune) $ flask auth create-admins
(rune) $ flask run


Username: rune

Password: RUNE

1. Create a virtualenv

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

1.a. Optionally update pip and wheel

(rune) $ pip install -U pip wheel
Collecting pip
  Using cached pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
Collecting wheel
  Downloading wheel-0.36.1-py2.py3-none-any.whl (34 kB)
Installing collected packages: pip, wheel
  Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Uninstalling pip-20.0.2:
      Successfully uninstalled pip-20.0.2
Successfully installed pip-20.3.1 wheel-0.36.1

2. Install Rune and it's dependencies using pip

(rune) $ pip install rune

3. Set up the required boilerplate

Rune provides two command groups, that help you set up the applications quicker.

The first one is flask core init, with which you can create the config files to run the application.

The second one is flask auth create-ddic, which creates the ddic (dedicated) user.

(rune) $ flask --help

  A general utility script for Flask applications.

  Provides commands from Flask, extensions, and the application. Loads the
  application defined in the FLASK_APP environment variable, or from a file. Setting the FLASK_ENV environment variable to 'development'
  will enable debug mode.

    $ export
    $ export FLASK_ENV=development
    $ flask run

  --version  Show the flask version
  --help     Show this message and exit.

  auth    Rune A12n and A11n commands   <-- Rune Auth commands
  core    Rune Core commands            <-- Rune core commands
  db      Perform database migrations.
  routes  Show the routes for the app.
  run     Run a development server.
  shell   Run a shell in the app context.

3.1. Create the config files .env, .flaskenv, and rune.conf

The command flask core init has two optional flags to create configuration for development or testing purposes.

If no flag is passed it will create the configuration files for production.

(rune) $ flask core init --help
Usage: flask core init [OPTIONS]

  Create the initial env files to run Rune in production

  -t, --testing      Config for testing purposes
  -d, --development  Config for development purposes
  --help             Show this message and exit.

In this case we want to use the -d flag:

(rune) $ flask core init -d
Write to dev_rune.conf
Write to .env
Write to .flaskenv

3.2. Review the configuration

Review the newly created files and adjust them accordingly. The most important config keys, in the rune.conf file, you need to modify are:


RUNE_ADMINS will be used to create the first admin accounts. This users have super powers, as they will always have all permissions (installed or not) checked by the application.

4. Set Up the Database Migrations

(rune) $ flask db init
  Creating directory /home/xx/rune/migrations ...  done
  Creating directory /home/xx/rune/migrations/versions ...  done
  Generating /home/xx/rune/migrations/ ...  done
  Generating /home/xx/rune/migrations/ ...  done
  Generating /home/xx/rune/migrations/alembic.ini ...  done
  Generating /home/xx/rune/migrations/README ...  done
  Please edit configuration/connection/logging settings in '/home/xx/rune/migrations/alembic.ini' before proceeding.
(rune) $ flask db migrate -m "Initial migration"
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [] Detected added table 'auth_permissions'
INFO  [] Detected added table 'auth_roles'
INFO  [] Detected added table 'auth_users'
INFO  [] Detected added index 'ix_auth_users_email' on '['email']'
INFO  [] Detected added index 'ix_auth_users_token' on '['token']'
INFO  [] Detected added table 'auth_role_permissions'
INFO  [] Detected added table 'auth_user_preferences'
INFO  [] Detected added table 'auth_user_roles'
INFO  [] Detected added table 'main_messages'
  Generating /home/xx/rune/migrations/versions/ ...  done
(rune) $ flask db upgrade
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 3d2efd9a5a07, Initial migration

5. Create the Admin / Dedicated User

The tool creates the admin accounts as defined in the config file under te key RUNE_ADMINS.

Username is always set to the username part of the email address.

Password is always set to RUNE initially.

IMPORTANT!: On the first login you will be prompted to change it.

(rune) $ flask auth create-admins
Creating user
Created user

6. Run the Application

(rune) $ flask run
 * Serving Flask app "rune.wsgi" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 000-000-000

7. Log In and Browse


Username: rune

Password: RUNE

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Rune, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size Rune-0.3.2-py3-none-any.whl (2.3 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Rune-0.3.2.tar.gz (2.2 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page