Skip to content

This repo is for the Techtonica website: techtonica.org

Notifications You must be signed in to change notification settings

shaun-scale/techtonica.org

 
 

Repository files navigation

Techtonica

This repo is for the Techtonica website, which is currently hosted on DreamHost.

Who

The audience of the website is made up of (potential) volunteers and sponsors. (Apprentices will be contacted via local organizations.)

What

We need to effectively communicate that Techtonica and its apprentices are worth supporting.

How

There should be a good understanding of how the program works with vetting, training, mentoring, and hiring.

Getting Started

This app uses Python 3.6; please stick to this version when doing development.

Install Pre-Commit Hooks

This project uses various pre-commit hooks to ensure code quality and formatting consistency.

  1. Install pre-commit globally.

  2. Install the project pre-commit hooks:

    pre-commit install -f --install-hooks

Running Locally

If you prefer using Docker, see instructions.

It is recommended you use a virtual environment tool to keep dependencies required by different projects separate. Learn more about Python virtual environments.

Install the project dependencies. In the project root run:

pip install -r dev.txt

Start the application's server:

FLASK_DEBUG=1 FLASK_APP=main_site.py flask run

Browse to http://localhost:5000.

Using Docker to Run Locally

First Time Using Docker?

  1. Download Docker Desktop
  2. cd into the folder that holds your techtonica.org repo
  3. Build your app: docker build --tag techtonica .
  4. Run your app: docker run techtonica

When there are updates to the Dockerfile, you will have to rebuild your app in order for those changes to take effect

For Docker Pros

To run app: docker run techtonica

To rebuild app: docker build --tag techtonica .

CSS / SCSS

Styling changes should be made to the Sass (.scss) files and then compiled to CSS using one of the following commands:

👷‍♀️ TODO: Document how install Sass.

sass static/sass/style.scss static/css/style.css
sass --watch static/sass/style.scss:static/css/style.css

Updating Dependencies

This project uses pip-tools to manage dependencies. If you need to add or remove a Python library dependency:

  1. Edit requirement.in

  2. Generate requirements.txt:

    pip-compile -U

Once the new library is used in the code base, you'll need to update the isort config to reflect third party library usage:

pre-commit run seed-isort-config -a --hook-stage manual

For development dependencies:

  1. Edit dev.in

  2. Generate dev.txt:

    pip-compile -U dev.in

Deployment to DreamHost

Initial Setup

  1. Follow the instructions in the Setting up and deploying Python Flask to Dreamhost blog post.

  2. Update package tools, while you're still operating in the virtual environment:

    pip install -U pip setuptools pip-tools

Updating the Site

  1. Log in via SSH using your SSH key.

  2. Change directory to the appropriate domain:

    cd techtonica.org

    or

    cd staging.techtonica.org
  3. Activate the virtual envrionment:

    . bin/activate
  4. Change to the source directory:

    cd techtonica
  5. Use the usual git commands to get the latest code or check out another branch.

  6. Update requirements:

    pip-sync
  7. "Restart" the passenger process:

    cd .. && touch tmp/restart.txt

Using Docker to Run Locally

First Time Using Docker?

  1. Download Docker Desktop
  2. cd into the folder that holds your techtonica.org repo
  3. Build your app: docker build --tag techtonica .
  4. Run your app: docker run techtonica

When there are updates to the Dockerfile, you will have to rebuild your app in order for those changes to take effect

For Docker Pros

To run app: docker run techtonica

To rebuild app: docker build --tag techtonica .

About

This repo is for the Techtonica website: techtonica.org

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 88.8%
  • CSS 5.7%
  • Python 4.3%
  • JavaScript 1.1%
  • Other 0.1%