Overhaul the quickstart guide, per rattail make-project
much better IMHO..
This commit is contained in:
parent
8d79bb25ba
commit
1aeebfcd63
|
@ -7,11 +7,6 @@ administrators. It assumes the reader is involved with the creation or
|
||||||
maintenance of a Poser/Rattail app. It tries to explain the concepts involved
|
maintenance of a Poser/Rattail app. It tries to explain the concepts involved
|
||||||
and hopefully tie them all together.
|
and hopefully tie them all together.
|
||||||
|
|
||||||
If you prefer step-by-step instructions for creating your own app then see also
|
|
||||||
the `Rattail Tutorial`_.
|
|
||||||
|
|
||||||
.. _Rattail Tutorial: https://rattailproject.org/docs/rattail-tutorial/
|
|
||||||
|
|
||||||
This manual is primarily organized around the possible "layers" of a
|
This manual is primarily organized around the possible "layers" of a
|
||||||
Poser/Rattail app:
|
Poser/Rattail app:
|
||||||
|
|
||||||
|
|
|
@ -4,37 +4,54 @@
|
||||||
Quick Start
|
Quick Start
|
||||||
===========
|
===========
|
||||||
|
|
||||||
This should get you up and running with a custom Rattail app within minutes.
|
This guide will create a new app/project. It assumes you already
|
||||||
(For a more thorough treatment see the `Rattail Tutorial`_.)
|
have, and are somewhat familiar with, Python and PostgreSQL (or
|
||||||
|
MySQL).
|
||||||
|
|
||||||
.. _Rattail Tutorial: https://rattailproject.org/docs/rattail-tutorial/
|
NB. the name "poser" is a stand-in, use whatever name you like for
|
||||||
|
your app/project.
|
||||||
|
|
||||||
Go to the `Rattail Demo`_ and generate a new "rattail" type project. You must
|
First make and activate a virtual environment::
|
||||||
login to get access; use "chuck" / "admin" for credentials.
|
|
||||||
|
|
||||||
.. _Rattail Demo: https://demo.rattailproject.org/generate-project
|
python3 -m venv /path/to/envs/poser
|
||||||
|
source /path/to/envs/poser/bin/activate
|
||||||
|
|
||||||
Name your project whatever you like. The default is "Okay-Then" so we'll
|
You may need to upgrade pip and friends, depending on the age of your
|
||||||
assume that here. You should download a zip file, e.g. ``okay-then.zip`` which
|
python::
|
||||||
contains the project files. Extract it somewhere convenient; we'll use
|
|
||||||
``~/src/okay-then``::
|
|
||||||
|
|
||||||
mkdir -p ~/src
|
python -m pip install -U pip setuptools wheel
|
||||||
unzip ~/Downloads/okay-then.zip -d ~/src
|
|
||||||
|
|
||||||
Your local PostgreSQL service should be available, and user (named ``rattail``)
|
Install the core Rattail package, with 'db' extra::
|
||||||
and DB (named ``okay-then``) created::
|
|
||||||
|
|
||||||
sudo apt install postgresql
|
pip install rattail[db]
|
||||||
sudo -u postgres createuser -P rattail
|
|
||||||
sudo -u postgres createdb -O rattail okay-then
|
|
||||||
|
|
||||||
Make and activate a virtual environment; e.g. ``/srv/envs/okay-then``::
|
Create the PostgreSQL user and DB::
|
||||||
|
|
||||||
mkdir -p /srv/envs
|
sudo -u postgres createuser -P poser
|
||||||
python -m venv /srv/envs/okay-then
|
sudo -u postgres createdb -O poser poser
|
||||||
source /srv/envs/okay-then/bin/activate
|
|
||||||
|
|
||||||
With the virtual environment active, run the development bootstrap script::
|
Or if using MySQL instead::
|
||||||
|
|
||||||
python ~/src/okay-then/dev/bootstrap.py
|
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.
|
||||||
|
|
Loading…
Reference in a new issue