2016-02-08 23:12:09 +00:00
|
|
|
# officehours
|
|
|
|
|
|
|
|
A small experiment with Flask/Hy/Postgres. Doesn't do much yet.
|
|
|
|
|
|
|
|
## Initialization
|
|
|
|
|
|
|
|
Start with initializing the virtual environment and Postgres
|
|
|
|
|
2016-02-08 23:13:48 +00:00
|
|
|
# From the project directory:
|
2016-02-08 23:12:09 +00:00
|
|
|
$ virtualenv venv
|
|
|
|
$ . ./venv/bin/activate
|
|
|
|
$ pip install hy psycopg2 flask
|
|
|
|
$ sudo -u postgres psql postgres
|
2016-02-08 23:13:48 +00:00
|
|
|
> 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
|
2016-02-08 23:12:09 +00:00
|
|
|
|
|
|
|
Current functionality is demonstrated with:
|
|
|
|
|
2016-02-08 23:14:12 +00:00
|
|
|
$ psql -h localhost -U officehours -d officehours -f officehours.sql
|
|
|
|
$ hy play.hy
|