Experiment with Hy, Flask, and Postgres. #incomplete #notserious
Go to file
Elf M. Sternberg 5d8009bf31 [★] Acheivement Unlocked: Serving static content with Flask.
[★] Acheivement Unlocked: Generating static content from HAML.
[★] Achievement Unlocked: Building HAML from a Makefile.

I used to use Cakefiles for this sort of thing.  Man, I was an idiot
once upon a time.  Cake and Grunt and Gulp and all the rest are
task runners, not dependency managers, and will Rebuild The World
every time.
2016-02-13 09:13:25 -08:00
notes [★] Acheivement Unlocked: Serving static content with Flask. 2016-02-13 09:13:25 -08:00
source [★] Acheivement Unlocked: Serving static content with Flask. 2016-02-13 09:13:25 -08:00
.gitignore [★] Acheivement Unlocked: Serving static content with Flask. 2016-02-13 09:13:25 -08:00
LICENSE Doin' the Github Thing. 2016-02-08 15:12:09 -08:00
Makefile [★] Acheivement Unlocked: Serving static content with Flask. 2016-02-13 09:13:25 -08:00
README.md [doc] Blocking out the second code example. 2016-02-08 15:14:12 -08:00
main.hy [★] Acheivement Unlocked: Serving static content with Flask. 2016-02-13 09:13:25 -08:00
officehours.sql [feat] The ability to get a list of all allocated appointments and office hours is up. 2016-02-08 20:14:24 -08:00
play.hy A few updates. 2016-02-08 15:09:08 -08:00

README.md

officehours

A small experiment with Flask/Hy/Postgres. Doesn't do much yet.

Initialization

Start with initializing the virtual environment and Postgres

# From the project directory:
$ virtualenv venv
$ . ./venv/bin/activate
$ pip install hy psycopg2 flask
$ sudo -u postgres psql postgres
> CREATE DATABASE officehours;
> CREATE USER officehours;
> ALTER USER officehours WITH UNENCRYPTED PASSWORD '<password>';
> ALTER USER officehours LOGIN;
> GRANT ALL PRIVILEGES ON DATABASE officehours TO officehours;
> \CONNECT officehours;
> CREATE EXTENSION citext; 
> CREATE EXTENSION btree_gist; 
> CREATE EXTENSION plv8; 
> ^d

Current functionality is demonstrated with:

$ psql -h localhost -U officehours -d officehours -f officehours.sql
$ hy play.hy