Skip to content

Issue 441 - client dirs and settings.py#442

Open
paribaker wants to merge 10 commits into
mainfrom
feature/issue-441
Open

Issue 441 - client dirs and settings.py#442
paribaker wants to merge 10 commits into
mainfrom
feature/issue-441

Conversation

@paribaker
Copy link
Copy Markdown
Contributor

@paribaker paribaker commented Nov 16, 2025

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's settings.py to avoid a duplicate nested static/static/ path when collectstatic runs.

Why

When the Dockerfile builds and serves the client, the Vite build output lands in client/dist/. Django's collectstatic then copies everything from STATICFILES_DIRS into STATIC_ROOT (static/). Previously, the React public/ directory had an extra static/ subfolder (e.g. public/static/favicons/, public/static/robots.txt), and STATICFILES_DIRS included both client/dist/ and client/dist/static/. This caused assets to be collected twice — once under static/ and again under static/static/ — creating a duplicate subfolder structure that could lead to broken asset paths at runtime.

Changes

  • Move public assets up one levelfavicons/, robots.txt, and well-known-example/ are moved from public/static/ to public/ directly, eliminating the extra nesting that Vite was carrying through to the build output.
  • Remove the duplicate STATICFILES_DIRS entry — The os.path.join(BASE_DIR, "..", "client", "dist", "static") line is removed since client/dist/ alone now covers all built assets.
  • Point TEMPLATES.DIRS at STATIC_ROOT instead of client/dist/ — After collectstatic, the index template lives in STATIC_ROOT, so Django should look there when serving the SPA entry point. This is the correct path for both Heroku and Docker deployments.
  • Move STATIC_ROOT / MEDIA_ROOT declarations earlier — They are now defined before TEMPLATES so they can be referenced in the template dirs configuration.

How to test

  1. Build the client (npm run build or equivalent) and verify assets land in client/dist/ without a nested static/ subfolder.
  2. Run python manage.py collectstatic — confirm assets are collected into static/ with no static/static/ duplication.
  3. Start the Django server and verify the SPA index page loads correctly and all favicon / static asset paths resolve.
  4. Deploy to a staging environment (Heroku or Docker) and confirm the app serves correctly.

🤖 Generated with Claude Code

@whusterj whusterj temporarily deployed to tn-spa-bootstrapper-pr-442 November 16, 2025 22:02 Inactive
@paribaker paribaker temporarily deployed to tn-spa-bootstrapper-pr-442 December 23, 2025 16:12 Inactive
@paribaker paribaker temporarily deployed to tn-spa-bootstrapper-pr-442 December 23, 2025 16:33 Inactive
@paribaker paribaker temporarily deployed to tn-spa-bootstrapper-pr-442 December 23, 2025 17:00 Inactive
@paribaker paribaker temporarily deployed to tn-spa-bootstrapper-pr-442 December 23, 2025 17:21 Inactive
Replace with cookiecutter
@paribaker
Copy link
Copy Markdown
Contributor Author

@whusterj Im having an issue with heroku on this one will merge and fix if it happens in main release as well!

paribaker and others added 6 commits February 4, 2026 11:04
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>
@whusterj whusterj added the high-risk High merge/integration risk label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

high-risk High merge/integration risk Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up client index serving

2 participants