SaaS for Enterprise with Django & Neon Postgres. Data Isolation. Multi-Tenancy. Advanced Tutorial.
CodingEntrepreneurs
@codingentrepreneursAbout
Learn, Build, and Earn. Coding Entrepreneurs is here to help you learn the skills you need to build the projects you want. Learn by doing everything we do step-by-step. Practical and hands-on. Let's do this. π½ Code: https://github.com/codingforentrepreneurs π Enroll. Learn to code. Launch your project: https://cfe.sh/enroll π
Video Description
βοΈ Launch V1 of your SaaS this weekend: https://www.paracord.co/?promo=FOUNDERS75 βοΈ π½ Open Source Code: https://saasgorillas.com/code/ (on GitHub) βNeed help? Use the discussions tab at https://saasgorillas.com/discussions Topics: β Advanced Python web development with Django β Data isolation for Enterprise β Single Django codebase with multi-tenant architecture β Enterprise-only users isolated from standard Django users (and the standard Django admin) β Dedicated Enterprise logins with dedicated subdomains β What, when, and why of multi-tenant apps (e.g. SaaS apps that need to keep enterprise data isolated) β Custom middleware for tenant checking and schema activation β Levels of helping enterprise customers (e.g. when not to use multi-tenant) β Implementing a multi-tenant in Django with no third-party dependancies (aside from postgres) β Learn how to adapt Django to add multi-tenant as needed β User data isolation via Postgres Schemas and Neon Databases β Custom migrations for Django models; for standard Django and Enterprise customers β Django-hosts for subdomain routing and handling β Django Management commands to migrating specific apps for Enterprise Customers vs Regular Django Project β Managing non-public Postgres schemas inline a Public schemas β Using Neon Branching for point-in-time pre-migration backups β Using Neon API to automate branching and branch clean up β and much more βΌοΈ Before you start βΌοΈ I recommend you know some of the following: β¦ Python β’β’β’ Such as classes, functions, variables, math operations, installing, setting up virtual environments β’β’β’ If you're new to Python, watch up to day 15 of 30 Days of Python: https://saasgorillas.com/python1 β¦ Django basics β’β’β’ Such as views, URL routing, models and migrations, users and auth login β’β’β’ If new to Django, watch Your First Django Project (https://saasgorillas.com/django1)(paid) or Try Django 3.2 (https://saasgorillas.com/django2)(free) β’β’β’ SaaS fundamentals with Django (recommended): https://www.youtube.com/watch?v=WbNNESIxJnY β’β’β’ Review the SaaS starter code. Open source version at https://github.com/codingforentrepreneurs/SaaS-Foundations or the managed version on https://cfe.run βοΈ Thank you to Neon for sponsoring this course - sign up at https://saasgorillas.com/db π Enroll now on https://cfe.sh/enroll π π½οΈ Chapters 00:00:00 Welcome 00:08:12 The 3 levels of Enterprise in Django 00:15:54 Implement the SaaS Starter Code 00:27:58 Locking Versions with Pip Tools 00:34:19 Setup Serverless Postgres with Neon 00:40:01 Create a new Database Schema 00:44:57 Simple Migrations for Custom Schemas 00:51:56 Multi-Tenant Migrating with Neon Branching 01:02:34 Customer-only Installed Apps & Database Migrations 01:12:20 Advanced Customer Schema Database Migrations 01:16:19 Using Subdomains in Development with Django 01:19:12 Custom Schema Middleware Activation Part 1 01:26:25 Custom Schema Middleware Activation Part 2 01:35:36 Model for Subdomains and DB Schemas 01:45:21 Auto Generate Schema Names 01:52:56 Validate Tenant Subdomains 01:58:51 Migrate Schemas from Public DB Schema 02:04:48 Challenges with using Public Schema Lookups 02:09:44 Use Public Database Schema Anytime 02:16:26 Schema Activation and Exists Functions 02:23:44 Current Active Schema on Database Connection 02:28:38 Caching Schema Lookups with Django & Redis 02:37:13 Multi-Tenant User Registration 02:44:41 Storing Multi-Tenant User Data 02:50:31 Tenant Post Save Migrate Schemas 02:58:53 Tenant Migration Tasks with Celery Support 03:08:16 Tenant List and Detail 03:13:04 Display Tenant Users in Public Schema Django View 03:20:38 Register Enterprise-only User in Public Django Schema 03:27:49 Handle Valid and Invalid Subdomains 03:36:02 Django Hosts for Enterprise URL Routing 03:49:58 Automated Neon Branching 04:00:18 Dynamic Database Per Enterprise Migrations 04:08:18 Creating & Accessing Dynamic Database Data 04:18:43 Thank you
Essential Developer Tools
AI-recommended products based on this video

WiFi Extender Signal Booster Internet Boosters 1200 Mbps High Speed, 10,000 Sq. Ft Coverage, 4 External Antennas, Dual Band 1-Tap Setup for Home, Office, and Multi-Story House White

WiFi Extender Signal Booster Internet Boosters 1200 Mbps High Speed, 10,000 Sq. Ft Coverage, 4 External Antennas, Dual Band 1-Tap Setup for Home, Office, and Multi-Story House (White-1200)

WiFi Extender Signal Booster Internet Boosters - 1200Mbps High-Speed, 10,000 Sq. Ft Coverage, 4 External Antennas, Dual Band 2.4/5GHz, 1-Tap Setup, for Home, Office, Multi-Story House & Gaming

Swiss Outdoors Rain Fly Tarp | Waterproof Tent Shelter Canopy | Lightweight Easy Setup for Hammock, Backpacking or Camp Gear | Premium Quality 12 x 9 ft |, Green Army

BOSGAME Linux Mini PC, Intel 12th N100 16GB DDR4 RAM 512GB SSD Linux Server Computers Preinstalled Ubuntu 22.04,Support 4K Triple Display/USB3.2/WiFi 5/2.5GbE



















