-
-
Notifications
You must be signed in to change notification settings - Fork 0
Membership Platform Setup
For server, database and hosting setup, see this page.
- From the django admin app, use the "import" modeladmin action for the
app.user
model - Shell into the server (
fly ssh console && cd app
) - Run the following migration script, accessed through the virtualenv:
poetry run python manage.py sync_legacy_users_with_stripe
- Run the following SQL command to generate a profile of gifts given and received, and export as CSV
SELECT
g.id as "gift_id",
g.code as "gift_code",
us.user_id as "giving_user_id",
gifters.email as "giving_user_email",
giftsub.stripe_id as "giving_sub",
giftsub.stripe_status as "giving_stripe_status",
g.email as "initial_recipient_email",
recipients.id as "recipient_user_id_matching_gift_email",
recipientsub.stripe_id as "follow_up_recipient_sub",
recipientsub.stripe_status
FROM gifts g
LEFT JOIN user_subscription us ON us.id = g.user_subscription_id
LEFT JOIN users recipients ON recipients.email = g.email
LEFT JOIN users gifters ON gifters.id = us.user_id
LEFT JOIN subscriptions giftsub ON giftsub.user_id = us.user_id
LEFT JOIN subscriptions recipientsub ON recipientsub.user_id = recipients.id
ORDER BY giftsub.stripe_status, g.id;
- Import this CSV into the
app.LegacyGifts
model via the django admin panel - Run the following to generate gift subscriptions and add metadata required for correct gift subscription functioning:
poetry run python manage.py sync_legacy_gifts_with_stripe
- Enable webhooks on Stripe dashboard, pointed to
/stripe/webhook/
, to relay Stripe events, and update theSTRIPE_WEBHOOK_SECRET
environment variable accordingly - Perform a full initial download of Stripe data to populate the dj-stripe tables
poetry run python manage.py djstripe_sync_models Product Subscription Coupon
-
In the CMS, configure
Membership Plans
andSubscription Fees
pages. You can access them on the sidebar.Membership Plans (like "Solidarity Membership") can be offered to visitors to subscribe, with one or more underlying Stripe Product (e.g. classic or contemporary books) and one or more Subscription Fees (e.g. £4 per month, £40 per year). Currently, the cheapest, most frequent monthly and annual prices are displayed via the month/year picker buttons.
Plans can be displayed to visitors in a group of options (for example a plan picker page) and also via a full page for each plan.
-
Also in the CMS, configure
Shipping Zones
. See full documentation. -
Then configure the pre-created
app.HomePage
with website content.Use the
layout
section to add aMembershipPlanBlock
to display a list of membership options, with buttons that will take them through the signup process.Then use other blocks to create and update site copy. Other pages can be created in the same way using the
app.InformationPage
.There is also a
BlogIndexPage
which can be used to create and display a blog roll, with a simpler full text layout. -
Finally, configure the Main Menu and Flat Menu (Footer) via
settings > menus
in the CMS.
- Create book products and ensure they are:
- Available to the
Left Book Club Django App
channel via the sidebar, and - Added to the
"Member-Only Books"
product collection. This collection's ID (numbers at end of url like402936398057
) is saved in the app environment asSHOPIFY_COLLECTION_ID
.
- Available to the
- Pull product data from this shopify collection into the Books section of the website / CMS by running the following shell command:
poetry run python manage.py sync_shopify_products
-
You can now set a Featured Content > Book of the Month via the CMS sidebar.
Books will automatically display in the
/books
page, with their own web page for full details and purchasing via Shopify Checkout. All product data, imagery and copy is stored in Shopify.Books can also be displayed as a featured book or grid of books, on the home page and other pages.
NB: There is a Private App configured for the LBC on left-book-club-shop.myshopify.com/admin that is used for the integration. However, Private Apps are no longer creatable and will likely be deprecated, so new integrations with Shopify will require creating a Custom App and integrating via OAuth.
Configure Mailgun or another transactional ESP via the django-anymail package, which is configured in app.settings.production
.
Configure Mailchimp integration via Stripe webhooks, using a tool like Zapier or N8N. More information and recommendations here.
Posthog.com has been installed to provide detailed product analytics and session recordings.
- Fulfill monthly book deliveries: full documentation