A very lightweight landing page with email signup and i18n. It uses Python Flask and sqlite.
This project was originally created for hellobudget.co
- Install packages
sudo apt install python-pip python-virtualenv python-dev - Create a python virtual environment:
virtualenv venv - Enter virtual environment:
. venv/bin/activate - Install python packages
pip install -r requirements.txt - Initialize database:
export FLASK_APP=landing.py && flask initdb - Run app in debug mode locally using
run.sh
Also See here: http://flask.pocoo.org/docs/0.11/installation/#installation
Leave virtual environment with $ deactivate
To initialise, do this:
- Extract texts:
pybabel extract --project landing-page --version 1 -F babel.cfg -o messages.pot . - Init German translation (only run this once):
pybabel init -i messages.pot -d translations -l de
If texts in source language have been changed or added:
pybabel extract --project landing-page --version 1 -F babel.cfg -o messages.pot .- Do translations
- Continue as below
If translations have been changed:
- Update
pybabel update -i messages.pot -d translations - Compile:
pybabel compile -d translations
- Install:
pip install peewee - Save to requirements
pip freeze > requirements.txt
- Here's a good tutorial.
- Check Apache error log if you see a 500 error
- Make sure the following files and directories are universally writable. They will need be written to by the
www-datausersignups.db/static/.webassets-cache//static/gen