- distribution files
cp deploy/config.py.dist config.py
cp deploy/wsgi.py.dist wsgi.py
sudo cp dist/apache.conf.dist /etc/apache2/sites-available/<name>.conf
# edit the files appropriately
- virtual environment
virtualenv -p python3 local
. local/bin/activate
pip install Flask
pip install psycopg2
deactivate
- database
sudo adduser <user>
sudo su -l postgres
psql
create user <user> with superuser password '<pass>';
create database <db> owner <user>;
alter role <user> in database <db> set search_path to public,dbo,dbv,new,map,fnd;
alter database <db> set extra.secretkey to '<secretkey>';
su -l <user>
psql -d <db> < <script.sql>
- test api with curl
curl -X POST -d 'data=one' csci870.nydev.local/api/test
curl -X GET csci870.nydev.local/api/test
- check sequence numbers
select last_value from dbo.actor_id_seq;
select last_value from dbo.wap_id_seq;
- update sequence after restore
select setval('dbo.actor_id_seq', (select max(id) from dbo.actor));
select setval('dbo.wap_id_seq', (select max(id) from dbo.wap));