-
Notifications
You must be signed in to change notification settings - Fork 429
Fix tutorial and add automated validation #711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as off-topic.
This comment was marked as off-topic.
Copilot
AI
changed the title
[WIP] The basic tutorial does not work.
Fix django-tenant-schemas tutorial to work with modern Django
Sep 3, 2025
Copilot finished work on behalf of
goodtune
September 3, 2025 21:18
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Copilot
AI
changed the title
Fix django-tenant-schemas tutorial to work with modern Django
Fix django-tenant-schemas tutorial and add automated validation
Sep 3, 2025
Copilot finished work on behalf of
goodtune
September 3, 2025 22:00
This comment was marked as resolved.
This comment was marked as resolved.
Copilot
AI
changed the title
Fix django-tenant-schemas tutorial and add automated validation
Fix django-tenant-schemas tutorial and add automated validation with uv
Sep 3, 2025
Copilot finished work on behalf of
goodtune
September 3, 2025 22:30
Co-authored-by: goodtune <[email protected]>
Co-authored-by: goodtune <[email protected]>
…fy workflow Co-authored-by: goodtune <[email protected]>
Co-authored-by: goodtune <[email protected]>
c8eb6eb to
9f886ff
Compare
This commit modernizes the tenant tutorial example to use uv for dependency management and adds Django 5.2 compatibility improvements. Key Changes: Tutorial Modernization: - Convert manage.py to uv script with inline dependencies using PEP 723 - Remove requirements.txt in favor of inline script dependencies - Update migration files to use Django 4.2+ format (BigAutoField, modern syntax) - Add DEFAULT_AUTO_FIELD setting for modern Django compatibility - Remove deprecated DEFAULT_FILE_STORAGE setting (replaced by STORAGES) - Update documentation to reflect uv-based workflow CI/Testing Improvements: - Simplify GitHub Actions workflow to use direct manage.py execution - Remove complex server testing steps in favor of basic functionality validation - Update all management command calls to use ./manage.py directly Django 5.2 Compatibility: - Add conditional --skip-checks argument support in migrate_schemas command - Import django module for version checking compatibility Infrastructure: - Add build/ directory to .gitignore for cleaner development environment These changes make the tutorial more accessible to new users by leveraging modern Python tooling (uv) while maintaining backward compatibility and adding support for the latest Django versions.
7d92bf7 to
6b064cd
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR modernizes the tutorial example and improves Django 5.2 compatibility with several key enhancements:
uvscript configuration tomanage.pyfor simplified dependency management--skip-checksargument support for newer Django versionscreate_clientcommand for easier tenant creationKey Changes
.github/workflows/validate-tutorial.yml: New GitHub Actions workflow that validates the tutorial by creating tenants and running migrationsexamples/tenant_tutorial/manage.py: Addeduvscript configuration with proper dependencies and editable package referenceexamples/tenant_tutorial/customers/management/commands/create_client.py: New management command for creating tenant clients with validationdocs/examples.rst: Comprehensive documentation update with modern setup instructions usinguvexamples/tenant_tutorial/tenant_tutorial/settings.py: Updated for Django 5.2 compatibility includingDEFAULT_AUTO_FIELD, modernSTORAGESconfiguration, and relaxedALLOWED_HOSTSfor developmentdjango.conf.urls.urlto moderndjango.urls.pathBigAutoFieldsrc/tenant_schemas/management/commands/migrate_schemas.py: Added Django 5.2 compatibility for--skip-checksargumentTest Plan
uvwithout additional setupcreate_clientcommand works correctly with validationmigrate_schemas --shared