JimInCO / bishopric_tools

A set of tools to automate some of the common Bishopric tasks. Currently focused on organizing talks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bishopric Django Tools

A set of tools to automate some of the common Bishopric tasks. Currently focused on organizing talks.

https://travis-ci.com/JimInCO/bishopric_tools.svg?branch=master Built with Cookiecutter Django Black code style
License:MIT

Getting Started

Setting Up Development Environment

Make sure to have the following on your host:

First things first.

  1. Create a virtualenv:

    $ python3.7 -m venv .venv
    > python -m venv .venv
    
  2. Activate the virtualenv you have just created:

    $ source .venv/bin/activate
    > .venv\Scripts\activate
    
     .. note::
    
        Linux commands have a "$" as a pre-fix
        Windows commands have a ">" as a pre-fix
    
  3. Install development requirements:

    $ pip install -r requirements/local.txt
    $ pre-commit install
    
     .. note::
    
        the `pre-commit` exists in the generated project as default.
        for the details of `pre-commit`, follow the [site of pre-commit](https://pre-commit.com/).
    
  4. Create a new PostgreSQL database using createdb or pgAdmin4:

    $ createdb bishopric_tools -U postgres --password <password>
    

    Note

    if this is the first time a database is created on your machine you might need an initial PostgreSQL set up to allow local connections & set a password for the postgres user. The postgres documentation explains the syntax of the config file that you need to change.

  5. Set the environment variables for your database(s):

    $ export DATABASE_URL=postgres://postgres:<password>@127.0.0.1:5432/bishopric_tools
    > set DATABASE_URL=postgres://postgres:<password>@127.0.0.1:5432/bishopric_tools
    

Basic Commands

Setting Up Your Users

  • To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.

  • To create an superuser account, use this command:

    $ python manage.py createsuperuser
    

For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.

Type checks

Running type checks with mypy:

$ mypy bishopric_tools

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running tests with py.test

$ pytest

Live reloading and Sass CSS compilation

See the documentation on the cookiecutter-django page Live reloading and SASS compilation.

Deployment

The following details how to deploy this application.

Custom Bootstrap Compilation

The generated CSS is set up with automatic Bootstrap recompilation with variables of your choice. Bootstrap v4 is installed using npm and customised by tweaking your variables in static/sass/custom_bootstrap_vars.

You can find a list of available variables in the bootstrap source, or get explanations on them in the Bootstrap docs.

Bootstrap's javascript as well as its dependencies is concatenated into a single file: static/js/vendors.js.

About

A set of tools to automate some of the common Bishopric tasks. Currently focused on organizing talks.

License:MIT License


Languages

Language:Python 72.1%Language:HTML 21.6%Language:JavaScript 5.1%Language:CSS 1.1%