make-post-sell 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- make_post_sell-1.0.0/MANIFEST.in +2 -0
- make_post_sell-1.0.0/PKG-INFO +200 -0
- make_post_sell-1.0.0/README.rst +170 -0
- make_post_sell-1.0.0/development.ini +131 -0
- make_post_sell-1.0.0/journal.rst +462 -0
- make_post_sell-1.0.0/make_post_sell/__init__.py +125 -0
- make_post_sell-1.0.0/make_post_sell/config_jinja2.py +5 -0
- make_post_sell-1.0.0/make_post_sell/lib/__init__.py +0 -0
- make_post_sell-1.0.0/make_post_sell/lib/currency.py +39 -0
- make_post_sell-1.0.0/make_post_sell/lib/hex_color.py +43 -0
- make_post_sell-1.0.0/make_post_sell/lib/mail.py +286 -0
- make_post_sell-1.0.0/make_post_sell/lib/mail_messages.py +200 -0
- make_post_sell-1.0.0/make_post_sell/lib/phone_numbers.py +23 -0
- make_post_sell-1.0.0/make_post_sell/lib/render.py +32 -0
- make_post_sell-1.0.0/make_post_sell/lib/sanitize_html.py +219 -0
- make_post_sell-1.0.0/make_post_sell/lib/time_funcs.py +12 -0
- make_post_sell-1.0.0/make_post_sell/lib/uuid_validation.py +27 -0
- make_post_sell-1.0.0/make_post_sell/models/__init__.py +94 -0
- make_post_sell-1.0.0/make_post_sell/models/cart.py +491 -0
- make_post_sell-1.0.0/make_post_sell/models/cart_coupon.py +33 -0
- make_post_sell-1.0.0/make_post_sell/models/coupon.py +223 -0
- make_post_sell-1.0.0/make_post_sell/models/coupon_redemption.py +34 -0
- make_post_sell-1.0.0/make_post_sell/models/inventory.py +50 -0
- make_post_sell-1.0.0/make_post_sell/models/invoice.py +236 -0
- make_post_sell-1.0.0/make_post_sell/models/market.py +10 -0
- make_post_sell-1.0.0/make_post_sell/models/meta.py +196 -0
- make_post_sell-1.0.0/make_post_sell/models/price.py +31 -0
- make_post_sell-1.0.0/make_post_sell/models/product.py +561 -0
- make_post_sell-1.0.0/make_post_sell/models/shop.py +415 -0
- make_post_sell-1.0.0/make_post_sell/models/shop_location.py +88 -0
- make_post_sell-1.0.0/make_post_sell/models/shop_search_request.py +35 -0
- make_post_sell-1.0.0/make_post_sell/models/stripe_user_shop.py +79 -0
- make_post_sell-1.0.0/make_post_sell/models/user.py +317 -0
- make_post_sell-1.0.0/make_post_sell/models/user_address.py +29 -0
- make_post_sell-1.0.0/make_post_sell/models/user_product.py +36 -0
- make_post_sell-1.0.0/make_post_sell/models/user_shop.py +56 -0
- make_post_sell-1.0.0/make_post_sell/request_methods.py +198 -0
- make_post_sell-1.0.0/make_post_sell/routes.py +134 -0
- make_post_sell-1.0.0/make_post_sell/scripts/__init__.py +1 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/env.py +77 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/script.py.mako +26 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/03292288a132_role_id_to_user_shop_table.py +30 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/1275752bc491_shop_updated_timestamp.py +24 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/15751f5d7a03_add_active_cart_total_in_cents_to_user_.py +28 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/1b3ecdde9e65_handling_options.py +36 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/201924e6306f_add_shop_id_to_cart.py +37 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/24662905655f_create_new_active_shop_id_column_on_.py +26 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/3e1e70bfe89d_google_analytics_id.py +24 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/4d9da43b0e86_product_visibility_column.py +27 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/5c40dfb56179_shop_ribbon_columns.py +28 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/6da97f2f913f_add_updated_timestamp_to_cart.py +28 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/7217f39a20a8_product_file_bytes.py +28 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/96f851cbab01_terms_and_privacy.py +30 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/aad3d454a6f4_shop_logo_banner_boolean.py +30 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/ab7338eaedf1_add_price_in_cents_column.py +24 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/af28cc35ed6f_product_bundles.py +34 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/b0d5604d9255_add_active_cart_count_to_user_table.py +28 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/b8be6cd51cbd_stripe_shop_user_active_card_id.py +27 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/bfc4195a7f56_product_is_sellable_coluumn.py +26 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/c263b4fba9e7_new_ux_columns.py +30 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/c4d5566ec87d_coupon_stackable_and_couponredemption.py +42 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/cc6211ec360e_physical_products_shop_locations_and_.py +61 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/cdad5c220c39_plausible_domain_name_column_on_shop.py +24 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/d38d649cb682_address_migration.py +31 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/ddfbd6d96915_shop_location_rates_and_hours.py +46 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/e12bbe39d87e_cart_coupon_table.py +40 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/e6ac162d096f_password_attempt_throttling.py +26 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/eadd0d69e133_shop_ribbon_text_color.py +24 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/f3aa57777025_coupon_table.py +45 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/f882f2255cd1_add_stripe_secret_and_public_key_to_shop.py +27 -0
- make_post_sell-1.0.0/make_post_sell/scripts/alembic/versions/fd9f7e2f2b78_user_full_name.py +28 -0
- make_post_sell-1.0.0/make_post_sell/scripts/initialize_db.py +77 -0
- make_post_sell-1.0.0/make_post_sell/scripts/pshell.py +13 -0
- make_post_sell-1.0.0/make_post_sell/static/css/common.css +883 -0
- make_post_sell-1.0.0/make_post_sell/static/favicon.ico +0 -0
- make_post_sell-1.0.0/make_post_sell/static/js/custom.js +30 -0
- make_post_sell-1.0.0/make_post_sell/static/js/jquery-3.6.0.min.js +3 -0
- make_post_sell-1.0.0/make_post_sell/static/js/jquery.min.js +3 -0
- make_post_sell-1.0.0/make_post_sell/static/makepostsell-3.png +0 -0
- make_post_sell-1.0.0/make_post_sell/static/makepostsell.png +0 -0
- make_post_sell-1.0.0/make_post_sell/static/memopoly.png +0 -0
- make_post_sell-1.0.0/make_post_sell/static/mps.png +0 -0
- make_post_sell-1.0.0/make_post_sell/templates/actions_new.j2 +41 -0
- make_post_sell-1.0.0/make_post_sell/templates/actions_view.j2 +51 -0
- make_post_sell-1.0.0/make_post_sell/templates/base.j2 +126 -0
- make_post_sell-1.0.0/make_post_sell/templates/billing.j2 +49 -0
- make_post_sell-1.0.0/make_post_sell/templates/cart.j2 +262 -0
- make_post_sell-1.0.0/make_post_sell/templates/cart_checkout.j2 +47 -0
- make_post_sell-1.0.0/make_post_sell/templates/carts.j2 +20 -0
- make_post_sell-1.0.0/make_post_sell/templates/content.j2 +85 -0
- make_post_sell-1.0.0/make_post_sell/templates/content_new.j2 +66 -0
- make_post_sell-1.0.0/make_post_sell/templates/coupon.j2 +81 -0
- make_post_sell-1.0.0/make_post_sell/templates/coupon_new.j2 +159 -0
- make_post_sell-1.0.0/make_post_sell/templates/coupons.j2 +66 -0
- make_post_sell-1.0.0/make_post_sell/templates/home.j2 +66 -0
- make_post_sell-1.0.0/make_post_sell/templates/invoice.j2 +35 -0
- make_post_sell-1.0.0/make_post_sell/templates/join-or-log-in.j2 +40 -0
- make_post_sell-1.0.0/make_post_sell/templates/markup_editor.j2 +38 -0
- make_post_sell-1.0.0/make_post_sell/templates/markup_renderer.j2 +19 -0
- make_post_sell-1.0.0/make_post_sell/templates/product.j2 +150 -0
- make_post_sell-1.0.0/make_post_sell/templates/product_edit.j2 +236 -0
- make_post_sell-1.0.0/make_post_sell/templates/product_new.j2 +110 -0
- make_post_sell-1.0.0/make_post_sell/templates/sales.j2 +26 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop.j2 +30 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop_about.j2 +44 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop_location_form.j2 +210 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop_locations.j2 +28 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop_new.j2 +68 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop_products.j2 +35 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop_settings.j2 +315 -0
- make_post_sell-1.0.0/make_post_sell/templates/shop_users.j2 +105 -0
- make_post_sell-1.0.0/make_post_sell/templates/shops.j2 +28 -0
- make_post_sell-1.0.0/make_post_sell/templates/snippets/analytics.j2 +15 -0
- make_post_sell-1.0.0/make_post_sell/templates/snippets/csrf.j2 +3 -0
- make_post_sell-1.0.0/make_post_sell/templates/snippets/flash-alerts.j2 +16 -0
- make_post_sell-1.0.0/make_post_sell/templates/snippets/optional-javascript.j2 +2 -0
- make_post_sell-1.0.0/make_post_sell/templates/snippets/ribbon.j2 +33 -0
- make_post_sell-1.0.0/make_post_sell/templates/snippets/search.j2 +25 -0
- make_post_sell-1.0.0/make_post_sell/templates/snippets/stripe.j2 +114 -0
- make_post_sell-1.0.0/make_post_sell/templates/update-card.j2 +32 -0
- make_post_sell-1.0.0/make_post_sell/templates/user_addresses.j2 +70 -0
- make_post_sell-1.0.0/make_post_sell/templates/user_purchases.j2 +55 -0
- make_post_sell-1.0.0/make_post_sell/templates/user_settings.j2 +81 -0
- make_post_sell-1.0.0/make_post_sell/templates/verification-challenge.j2 +27 -0
- make_post_sell-1.0.0/make_post_sell/tests/__init__.py +0 -0
- make_post_sell-1.0.0/make_post_sell/tests/test_functional.py +646 -0
- make_post_sell-1.0.0/make_post_sell/tests/test_models.py +159 -0
- make_post_sell-1.0.0/make_post_sell/tests/test_sanitize_html.py +56 -0
- make_post_sell-1.0.0/make_post_sell/views/__init__.py +108 -0
- make_post_sell-1.0.0/make_post_sell/views/actions.py +15 -0
- make_post_sell-1.0.0/make_post_sell/views/authentication.py +123 -0
- make_post_sell-1.0.0/make_post_sell/views/billing.py +115 -0
- make_post_sell-1.0.0/make_post_sell/views/cart.py +568 -0
- make_post_sell-1.0.0/make_post_sell/views/content.py +72 -0
- make_post_sell-1.0.0/make_post_sell/views/coupon.py +184 -0
- make_post_sell-1.0.0/make_post_sell/views/invoice.py +28 -0
- make_post_sell-1.0.0/make_post_sell/views/misc.py +75 -0
- make_post_sell-1.0.0/make_post_sell/views/product.py +491 -0
- make_post_sell-1.0.0/make_post_sell/views/sales.py +12 -0
- make_post_sell-1.0.0/make_post_sell/views/shop.py +671 -0
- make_post_sell-1.0.0/make_post_sell/views/shop_location.py +209 -0
- make_post_sell-1.0.0/make_post_sell/views/user.py +136 -0
- make_post_sell-1.0.0/make_post_sell.egg-info/PKG-INFO +200 -0
- make_post_sell-1.0.0/make_post_sell.egg-info/SOURCES.txt +156 -0
- make_post_sell-1.0.0/make_post_sell.egg-info/dependency_links.txt +1 -0
- make_post_sell-1.0.0/make_post_sell.egg-info/entry_points.txt +6 -0
- make_post_sell-1.0.0/make_post_sell.egg-info/not-zip-safe +1 -0
- make_post_sell-1.0.0/make_post_sell.egg-info/requires.txt +43 -0
- make_post_sell-1.0.0/make_post_sell.egg-info/top_level.txt +1 -0
- make_post_sell-1.0.0/pytest.ini +3 -0
- make_post_sell-1.0.0/requirements-dev.txt +6 -0
- make_post_sell-1.0.0/requirements-prod.txt +5 -0
- make_post_sell-1.0.0/requirements-test.txt +7 -0
- make_post_sell-1.0.0/requirements.py3.txt +53 -0
- make_post_sell-1.0.0/requirements.txt +58 -0
- make_post_sell-1.0.0/setup.cfg +4 -0
- make_post_sell-1.0.0/setup.py +70 -0
- make_post_sell-1.0.0/test.ini +75 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: make_post_sell
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Make Post Sell
|
|
5
|
+
Home-page: https://www.makepostsell.com
|
|
6
|
+
Author: Russell Ballestrini
|
|
7
|
+
Author-email: russell@ballestrini.net
|
|
8
|
+
License: UNKNOWN
|
|
9
|
+
Keywords: make post sell web pyramid pylons ecommerce digital downloads physical goods content marketing youtube alternative
|
|
10
|
+
Platform: UNKNOWN
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python
|
|
22
|
+
Classifier: Framework :: Pyramid
|
|
23
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Provides-Extra: prod
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
|
|
29
|
+
Make Post Sell
|
|
30
|
+
==============
|
|
31
|
+
|
|
32
|
+
The `Make Post Sell <https://www.makepostsell.com>`_ monolith platform service.
|
|
33
|
+
|
|
34
|
+
You can use the SaaS or self-host!
|
|
35
|
+
|
|
36
|
+
Our `blog acts as our user guide <https://blog.makepostsell.com/>`_ & also uses ``make_post_sell``!
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
Quick Start: Operating a Server with PyPI or Source Code
|
|
40
|
+
==========================================================
|
|
41
|
+
|
|
42
|
+
Before you start, navigate to the directory where you want to install ``make_post_sell`` database & files.
|
|
43
|
+
|
|
44
|
+
This Makefile-based workflow lets you choose between installing ``make_post_sell`` from PyPI packages or directly from the source code (editable mode). Both flows create a virtual environment in ``./env`` and store configuration and SQLite data in the persistent ``./data`` directory.
|
|
45
|
+
|
|
46
|
+
1. **Install make_post_sell**
|
|
47
|
+
|
|
48
|
+
- **PyPI Installation:**
|
|
49
|
+
Download the Makefile and run::
|
|
50
|
+
|
|
51
|
+
wget "https://git.unturf.com/engineering/make-post-sell/make_post_sell/-/raw/master/Makefile"
|
|
52
|
+
make install-from-pypi
|
|
53
|
+
|
|
54
|
+
- **Source Installation (Editable Mode):**
|
|
55
|
+
Clone the repository and run::
|
|
56
|
+
|
|
57
|
+
git clone ssh://git@git.unturf.com:2222/engineering/make-post-sell/make_post_sell.git
|
|
58
|
+
make install-from-source
|
|
59
|
+
|
|
60
|
+
- **Production Installation (Non‑Editable):**
|
|
61
|
+
For production use (non‑editable even from source), run::
|
|
62
|
+
|
|
63
|
+
git clone ssh://git@git.unturf.com:2222/engineering/make-post-sell/make_post_sell.git
|
|
64
|
+
make install-from-source-prod
|
|
65
|
+
|
|
66
|
+
2. **Activate the Virtual Environment**
|
|
67
|
+
|
|
68
|
+
Before running any commands, activate the virtual environment::
|
|
69
|
+
|
|
70
|
+
source env/bin/activate
|
|
71
|
+
|
|
72
|
+
3. **Start the Development Server**
|
|
73
|
+
|
|
74
|
+
With the virtual environment active, start the server::
|
|
75
|
+
|
|
76
|
+
make serve
|
|
77
|
+
|
|
78
|
+
Then browse to `http://127.0.0.1:6501/ <http://127.0.0.1:6501/>`_ to view the app.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
Running Tests
|
|
82
|
+
-------------
|
|
83
|
+
|
|
84
|
+
We currently use `pytest`:
|
|
85
|
+
|
|
86
|
+
.. code-block:: bash
|
|
87
|
+
|
|
88
|
+
make test
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
SQL Migrations
|
|
92
|
+
===============
|
|
93
|
+
|
|
94
|
+
If your deployment is brand new, you don't need to run any migrations.
|
|
95
|
+
|
|
96
|
+
Otherwise, it should be safe to run this at anytime to catch your database up:
|
|
97
|
+
|
|
98
|
+
.. code-block:: bash
|
|
99
|
+
|
|
100
|
+
alembic -c development.ini upgrade head
|
|
101
|
+
|
|
102
|
+
To look at the current revision and the history run these:
|
|
103
|
+
|
|
104
|
+
.. code-block:: bash
|
|
105
|
+
|
|
106
|
+
alembic -c development.ini history
|
|
107
|
+
alembic -c development.ini current
|
|
108
|
+
|
|
109
|
+
If you ever want to cut a new migration script, you can run this:
|
|
110
|
+
|
|
111
|
+
.. code-block:: bash
|
|
112
|
+
|
|
113
|
+
alembic -c development.ini revision -m "Added email_id column to User table."
|
|
114
|
+
|
|
115
|
+
Then you can edit / modify the generated ``.py`` file with your changes.
|
|
116
|
+
|
|
117
|
+
You can also autogenerate a new migration script using `--autogenerate`.
|
|
118
|
+
Alembic will prepare a migration script by comparing the state of the
|
|
119
|
+
database with the state of the model:
|
|
120
|
+
|
|
121
|
+
.. code-block:: bash
|
|
122
|
+
|
|
123
|
+
alembic -c development.ini revision --autogenerate -m "autogenerated indicies."
|
|
124
|
+
|
|
125
|
+
You should review the recommended migration script before `upgrade`.
|
|
126
|
+
|
|
127
|
+
misc
|
|
128
|
+
====
|
|
129
|
+
|
|
130
|
+
You may source the new Python virtual environment during development:
|
|
131
|
+
|
|
132
|
+
.. code-block:: bash
|
|
133
|
+
|
|
134
|
+
# source env/bin/activate.fish
|
|
135
|
+
. env/bin/activate
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
Python Pyramid Shell
|
|
139
|
+
==========================
|
|
140
|
+
|
|
141
|
+
If you want to use an interactive Python interpreter to interact with Make Post Sell app/models & DB:
|
|
142
|
+
|
|
143
|
+
.. code-block:: bash
|
|
144
|
+
|
|
145
|
+
pshell development.ini
|
|
146
|
+
|
|
147
|
+
For example, we needed to migrate production data using this script:
|
|
148
|
+
|
|
149
|
+
.. code-block:: python
|
|
150
|
+
|
|
151
|
+
# begin the database transaction.
|
|
152
|
+
request.tm.begin()
|
|
153
|
+
|
|
154
|
+
suses = models.stripe_user_shop.get_all_stripe_user_shop_objects(request.dbsession)
|
|
155
|
+
for sus in suses:
|
|
156
|
+
try:
|
|
157
|
+
sus.active_card_id = sus.stripe_customer_default_source.id
|
|
158
|
+
request.dbsession.add(sus)
|
|
159
|
+
except AttributeError:
|
|
160
|
+
pass
|
|
161
|
+
|
|
162
|
+
# flush / commit all changes stored the the sqlachemy session.
|
|
163
|
+
request.dbsession.flush()
|
|
164
|
+
|
|
165
|
+
# commit/close the database transaction to really make changes.
|
|
166
|
+
request.tm.commit()
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
Contributing
|
|
170
|
+
===================
|
|
171
|
+
|
|
172
|
+
* Establish communication with Russell or another admin to bless your git.unturf.com gitlab account & put you into the proper roles.
|
|
173
|
+
* Russell should see your account request but due to spam you have to ask him directly for approval via email or some other means of comms.
|
|
174
|
+
* Clone repo & make commits
|
|
175
|
+
* Create merge requests, we automatically run the unit & headless functional tests on each commit
|
|
176
|
+
* On merge we release to the production site & see the change across users.
|
|
177
|
+
|
|
178
|
+
Optionally, format your code.
|
|
179
|
+
|
|
180
|
+
This is not set in stone, but if you want to use a formatter this is the path for now!
|
|
181
|
+
|
|
182
|
+
**Python**
|
|
183
|
+
black (manual)
|
|
184
|
+
|
|
185
|
+
**Jinja2**
|
|
186
|
+
None (not needed, neither is an HTML formatter)
|
|
187
|
+
|
|
188
|
+
**JavaScript**
|
|
189
|
+
Prettier or biome (manual)
|
|
190
|
+
|
|
191
|
+
**CSS**
|
|
192
|
+
Prettier or biome (manual)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
Licence
|
|
196
|
+
=====================
|
|
197
|
+
|
|
198
|
+
All code contributed goes into the public domain.
|
|
199
|
+
|
|
200
|
+
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Make Post Sell
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
The `Make Post Sell <https://www.makepostsell.com>`_ monolith platform service.
|
|
5
|
+
|
|
6
|
+
You can use the SaaS or self-host!
|
|
7
|
+
|
|
8
|
+
Our `blog acts as our user guide <https://blog.makepostsell.com/>`_ & also uses ``make_post_sell``!
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Quick Start: Operating a Server with PyPI or Source Code
|
|
12
|
+
==========================================================
|
|
13
|
+
|
|
14
|
+
Before you start, navigate to the directory where you want to install ``make_post_sell`` database & files.
|
|
15
|
+
|
|
16
|
+
This Makefile-based workflow lets you choose between installing ``make_post_sell`` from PyPI packages or directly from the source code (editable mode). Both flows create a virtual environment in ``./env`` and store configuration and SQLite data in the persistent ``./data`` directory.
|
|
17
|
+
|
|
18
|
+
1. **Install make_post_sell**
|
|
19
|
+
|
|
20
|
+
- **PyPI Installation:**
|
|
21
|
+
Download the Makefile and run::
|
|
22
|
+
|
|
23
|
+
wget "https://git.unturf.com/engineering/make-post-sell/make_post_sell/-/raw/master/Makefile"
|
|
24
|
+
make install-from-pypi
|
|
25
|
+
|
|
26
|
+
- **Source Installation (Editable Mode):**
|
|
27
|
+
Clone the repository and run::
|
|
28
|
+
|
|
29
|
+
git clone ssh://git@git.unturf.com:2222/engineering/make-post-sell/make_post_sell.git
|
|
30
|
+
make install-from-source
|
|
31
|
+
|
|
32
|
+
- **Production Installation (Non‑Editable):**
|
|
33
|
+
For production use (non‑editable even from source), run::
|
|
34
|
+
|
|
35
|
+
git clone ssh://git@git.unturf.com:2222/engineering/make-post-sell/make_post_sell.git
|
|
36
|
+
make install-from-source-prod
|
|
37
|
+
|
|
38
|
+
2. **Activate the Virtual Environment**
|
|
39
|
+
|
|
40
|
+
Before running any commands, activate the virtual environment::
|
|
41
|
+
|
|
42
|
+
source env/bin/activate
|
|
43
|
+
|
|
44
|
+
3. **Start the Development Server**
|
|
45
|
+
|
|
46
|
+
With the virtual environment active, start the server::
|
|
47
|
+
|
|
48
|
+
make serve
|
|
49
|
+
|
|
50
|
+
Then browse to `http://127.0.0.1:6501/ <http://127.0.0.1:6501/>`_ to view the app.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
Running Tests
|
|
54
|
+
-------------
|
|
55
|
+
|
|
56
|
+
We currently use `pytest`:
|
|
57
|
+
|
|
58
|
+
.. code-block:: bash
|
|
59
|
+
|
|
60
|
+
make test
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
SQL Migrations
|
|
64
|
+
===============
|
|
65
|
+
|
|
66
|
+
If your deployment is brand new, you don't need to run any migrations.
|
|
67
|
+
|
|
68
|
+
Otherwise, it should be safe to run this at anytime to catch your database up:
|
|
69
|
+
|
|
70
|
+
.. code-block:: bash
|
|
71
|
+
|
|
72
|
+
alembic -c development.ini upgrade head
|
|
73
|
+
|
|
74
|
+
To look at the current revision and the history run these:
|
|
75
|
+
|
|
76
|
+
.. code-block:: bash
|
|
77
|
+
|
|
78
|
+
alembic -c development.ini history
|
|
79
|
+
alembic -c development.ini current
|
|
80
|
+
|
|
81
|
+
If you ever want to cut a new migration script, you can run this:
|
|
82
|
+
|
|
83
|
+
.. code-block:: bash
|
|
84
|
+
|
|
85
|
+
alembic -c development.ini revision -m "Added email_id column to User table."
|
|
86
|
+
|
|
87
|
+
Then you can edit / modify the generated ``.py`` file with your changes.
|
|
88
|
+
|
|
89
|
+
You can also autogenerate a new migration script using `--autogenerate`.
|
|
90
|
+
Alembic will prepare a migration script by comparing the state of the
|
|
91
|
+
database with the state of the model:
|
|
92
|
+
|
|
93
|
+
.. code-block:: bash
|
|
94
|
+
|
|
95
|
+
alembic -c development.ini revision --autogenerate -m "autogenerated indicies."
|
|
96
|
+
|
|
97
|
+
You should review the recommended migration script before `upgrade`.
|
|
98
|
+
|
|
99
|
+
misc
|
|
100
|
+
====
|
|
101
|
+
|
|
102
|
+
You may source the new Python virtual environment during development:
|
|
103
|
+
|
|
104
|
+
.. code-block:: bash
|
|
105
|
+
|
|
106
|
+
# source env/bin/activate.fish
|
|
107
|
+
. env/bin/activate
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Python Pyramid Shell
|
|
111
|
+
==========================
|
|
112
|
+
|
|
113
|
+
If you want to use an interactive Python interpreter to interact with Make Post Sell app/models & DB:
|
|
114
|
+
|
|
115
|
+
.. code-block:: bash
|
|
116
|
+
|
|
117
|
+
pshell development.ini
|
|
118
|
+
|
|
119
|
+
For example, we needed to migrate production data using this script:
|
|
120
|
+
|
|
121
|
+
.. code-block:: python
|
|
122
|
+
|
|
123
|
+
# begin the database transaction.
|
|
124
|
+
request.tm.begin()
|
|
125
|
+
|
|
126
|
+
suses = models.stripe_user_shop.get_all_stripe_user_shop_objects(request.dbsession)
|
|
127
|
+
for sus in suses:
|
|
128
|
+
try:
|
|
129
|
+
sus.active_card_id = sus.stripe_customer_default_source.id
|
|
130
|
+
request.dbsession.add(sus)
|
|
131
|
+
except AttributeError:
|
|
132
|
+
pass
|
|
133
|
+
|
|
134
|
+
# flush / commit all changes stored the the sqlachemy session.
|
|
135
|
+
request.dbsession.flush()
|
|
136
|
+
|
|
137
|
+
# commit/close the database transaction to really make changes.
|
|
138
|
+
request.tm.commit()
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
Contributing
|
|
142
|
+
===================
|
|
143
|
+
|
|
144
|
+
* Establish communication with Russell or another admin to bless your git.unturf.com gitlab account & put you into the proper roles.
|
|
145
|
+
* Russell should see your account request but due to spam you have to ask him directly for approval via email or some other means of comms.
|
|
146
|
+
* Clone repo & make commits
|
|
147
|
+
* Create merge requests, we automatically run the unit & headless functional tests on each commit
|
|
148
|
+
* On merge we release to the production site & see the change across users.
|
|
149
|
+
|
|
150
|
+
Optionally, format your code.
|
|
151
|
+
|
|
152
|
+
This is not set in stone, but if you want to use a formatter this is the path for now!
|
|
153
|
+
|
|
154
|
+
**Python**
|
|
155
|
+
black (manual)
|
|
156
|
+
|
|
157
|
+
**Jinja2**
|
|
158
|
+
None (not needed, neither is an HTML formatter)
|
|
159
|
+
|
|
160
|
+
**JavaScript**
|
|
161
|
+
Prettier or biome (manual)
|
|
162
|
+
|
|
163
|
+
**CSS**
|
|
164
|
+
Prettier or biome (manual)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
Licence
|
|
168
|
+
=====================
|
|
169
|
+
|
|
170
|
+
All code contributed goes into the public domain.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
###
|
|
2
|
+
# app configuration
|
|
3
|
+
# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
|
|
4
|
+
###
|
|
5
|
+
|
|
6
|
+
[app:main]
|
|
7
|
+
use = egg:make_post_sell
|
|
8
|
+
|
|
9
|
+
pyramid.reload_templates = true
|
|
10
|
+
pyramid.debug_authorization = true
|
|
11
|
+
pyramid.debug_notfound = true
|
|
12
|
+
pyramid.debug_routematch = true
|
|
13
|
+
pyramid.default_locale_name = en
|
|
14
|
+
pyramid.includes = pyramid_debugtoolbar pyramid_tm
|
|
15
|
+
|
|
16
|
+
# By default, the toolbar only appears for clients from IP addresses
|
|
17
|
+
# '127.0.0.1' and '::1'.
|
|
18
|
+
#debugtoolbar.hosts = 127.0.0.1 ::1
|
|
19
|
+
debugtoolbar.hosts = 0.0.0.0/0
|
|
20
|
+
|
|
21
|
+
sqlalchemy.url = sqlite:///%(here)s/make_post_sell.sqlite
|
|
22
|
+
|
|
23
|
+
retry.attempts = 3
|
|
24
|
+
|
|
25
|
+
###
|
|
26
|
+
# session / cookie configuration.
|
|
27
|
+
# http://docs.pylonsproject.org/docs/pyramid/en/latest/api/session.html
|
|
28
|
+
###
|
|
29
|
+
session.hashalg = sha512
|
|
30
|
+
session.secret = test-secret
|
|
31
|
+
session.timeout = 31104000
|
|
32
|
+
session.max_age = 31104000
|
|
33
|
+
session.reissue_time = 15552000
|
|
34
|
+
session.samesite = None
|
|
35
|
+
|
|
36
|
+
###
|
|
37
|
+
# app "business logic" settings
|
|
38
|
+
###
|
|
39
|
+
|
|
40
|
+
app.root_domain = blanka.foxhop.net
|
|
41
|
+
app.root_domain_owner_email = russell.ballestrini@gmail.com
|
|
42
|
+
app.root_url = http://blanka.foxhop.net:6501
|
|
43
|
+
|
|
44
|
+
app.email.relay = localhost:8025
|
|
45
|
+
|
|
46
|
+
# TODO: these values should be moved to environment variables & we should create an
|
|
47
|
+
# example app.env environment file.
|
|
48
|
+
app.bucket.secure_uploads = plan-period-files
|
|
49
|
+
app.bucket.secure_uploads.region = nyc3
|
|
50
|
+
app.bucket.secure_uploads.post_endpoint = https://nyc3.digitaloceanspaces.com
|
|
51
|
+
app.bucket.secure_uploads.get_endpoint = https://plan-period-files.nyc3.cdn.digitaloceanspaces.com
|
|
52
|
+
app.bucket.secure_uploads.access_key = ${MPS_APP_SECURE_UPLOADS_ACCESS_KEY}
|
|
53
|
+
app.bucket.secure_uploads.secret_key = ${MPS_APP_SECURE_UPLOADS_SECRET_KEY}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# stripe test mode is enabled for development & disabled by default.
|
|
57
|
+
app.stripe.test_mode = True
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# set this to the path of your private DKIM key.
|
|
61
|
+
# reference: https://russell.ballestrini.net/quickstart-to-dkim-signed-email-with-python/
|
|
62
|
+
#app.email.dkim_private_key_path = ${MPS_APP_DKIM_PRIVATE_KEY_PATH}
|
|
63
|
+
#app.email.dkim_selector = ${MPS_APP_DKIM_SELECTOR}
|
|
64
|
+
|
|
65
|
+
# choices: rsa-sha256 or ed25519-sha256
|
|
66
|
+
#app.email.dkim_signature_algorithm = ed25519-sha256
|
|
67
|
+
|
|
68
|
+
# optionally overload the saas logo with a custom one.
|
|
69
|
+
#app.saas_logo = /static/memopoly.png
|
|
70
|
+
#app.saas_theme_color = #c50008ff
|
|
71
|
+
# optional ribbon text.
|
|
72
|
+
#app.saas_ribbon_text = setup shop in this virtual meme market world game!
|
|
73
|
+
app.saas_ribbon_text = Sell the digital things you make — commission free! open source, public domain, ecommerce software!
|
|
74
|
+
|
|
75
|
+
[pshell]
|
|
76
|
+
setup = make_post_sell.scripts.pshell.setup
|
|
77
|
+
|
|
78
|
+
###
|
|
79
|
+
# wsgi server configuration
|
|
80
|
+
###
|
|
81
|
+
|
|
82
|
+
[alembic]
|
|
83
|
+
# path to migration scripts
|
|
84
|
+
script_location = make_post_sell:scripts/alembic
|
|
85
|
+
sqlalchemy.url = sqlite:///%(here)s/make_post_sell.sqlite
|
|
86
|
+
|
|
87
|
+
[server:main]
|
|
88
|
+
use = egg:waitress#main
|
|
89
|
+
#listen = localhost:6501
|
|
90
|
+
#listen = 192.168.1.216:6501
|
|
91
|
+
listen = 0.0.0.0:6501
|
|
92
|
+
|
|
93
|
+
###
|
|
94
|
+
# logging configuration
|
|
95
|
+
# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
|
|
96
|
+
###
|
|
97
|
+
|
|
98
|
+
[loggers]
|
|
99
|
+
keys = root, make_post_sell, sqlalchemy
|
|
100
|
+
|
|
101
|
+
[handlers]
|
|
102
|
+
keys = console
|
|
103
|
+
|
|
104
|
+
[formatters]
|
|
105
|
+
keys = generic
|
|
106
|
+
|
|
107
|
+
[logger_root]
|
|
108
|
+
level = INFO
|
|
109
|
+
handlers = console
|
|
110
|
+
|
|
111
|
+
[logger_make_post_sell]
|
|
112
|
+
level = DEBUG
|
|
113
|
+
handlers =
|
|
114
|
+
qualname = make_post_sell
|
|
115
|
+
|
|
116
|
+
[logger_sqlalchemy]
|
|
117
|
+
level = WARN
|
|
118
|
+
handlers =
|
|
119
|
+
qualname = sqlalchemy.engine
|
|
120
|
+
# "level = INFO" logs SQL queries.
|
|
121
|
+
# "level = DEBUG" logs SQL queries and results.
|
|
122
|
+
# "level = WARN" logs neither. (Recommended for production systems.)
|
|
123
|
+
|
|
124
|
+
[handler_console]
|
|
125
|
+
class = StreamHandler
|
|
126
|
+
args = (sys.stderr,)
|
|
127
|
+
level = NOTSET
|
|
128
|
+
formatter = generic
|
|
129
|
+
|
|
130
|
+
[formatter_generic]
|
|
131
|
+
format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s
|