This repo is for the Techtonica website, which is currently hosted on DreamHost.
The audience of the website is made up of (potential) volunteers and sponsors. (Apprentices will be contacted via local organizations.)
We need to effectively communicate that Techtonica and its apprentices are worth supporting.
There should be a good understanding of how the program works with vetting, training, mentoring, and hiring.
This app uses Python 3.6; please stick to this version when doing development.
This project uses various pre-commit hooks to ensure code quality and formatting consistency.
-
Install pre-commit
globally. -
Install the project pre-commit hooks:
pre-commit install -f --install-hooks
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.
- Download Docker Desktop
cd
into the folder that holds your techtonica.org repo- Build your app:
docker build --tag techtonica .
- 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
To run app: docker run techtonica
To rebuild app: docker build --tag techtonica .
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
This project uses pip-tools to manage dependencies. If you need to add or remove a Python library dependency:
-
Edit
requirement.in
-
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:
-
Edit
dev.in
-
Generate
dev.txt
:pip-compile -U dev.in
-
Follow the instructions in the Setting up and deploying Python Flask to Dreamhost blog post.
-
Update package tools, while you're still operating in the virtual environment:
pip install -U pip setuptools pip-tools
-
Log in via SSH using your SSH key.
-
Change directory to the appropriate domain:
cd techtonica.org
or
cd staging.techtonica.org
-
Activate the virtual envrionment:
. bin/activate
-
Change to the source directory:
cd techtonica
-
Use the usual
git
commands to get the latest code or check out another branch. -
Update requirements:
pip-sync
-
"Restart" the passenger process:
cd .. && touch tmp/restart.txt
- Download Docker Desktop
cd
into the folder that holds your techtonica.org repo- Build your app:
docker build --tag techtonica .
- 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
To run app: docker run techtonica
To rebuild app: docker build --tag techtonica .