Find a file
Russell Ballestrini 4142476f7e try it out.
modified:   make_post_sell/models/product.py
	modified:   make_post_sell/models/shop.py
	modified:   make_post_sell/models/user.py
	new file:   make_post_sell/scripts/alembic/versions/c263b4fba9e7_new_ux_columns.py
	deleted:    make_post_sell/static/css/alerts.css
	modified:   make_post_sell/static/css/common.css
	deleted:    make_post_sell/static/css/lib.css
	deleted:    make_post_sell/static/css/mps.css
	modified:   make_post_sell/templates/base.j2
	modified:   make_post_sell/templates/cart.j2
	modified:   make_post_sell/templates/product_edit.j2
	modified:   make_post_sell/templates/shop_settings.j2
	modified:   make_post_sell/templates/snippets/search.j2
	modified:   make_post_sell/templates/user_settings.j2
	modified:   make_post_sell/views/shop.py
	modified:   requirements.txt
2022-04-29 11:54:57 -04:00
make_post_sell try it out. 2022-04-29 11:54:57 -04:00
.gitignore Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
.gitlab-ci.yml Update .gitlab-ci.yml file 2022-01-10 20:07:05 +00:00
development.ini Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
journal.rst Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
Makefile Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
MANIFEST.in Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
pytest.ini Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
README.rst Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
requirements-dev.txt Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
requirements-prod.txt Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
requirements-test.txt Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
requirements.py3.txt Time to open the sauce : ) 2021-12-31 21:39:40 -05:00
requirements.txt try it out. 2022-04-29 11:54:57 -04:00
setup.py fix duplicate parameter key 2022-01-10 15:09:54 -05:00
test.ini Time to open the sauce : ) 2021-12-31 21:39:40 -05:00

Make Post Sell
==============

The `Make Post Sell <https://www.makepostsell.com>`_ monolith platform service.


Getting Started
---------------

Clone this repo and change your working directory to the checkout.

Create a Python virtual environment and install project dependencies:

.. code-block:: bash

 make dev

Load schema and default data into the database using a script,
we currently use sqlite3 as a development and test database:

.. code-block:: bash

 make init_db config=development.ini

Run a web application server with the project loaded:

.. code-block:: bash

 make serve

Open a 2nd shell and run a test SMTP server for intercepting OTP login uri's:

.. code-block:: bash

 make smtp

In a web browser navagate to http://127.0.0.1:6501/ and you should see the app.


Running Tests
-------------

We currently use `pytest`:

.. code-block:: bash

 make test


SQL Migrations
===============

If your deployment is brand new, you don't need to run any migrations.
You should however run this to stamp the database as ready:

.. code-block:: bash

 alembic -c development.ini stamp head

Otherwise, it should be safe to run this at anytime to catch your database up:

.. code-block:: bash

 alembic -c development.ini upgrade head

To look at the current revision and the history run these:

.. code-block:: bash

 alembic -c development.ini history
 alembic -c development.ini current

If you ever want to cut a new migration script, you can run this:

.. code-block:: bash

 alembic -c development.ini revision -m "Added email_id column to User table."

Then you can edit / modify the generated ``.py`` file with your changes.

You can also autogenerate a new migration script using `--autogenerate`.
Alembic will prepare a migration script by comparing the state of the
database with the state of the model:

.. code-block:: bash

  alembic -c development.ini revision --autogenerate -m "autogenerated indicies."

You should review the recommended migration script before `upgrade`.


misc
====

You may source the new Python virtual environment during development:

.. code-block:: bash

 # source env/bin/activate.fish
 . env/bin/activate