Flask app for rockpack web services and content admin.
Run dev server with:
python2.7 manage.py runserver
cd mainsite
virtualenv --system-site-packages env
(see virtualenv usage). env/bin/activate
pip install -r requirements.txt -r requirements-dev.txt
(see pip usage)- Create local configuration file:
echo -e "DEBUG = True\nDATABASE_URL = 'sqlite:///rockpack.db'" >rockpack/mainsite/settings/local.py
python2.7 manage.py syncdb
python2.7 manage.py runserver
curl http://127.0.0.1:5000/ws/
Cryptography package installation error: raise ffiplatform.VerificationError(error)
Possible fix: http://chriskief.com/2014/03/25/installing-cryptography-via-pip-with-macports-or-homebrew/
sudo env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/opt/local/lib" CFLAGS="-I/opt/local/include" pip install cryptography
Syncdb Response error: ImportError: cannot import name Response
Possible fix: joelverhagen/flask-rauth#4
easy_install rauth==0.4.17
File not found error: flask OSError: [Errno 2] No such file or directory
Possible fix: install less and coffeescript via npm
sudo npm install -g less
sudo npm install -g coffee-script
-
Install & start postgres server (version 9)
-
sudo -u postgres createdb rockpack
-
Load db dump from s3:
s3cmd get s3://backup.dev.rockpack.com/postgres/rockpack/2013-09-03T15:42:30.792652.sql.gz - | zcat | psql rockpack
-
echo "DATABASE_URL = 'postgresql:///rockpack'" >>rockpack/mainsite/settings/local.py
-
Update schema:
alembic upgrade head
-
Install & start ElasticSearch (version 0.90)
-
echo "ELASTICSEARCH_URL = 'http://localhost:9200'" >>rockpack/mainsite/settings/local.py
-
python2.7 manage.py init_es
-
python2.7 manage.py import_to_es
Warning: will take a while!
- Create ssh tunnels:
ssh -L 45432:localhost:5432 -L 49200:es1:9200 -N dev.rockpack.com
- Update config:
echo -e "DATABASE_URL = 'postgresql://mainsite:mainsite@localhost:45432/rockpack'\nELASTICSEARCH_URL = 'http://localhost:49200'" >>rockpack/mainsite/settings/local.py
Run unit tests with pytest
py.test -x
To build rpm:
python2.7 setup.py rpm