Package: django-terra-accounts
django-terra-accountsDjango accounts management for terralego appshttps://django-terra-accounts.readthedocs.io/WARNINGsplitted from terracommon.accountsIf you want to migrate data, please :test in local envall terracommon.accounts reference should be replaced by terra_accountsall migration file which is referencing a 'accounts' migration should reference 'terra_accounts'backup your instancestop instanceupdate your django_content_type tableUPDATE django_content_type SET app_label = 'terra_accounts' WHERE app_label = 'account';update your django_migrations tableUPDATE django_migrations SET app = 'terra_accounts' WHERE app = 'account';Rename tablesALTER TABLE accounts_terrauser RENAME TO terra_accounts_terrauser;ALTER TABLE accounts_readmodels RENAME TO terra_accounts_readmodel;Restart instances and launch migrationsSetting UpIt's recommended to follow all instruction if you don't know how this app really works, else if you set up half of this, you may experience
some problems.Django app and URLsIf you plan to use User API for authentication, registration, and other this, you should add theterra_accountsapp to INSTALLED_APPS andINSTALLED_APPS = (
  [...],
  'terra_accounts',
)And include terra_accounts's URLs to your project urls, by adding this:path("", include("terra_accounts.urls")),User's modelTo set up the Terra User Model, you should follow the standard django procedure, by adding this to you project settings:AUTH_USER_MODEL = 'terra_accounts.TerraUser'Payload handlerYou should also override the default payload handler of jwt tokens, setting this:JWT_AUTH = {
  'JWT_PAYLOAD_HANDLER' 'terra_accounts.jwt_payload.terra_payload_handler',
}Permissions mixinIf you plan to use the permission mecanism which heritate from django Permission class you should add the permission mixin
to your appconfig's.There is an exemple of AppConfigfrom django.apps import AppConfig

from terra_accounts.permissions_mixins import PermissionRegistrationMixin


class MyAppConfig(PermissionRegistrationMixin, AppConfig):
    name = 'my_app'

    permissions = (
        ('can_do_something', 'Is able to do something'),
        ('can_do_whatever', 'Is able to do whatever'),
    )The permission mixin, overrides theready()method to register a signal. If you plan to override this method, do not
forget to add a call tosuper().ready()To start a dev instanceDefine settings you wants intest_geosourcedjango project.docker-composeupFirst start should failed as the database need to be initialized. Just launch
the same command twice.Then initialize the database:docker-composerunweb/code/venv/bin/python3/code/src/manage.pymigrateYou can now edit your code. A django runserver is launched internally so the
this is an autoreload server.You can access to the api onhttp://localhost:8000/api/TestTo run test suite, just launch:docker-composerunweb/code/venv/bin/python3/code/src/manage.pytestCHANGELOG1.0.7          (2021-05-07)Fix missing migration (and check migrations in CI)1.0.6          (2021-05-07)Fix case where disabled_module is not defined in settings1.0.5          (2021-04-22)Add manager to filter permission with disabled_modules setting (#41)1.0.4      (2021-04-13)Fix bug when pushing terra_permisisions from clientFilter module permission1.0.3           (2020-02-16)Translate permission labels1.0.2      (2021-01-20)Permissions are not required anymore by serializer for TerraUserGroup permissions are set inpermission_listfield by serializer for reading operations andpermissionfor writing operations1.0.1           (2020-11-24)Backport terra-settings functions1.0.0           (2020-11-18)!! WARNING : Breaking changes !!Change and fix way to get user terra modules0.5.1           (2020-11-16)Endpoint to get all / user available functional permissions0.5.0           (2020-11-03)Breaking changesterra-accounts settings endpoint is now removed in favor of terra-settings settings endpointUsed with django-terra-settings instead of django-terra-utilsPlease update your project requirements and code to use new terra-settings app.Remove deprecated user viewset / serializer / info endpoint0.3.13          (2020-09-08)Officially support Django 3.10.3.12         (2020-08-25)Using django.db.models.JSONField instead of django.contrib.postgres.fieldsNew DjangoModelFactory location0.3.11         (2020-06-24)Fix settings override by TERRA_APPLIANCE_SETTINGS0.3.10          (2020-06-03)Move settings endpoint from terra_utilsServe language from instance defined language0.3.9           (2020-03-20)Manage reset password views0.3.8           (2019-12-13)Update documentationSupport Django 3.0Support DjangoRestFramework 3.110.3.7.1         (2019-11-26)Include inherited permissions from groups to userImprove Terra Permission creation0.3.6      (2019-11-05)Add a method to check if a user has some terra permission0.3.5      (2019-11-04)Implement TerraPermissions0.3.4      (2019-10-08)Deprecate looking up user by id (will be removed in 0.4.0)0.3.3      (2019-10-03)Featuretest factories are now included in packaging0.3.2      (2019-09-27)FixesGroups must be a DRF standard attribute0.3.1      (2019-09-26)FixesFix id in Group serializer (and API)0.3.0      (2019-09-25)Breaking ChangesApp name move from accounts to terra_accounts. Structure is the same, so backup and restore your dataFirst public tagTerra app extracted from terracommon.accounts