Skip to content
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

Reloading django apps is problematic #480

Closed
v1kku opened this issue Feb 22, 2021 · 3 comments
Closed

Reloading django apps is problematic #480

v1kku opened this issue Feb 22, 2021 · 3 comments
Labels
weirdness strange project configs and bugs

Comments

@v1kku
Copy link
Contributor

v1kku commented Feb 22, 2021

In apps.py django_jsonfield_backport is added to INSTALLED_APPS and django is forced to reload the apps. This is problematic for projects that perform non-idempotent operations in their apps' ready method. 3rd party packages should not be doing this. Can't that check just report an error asking the user to add django_jsonfield_backport to INSTALLED_APPS (and a warning that reminds them to remove it if django>=3.1)? I'm happy to make a PR for that

@auvipy
Copy link
Collaborator

auvipy commented Feb 25, 2021

@lociii what do you suggest?

@lociii
Copy link
Contributor

lociii commented Feb 28, 2021

Sounds good to me.
However this will be a breaking change as activity stream will stop working with JSON data field when the update is installed and django_jsonfield_backport is not added to the INSTALLED_APPS .

@justquick
Copy link
Owner

go ahead and make a PR so we can see the solution

@justquick justquick added the weirdness strange project configs and bugs label Feb 19, 2022
auvipy added a commit that referenced this issue Sep 5, 2024
* use python base image for simplicity

* updating dev env w/ helpers

* wip: actstream/registered models as factories for DRF

* DRF testing and updates

* drf extras for package

* default permissions, custom viewsets

* allow a 'my actions' view as viewset action

* settings refactor

* testing fix, user serializer to hide password

* dont require drf for testing app

* install drf for actions

* install drf generics for actions

* action posting and model/object drf feeds

* weird ordering issues in tests

* viewset ordering, test debugging for gh actions

* weird db auto id bug? hope this works

* drf following

* add drf urlconf to actstream.urls

* drf-spectacular in runtests

* weird recursion error on urls

* use expand fields as default behavior

* use pytest finally

* set sane ordering in qs, not on drf ordering fields

* runtest project changes, more granular custom permissions/viewsets

* dont load test data 2x

* fugly settings remvoed

* label model url names

* testing restricted permissions

* MODEL_FIELDS setting/testing

* test fix

* +pytest.ini

* renamed to streams

* renamed to streams

* old decorators for compat.

* readonly + public

* manager arg typing

* fixing test warnings

* adding more streams from managers to views

* views for following/follows/is_following

* testfix for missing field

* check post vs get for action sending

* spectacular in runtests

* dont require drf-spectacular for runtests

* only test on push to main

* test fix

* local db setting overrides

* move testapp tests to testapp and out of actstream

* wip: using drf-spectacular to autogen api docs

* use drf-spectacular

* Django>=3.2

* Remove mysql details from docstring (#511)

* Remove mysql details from docstring

The django-mysql JSONField option (introduced before Django had its own builtin JSONField) has been removed, so we should not mention it in the docstring anymore.

* Fix typos

* docs: Fix a few typos

There are small typos in:
- actstream/actions.py
- docs/concepts.rst

Fixes:
- Should read `untranslated` rather than `unstranslated`.
- Should read `terminology` rather than `terminiology`.

Signed-off-by: Tim Gates <tim.gates@iress.com>

* +drf module to setup

* new api docs

* s/master/main/g trying coverage

* v2 codeql, no coverage

* new github workflow badge query

* github actions + coveralls?

* coveralls?

* parallel coverage?

* no custom coverage file name

* coveralls

* Fixes #515 - Make it work with Django 4.1

* Fixes #515 - Change comment to the change

* django 4.1 in tox

* separate django from drf tests

* fix typo in installation docs.

* strip out drf spectacular for now

* remove json field compatibility, force django 3.2, refs #480

* start of drf docs

* 1.4.2 prep

* updating authors and changelog ln

* updating drf docs

* Create SECURITY.md

* fix for #524 datetime_safe removal

* feat(follows): delete object-orphaned Follows...

... based on Django pre_delete signal

* Update codeql-analysis.yml

* Create dependabot.yml

* Bump actions/checkout from 2 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump actions/upload-artifact from 2 to 3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* changelog entry for v2.0.0 release

* Bump version to v2.0.0

* remove unused imports

* add swappable models for drf part

* add swappable models for drf part

* release 2.0.1

---------

Signed-off-by: Tim Gates <tim.gates@iress.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Justin Quick <jquick@stsci.edu>
Co-authored-by: Justin Quick <justquick@gmail.com>
Co-authored-by: Christoph Bülter <cb109@users.noreply.github.com>
Co-authored-by: Tim Gates <tim.gates@iress.com>
Co-authored-by: Marcus Aram <marcus@oxar.nl>
Co-authored-by: Justin Quick <justquick@users.noreply.github.com>
Co-authored-by: khial mustapha <khial.mustaphab32@gmail.com>
Co-authored-by: Jens Nistler <opensource@jensnistler.de>
Co-authored-by: David Guillot <dguillot@contexte.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artush Ghazaryan <artush.ghazaryan@softconstruct.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
weirdness strange project configs and bugs
Projects
None yet
Development

No branches or pull requests

4 participants