Issue 441 - client dirs and settings.py#442
Open
paribaker wants to merge 10 commits into
Open
Conversation
Replace with cookiecutter
Contributor
Author
|
@whusterj Im having an issue with heroku on this one will merge and fix if it happens in main release as well! |
Fixes Django 5 deprecation warnings and updates dependencies for Django 5 compatibility. **Closes #440** - Removed deprecated `USE_L10N` setting (localization is always enabled in Django 5) - Migrated from deprecated `STATICFILES_STORAGE` and `DEFAULT_FILE_STORAGE` to the new `STORAGES` dict format - Inlined S3 storage configuration with full OPTIONS (access_key, secret_key, bucket_name, region_name, etc.) - Updated to override `STORAGES` keys instead of deprecated settings | Package | Old Version | New Version | |---------|-------------|-------------| | `django-filter` | `==2.4.*` | `>=24.2` | | `django-currentuser` | `==0.7.0` | `>=0.9.0` | - `utils/storages.py` - No longer needed as storage configuration is now inline in settings 1. Run the Django development server and verify no deprecation warnings appear 2. Test file uploads work correctly (both local filesystem and S3 if configured) 3. Verify static files are served correctly 4. Run the test suite to ensure nothing is broken --------- Co-authored-by: Pari Work Temp <pariwork@thinknimble.com>
Replace dj-rest-auth LogoutView with custom UnifiedLogoutView that also clears the Django session, ensuring users are logged out of Django admin when logging out from the client app. ## What this does Add a description of what feature/page this PR intends to add or change. ## Checklist - [ ] Todo 1 - [ ] Todo 2 - [ ] Todo 3 ## How to test Add user steps to achieve desired functionality for this feature. --------- Co-authored-by: Pari Work Temp <pariwork@thinknimble.com>
## Summary - Refactor mobile workflow to use environment variables more consistently - Improve shell command safety by avoiding direct variable expansion - Clean up variable passing in workflow steps ## Changes - Move deployment environment URL handling to proper environment variables - Update jq command arguments to use safer parameter passing - Standardize environment variable usage across workflow steps ## Test plan - [ ] Verify mobile workflow still functions correctly with deployment events - [ ] Check that environment variables are properly set and accessible - [ ] Confirm EAS update and build commands work as expected
## What this does Add a description of what feature/page this PR intends to add or change. ## Checklist - [ ] Todo 1 - [ ] Todo 2 - [ ] Todo 3 ## How to test Add user steps to achieve desired functionality for this feature. --------- Co-authored-by: Pari Work Temp <pariwork@thinknimble.com>
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
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.
What this does
Fixes #441 — Cleans up how the client build is served by removing the redundant
static/subfolder from the React public directory and fixing Django'ssettings.pyto avoid a duplicate nestedstatic/static/path whencollectstaticruns.Why
When the Dockerfile builds and serves the client, the Vite build output lands in
client/dist/. Django'scollectstaticthen copies everything fromSTATICFILES_DIRSintoSTATIC_ROOT(static/). Previously, the Reactpublic/directory had an extrastatic/subfolder (e.g.public/static/favicons/,public/static/robots.txt), andSTATICFILES_DIRSincluded bothclient/dist/andclient/dist/static/. This caused assets to be collected twice — once understatic/and again understatic/static/— creating a duplicate subfolder structure that could lead to broken asset paths at runtime.Changes
favicons/,robots.txt, andwell-known-example/are moved frompublic/static/topublic/directly, eliminating the extra nesting that Vite was carrying through to the build output.STATICFILES_DIRSentry — Theos.path.join(BASE_DIR, "..", "client", "dist", "static")line is removed sinceclient/dist/alone now covers all built assets.TEMPLATES.DIRSatSTATIC_ROOTinstead ofclient/dist/— Aftercollectstatic, the index template lives inSTATIC_ROOT, so Django should look there when serving the SPA entry point. This is the correct path for both Heroku and Docker deployments.STATIC_ROOT/MEDIA_ROOTdeclarations earlier — They are now defined beforeTEMPLATESso they can be referenced in the template dirs configuration.How to test
npm run buildor equivalent) and verify assets land inclient/dist/without a nestedstatic/subfolder.python manage.py collectstatic— confirm assets are collected intostatic/with nostatic/static/duplication.🤖 Generated with Claude Code