2021-01-19 12:50:23 -06:00
|
|
|
|
|
|
|
.. highlight:: sh
|
|
|
|
|
|
|
|
Quick Start
|
|
|
|
===========
|
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
This guide will create a new app/project. It assumes you already
|
|
|
|
have, and are somewhat familiar with, Python and PostgreSQL (or
|
|
|
|
MySQL).
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
NB. the name "poser" is a stand-in, use whatever name you like for
|
|
|
|
your app/project.
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
First make and activate a virtual environment::
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
python3 -m venv /path/to/envs/poser
|
|
|
|
source /path/to/envs/poser/bin/activate
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
You may need to upgrade pip and friends, depending on the age of your
|
|
|
|
python::
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
python -m pip install -U pip setuptools wheel
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
Install the core Rattail package, with 'db' extra::
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
pip install rattail[db]
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
Create the PostgreSQL user and DB::
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
sudo -u postgres createuser -P poser
|
|
|
|
sudo -u postgres createdb -O poser poser
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
Or if using MySQL instead::
|
2021-01-19 12:50:23 -06:00
|
|
|
|
2023-01-02 10:10:59 -06:00
|
|
|
sudo mysql -e "create user poser@localhost"
|
|
|
|
sudo mysql -e "alter user poser@localhost identified by 'THEPASSWORD'"
|
|
|
|
sudo mysqladmin create poser
|
|
|
|
sudo mysql -e "grant all on poser.* to poser@localhost"
|
|
|
|
|
|
|
|
Make your app project::
|
|
|
|
|
|
|
|
rattail -n make-project /path/to/src/poser
|
|
|
|
|
|
|
|
Your project comes with its own command, to install and configure a
|
|
|
|
new app instance::
|
|
|
|
|
|
|
|
cd /path/to/envs/poser
|
|
|
|
bin/poser -n install
|
|
|
|
|
|
|
|
You should now be able to run the web app::
|
|
|
|
|
|
|
|
cd /path/to/envs/poser
|
|
|
|
bin/pserve --reload file+ini:app/web.conf
|
|
|
|
|
|
|
|
By default you can browse it at http://localhost:9080
|
|
|
|
|
|
|
|
Don't forget to ``git commit`` the project etc.
|