3
0
Fork 0

feat: add install handler and related logic

- Mako is now a core dependency
- therefore no more 'email' extra
- add `get_install_handler()` method for app handler
- add `render_mako_template()` method for app handler
- add `resource_path()` method for app handler
- install handler thus far can:
  - confirm db connection
  - make appdir plus config/scripts:
    - wutta.conf
    - web.conf
    - upgrade.sh
  - upgrade db schema to create tables
  - from there web app can run, create admin user
- quick start docs now describe "generated code" option
This commit is contained in:
Lance Edgar 2024-11-24 10:13:56 -06:00
parent 49e77d7407
commit ceeff7e911
15 changed files with 1526 additions and 32 deletions

View file

@ -26,6 +26,7 @@
email.message
enum
exc
install
people
progress
testing

View file

@ -0,0 +1,6 @@
``wuttjamaican.install``
========================
.. automodule:: wuttjamaican.install
:members:

View file

@ -29,11 +29,13 @@ templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
intersphinx_mapping = {
'mako': ('https://docs.makotemplates.org/en/latest/', None),
'packaging': ('https://packaging.python.org/en/latest/', None),
'python': ('https://docs.python.org/3/', None),
'python-configuration': ('https://python-configuration.readthedocs.io/en/latest/', None),
'rattail': ('https://rattailproject.org/docs/rattail/', None),
'rattail-manual': ('https://rattailproject.org/docs/rattail-manual/', None),
'rich': ('https://rich.readthedocs.io/en/latest/', None),
'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),
'wutta-continuum': ('https://rattailproject.org/docs/wutta-continuum/', None),
}

View file

@ -145,6 +145,12 @@ Glossary
Similar to a "plugin" concept but only *one* handler may be used
for a given purpose. See also :doc:`narr/handlers/index`.
install handler
The :term:`handler` responsible for installing a new instance of
the :term:`app`.
Default is :class:`~wuttjamaican.install.InstallHandler`.
package
Generally refers to a proper Python package, i.e. a collection of
modules etc. which is installed via ``pip``. See also

View file

@ -2,6 +2,56 @@
Quick Start
===========
We have two varieties of "quick start" instructions:
* :ref:`quick-start-generated`
* :ref:`quick-start-manual`
.. _quick-start-generated:
From Generated Code
-------------------
Note that this section describes an app based on WuttaWeb (i.e. not
just WuttJamaican).
There is a tool to `generate new project code`_, on the Rattail Demo
site. Use it to download a ZIP file (e.g. ``poser.zip``) for your
project.
.. _generate new project code: https://demo.rattailproject.org/generated-projects/new/wutta
Make a local :term:`virtual environment` for your project.
Also make a new e.g. ``poser`` database in PostgreSQL (or MySQL).
Unzip and install the source code to the virtual environment, then run
the app installer:
.. code-block:: sh
mkdir -p ~/src
unzip ~/Downloads/poser.zip -d ~/src
cd /path/to/venv
bin/pip install -e ~/src/poser
bin/poser install
Assuming all goes well, you can run the web app with:
.. code-block:: sh
bin/pserve --reload file+ini:app/web.conf
And browse it at http://localhost:9080
.. _quick-start-manual:
From Scratch
------------
This shows the *minimum* use case, basically how to make/use the
:term:`config object` and :term:`app handler`.
@ -67,7 +117,7 @@ For more info see:
.. _db-setup:
Database Setup
==============
~~~~~~~~~~~~~~
You should already have the package installed (see previous section).