$ sudo apt-get install libass-dev libpq-dev postgresql \
build-essential redis-server redis-tools
$ sudo apt-get install python3-pip python3-dev
$ sudo pip3 install virtualenvwrapper
$ echo "export VIRTUALENVWRAPPER_PYTHON=`which python3.6`" >> ~/.bashrc
$ echo "alias v.activate=\"source $(which virtualenvwrapper.sh)\"" >> ~/.bashrc
$ source ~/.bashrc
$ v.activate
$ mkvirtualenv --python=$(which python3.6) --no-site-packages restfulpy-boilerplate
$ workon restfulpy-boilerplate
$ pip install -U pip setuptools wheel
So, your changes will affect instantly on the installed version
$ cd /path/to/workspace
$ git clone git@github.com:Carrene/nanohttp.git
$ cd nanohttp
$ pip install -e .
$ cd /path/to/workspace
$ git clone git@github.com:Carrene/restfulpy.git
$ cd restfulpy
$ pip install -e .
$ cd /path/to/workspace
$ git clone git@github.com:Carrene/restfulpy-boilerplate.git
$ cd restfulpy-boilerplate
$ pip install -e .
$ echo "eval \"\$(register-python-argcomplete restfulpy-boilerplate)\"" >> $VIRTUAL_ENV/bin/postactivate
$ deactivate && workon restfulpy-boilerplate
Create a file named ~/.config/restfulpy-boilerplate.yml
db:
url: postgresql://postgres:postgres@localhost/restfulpy_boilerplate_dev
test_url: postgresql://postgres:postgres@localhost/restfulpy_boilerplate_test
administrative_url: postgresql://postgres:postgres@localhost/postgres
$ restfulpy-boilerplate admin create-db --drop --basedata [or instead of --basedata, --mockup]
$ restfulpy-boilerplate [-c path/to/config.yml] admin drop-db
$ restfulpy-boilerplate [-c path/to/config.yml] admin create-db
Or, you can add --drop
to drop the previously created database: TAKE CARE ABOUT USING THAT
$ restfulpy-boilerplate [-c path/to/config.yml] admin create-db --drop
$ restfulpy-boilerplate [-c path/to/config.yml] admin setup-db
$ restfulpy-boilerplate migrate upgrade head
$ restfulpy-boilerplate [-c path/to/config.yml] admin base-data
$ restfulpy-boilerplate [-c path/to/config.yml] dev mockup-data
$ nosetests
- Using python builtin http server
$ restfulpy-boilerplate [-c path/to/config.yml] serve
- Gunicorn
$ ./gunicorn