From ada5181a7e1bd6929225d74f7ce9b613c63e43eb Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 8 May 2022 16:32:29 +0200 Subject: [PATCH] fix: move django_etebase module from toplevel to under etebase_server This is in preparation for creating a python package, which should only occupy the "etebase_server" name in the global module namespace. --- README.md | 2 +- {django_etebase => etebase_server/django}/__init__.py | 0 .../django}/app_settings_inner.py | 0 {django_etebase => etebase_server/django}/apps.py | 3 ++- .../django}/migrations/0001_initial.py | 4 ++-- .../django}/migrations/0002_userinfo.py | 0 .../django}/migrations/0003_collectioninvitation.py | 0 .../migrations/0004_collectioninvitation_version.py | 0 .../django}/migrations/0005_auto_20200526_1021.py | 0 .../django}/migrations/0006_auto_20200526_1040.py | 0 .../django}/migrations/0007_auto_20200526_1336.py | 0 .../django}/migrations/0008_auto_20200526_1535.py | 4 ++-- .../django}/migrations/0009_auto_20200526_1535.py | 0 .../django}/migrations/0010_auto_20200526_1539.py | 0 .../django}/migrations/0011_collectionmember_stoken.py | 0 .../django}/migrations/0012_auto_20200527_0743.py | 0 .../django}/migrations/0013_collectionmemberremoved.py | 0 .../django}/migrations/0014_auto_20200602_1558.py | 0 .../migrations/0015_collectionitemrevision_salt.py | 0 .../django}/migrations/0016_auto_20200623_0820.py | 0 .../django}/migrations/0017_auto_20200623_0958.py | 0 .../django}/migrations/0018_auto_20200624_0748.py | 0 .../django}/migrations/0019_auto_20200626_0748.py | 0 .../0020_remove_collectionitemrevision_salt.py | 0 .../django}/migrations/0021_auto_20200626_0913.py | 4 ++-- .../django}/migrations/0022_auto_20200804_1059.py | 0 .../migrations/0023_collectionitemchunk_collection.py | 0 .../django}/migrations/0024_auto_20200804_1209.py | 0 .../django}/migrations/0025_auto_20200804_1216.py | 0 .../django}/migrations/0026_auto_20200907_0752.py | 0 .../django}/migrations/0027_auto_20200907_0752.py | 0 .../django}/migrations/0028_auto_20200907_0754.py | 2 +- .../django}/migrations/0029_auto_20200907_0801.py | 0 .../django}/migrations/0030_auto_20200922_0832.py | 0 .../django}/migrations/0031_auto_20201013_1336.py | 0 .../django}/migrations/0032_auto_20201013_1409.py | 0 .../django}/migrations/0033_collection_uid.py | 0 .../django}/migrations/0034_auto_20201214_1124.py | 0 .../django}/migrations/0035_auto_20201214_1126.py | 0 .../django}/migrations/0036_auto_20201214_1128.py | 0 .../django}/migrations/0037_auto_20210127_1237.py | 0 .../django}/migrations/__init__.py | 0 {django_etebase => etebase_server/django}/models.py | 0 {django_etebase => etebase_server/django}/signals.py | 0 .../django}/token_auth/__init__.py | 0 .../django}/token_auth/apps.py | 2 +- .../django}/token_auth/migrations/0001_initial.py | 2 +- .../django}/token_auth/migrations/__init__.py | 0 .../django}/token_auth/models.py | 0 {django_etebase => etebase_server/django}/utils.py | 0 etebase_server/fastapi/dependencies.py | 4 ++-- etebase_server/fastapi/main.py | 2 +- etebase_server/fastapi/redis.py | 2 +- etebase_server/fastapi/routers/authentication.py | 10 +++++----- etebase_server/fastapi/routers/collection.py | 2 +- etebase_server/fastapi/routers/invitation.py | 4 ++-- etebase_server/fastapi/routers/member.py | 2 +- etebase_server/fastapi/routers/test_reset_view.py | 2 +- etebase_server/fastapi/routers/websocket.py | 4 ++-- etebase_server/fastapi/stoken_handler.py | 2 +- etebase_server/fastapi/utils.py | 4 ++-- etebase_server/settings.py | 6 +++--- 62 files changed, 34 insertions(+), 33 deletions(-) rename {django_etebase => etebase_server/django}/__init__.py (100%) rename {django_etebase => etebase_server/django}/app_settings_inner.py (100%) rename {django_etebase => etebase_server/django}/apps.py (53%) rename {django_etebase => etebase_server/django}/migrations/0001_initial.py (98%) rename {django_etebase => etebase_server/django}/migrations/0002_userinfo.py (100%) rename {django_etebase => etebase_server/django}/migrations/0003_collectioninvitation.py (100%) rename {django_etebase => etebase_server/django}/migrations/0004_collectioninvitation_version.py (100%) rename {django_etebase => etebase_server/django}/migrations/0005_auto_20200526_1021.py (100%) rename {django_etebase => etebase_server/django}/migrations/0006_auto_20200526_1040.py (100%) rename {django_etebase => etebase_server/django}/migrations/0007_auto_20200526_1336.py (100%) rename {django_etebase => etebase_server/django}/migrations/0008_auto_20200526_1535.py (91%) rename {django_etebase => etebase_server/django}/migrations/0009_auto_20200526_1535.py (100%) rename {django_etebase => etebase_server/django}/migrations/0010_auto_20200526_1539.py (100%) rename {django_etebase => etebase_server/django}/migrations/0011_collectionmember_stoken.py (100%) rename {django_etebase => etebase_server/django}/migrations/0012_auto_20200527_0743.py (100%) rename {django_etebase => etebase_server/django}/migrations/0013_collectionmemberremoved.py (100%) rename {django_etebase => etebase_server/django}/migrations/0014_auto_20200602_1558.py (100%) rename {django_etebase => etebase_server/django}/migrations/0015_collectionitemrevision_salt.py (100%) rename {django_etebase => etebase_server/django}/migrations/0016_auto_20200623_0820.py (100%) rename {django_etebase => etebase_server/django}/migrations/0017_auto_20200623_0958.py (100%) rename {django_etebase => etebase_server/django}/migrations/0018_auto_20200624_0748.py (100%) rename {django_etebase => etebase_server/django}/migrations/0019_auto_20200626_0748.py (100%) rename {django_etebase => etebase_server/django}/migrations/0020_remove_collectionitemrevision_salt.py (100%) rename {django_etebase => etebase_server/django}/migrations/0021_auto_20200626_0913.py (95%) rename {django_etebase => etebase_server/django}/migrations/0022_auto_20200804_1059.py (100%) rename {django_etebase => etebase_server/django}/migrations/0023_collectionitemchunk_collection.py (100%) rename {django_etebase => etebase_server/django}/migrations/0024_auto_20200804_1209.py (100%) rename {django_etebase => etebase_server/django}/migrations/0025_auto_20200804_1216.py (100%) rename {django_etebase => etebase_server/django}/migrations/0026_auto_20200907_0752.py (100%) rename {django_etebase => etebase_server/django}/migrations/0027_auto_20200907_0752.py (100%) rename {django_etebase => etebase_server/django}/migrations/0028_auto_20200907_0754.py (95%) rename {django_etebase => etebase_server/django}/migrations/0029_auto_20200907_0801.py (100%) rename {django_etebase => etebase_server/django}/migrations/0030_auto_20200922_0832.py (100%) rename {django_etebase => etebase_server/django}/migrations/0031_auto_20201013_1336.py (100%) rename {django_etebase => etebase_server/django}/migrations/0032_auto_20201013_1409.py (100%) rename {django_etebase => etebase_server/django}/migrations/0033_collection_uid.py (100%) rename {django_etebase => etebase_server/django}/migrations/0034_auto_20201214_1124.py (100%) rename {django_etebase => etebase_server/django}/migrations/0035_auto_20201214_1126.py (100%) rename {django_etebase => etebase_server/django}/migrations/0036_auto_20201214_1128.py (100%) rename {django_etebase => etebase_server/django}/migrations/0037_auto_20210127_1237.py (100%) rename {django_etebase => etebase_server/django}/migrations/__init__.py (100%) rename {django_etebase => etebase_server/django}/models.py (100%) rename {django_etebase => etebase_server/django}/signals.py (100%) rename {django_etebase => etebase_server/django}/token_auth/__init__.py (100%) rename {django_etebase => etebase_server/django}/token_auth/apps.py (60%) rename {django_etebase => etebase_server/django}/token_auth/migrations/0001_initial.py (94%) rename {django_etebase => etebase_server/django}/token_auth/migrations/__init__.py (100%) rename {django_etebase => etebase_server/django}/token_auth/models.py (100%) rename {django_etebase => etebase_server/django}/utils.py (100%) diff --git a/README.md b/README.md index 714f8c1..e1dcdae 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ Instead of having to create Django users manually when signup up Etebase users, For example, this makes sense when putting an Etebase server in production. However, this does come with the added risk that everybody with access to your server will be able to sign up. -In order to set it up, comment out the line `ETEBASE_CREATE_USER_FUNC = "django_etebase.utils.create_user_blocked"` in `server/settings.py` and restart your Etebase server. +In order to set it up, comment out the line `ETEBASE_CREATE_USER_FUNC = "etebase_server.django.utils.create_user_blocked"` in `server/settings.py` and restart your Etebase server. # License diff --git a/django_etebase/__init__.py b/etebase_server/django/__init__.py similarity index 100% rename from django_etebase/__init__.py rename to etebase_server/django/__init__.py diff --git a/django_etebase/app_settings_inner.py b/etebase_server/django/app_settings_inner.py similarity index 100% rename from django_etebase/app_settings_inner.py rename to etebase_server/django/app_settings_inner.py diff --git a/django_etebase/apps.py b/etebase_server/django/apps.py similarity index 53% rename from django_etebase/apps.py rename to etebase_server/django/apps.py index 84e4b6e..8f95e10 100644 --- a/django_etebase/apps.py +++ b/etebase_server/django/apps.py @@ -2,4 +2,5 @@ from django.apps import AppConfig class DjangoEtebaseConfig(AppConfig): - name = "django_etebase" + name = "etebase_server.django" + label = "django_etebase" diff --git a/django_etebase/migrations/0001_initial.py b/etebase_server/django/migrations/0001_initial.py similarity index 98% rename from django_etebase/migrations/0001_initial.py rename to etebase_server/django/migrations/0001_initial.py index 42ee022..87783b3 100644 --- a/django_etebase/migrations/0001_initial.py +++ b/etebase_server/django/migrations/0001_initial.py @@ -4,7 +4,7 @@ from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion -import django_etebase.models +from etebase_server.django.models import chunk_directory_path class Migration(migrations.Migration): @@ -85,7 +85,7 @@ class Migration(migrations.Migration): ), ( "chunkFile", - models.FileField(max_length=150, unique=True, upload_to=django_etebase.models.chunk_directory_path), + models.FileField(max_length=150, unique=True, upload_to=chunk_directory_path), ), ( "item", diff --git a/django_etebase/migrations/0002_userinfo.py b/etebase_server/django/migrations/0002_userinfo.py similarity index 100% rename from django_etebase/migrations/0002_userinfo.py rename to etebase_server/django/migrations/0002_userinfo.py diff --git a/django_etebase/migrations/0003_collectioninvitation.py b/etebase_server/django/migrations/0003_collectioninvitation.py similarity index 100% rename from django_etebase/migrations/0003_collectioninvitation.py rename to etebase_server/django/migrations/0003_collectioninvitation.py diff --git a/django_etebase/migrations/0004_collectioninvitation_version.py b/etebase_server/django/migrations/0004_collectioninvitation_version.py similarity index 100% rename from django_etebase/migrations/0004_collectioninvitation_version.py rename to etebase_server/django/migrations/0004_collectioninvitation_version.py diff --git a/django_etebase/migrations/0005_auto_20200526_1021.py b/etebase_server/django/migrations/0005_auto_20200526_1021.py similarity index 100% rename from django_etebase/migrations/0005_auto_20200526_1021.py rename to etebase_server/django/migrations/0005_auto_20200526_1021.py diff --git a/django_etebase/migrations/0006_auto_20200526_1040.py b/etebase_server/django/migrations/0006_auto_20200526_1040.py similarity index 100% rename from django_etebase/migrations/0006_auto_20200526_1040.py rename to etebase_server/django/migrations/0006_auto_20200526_1040.py diff --git a/django_etebase/migrations/0007_auto_20200526_1336.py b/etebase_server/django/migrations/0007_auto_20200526_1336.py similarity index 100% rename from django_etebase/migrations/0007_auto_20200526_1336.py rename to etebase_server/django/migrations/0007_auto_20200526_1336.py diff --git a/django_etebase/migrations/0008_auto_20200526_1535.py b/etebase_server/django/migrations/0008_auto_20200526_1535.py similarity index 91% rename from django_etebase/migrations/0008_auto_20200526_1535.py rename to etebase_server/django/migrations/0008_auto_20200526_1535.py index 7bb83d5..f4b8a85 100644 --- a/django_etebase/migrations/0008_auto_20200526_1535.py +++ b/etebase_server/django/migrations/0008_auto_20200526_1535.py @@ -3,7 +3,7 @@ import django.core.validators from django.db import migrations, models import django.db.models.deletion -import django_etebase.models +from etebase_server.django.models import generate_stoken_uid class Migration(migrations.Migration): @@ -21,7 +21,7 @@ class Migration(migrations.Migration): "uid", models.CharField( db_index=True, - default=django_etebase.models.generate_stoken_uid, + default=generate_stoken_uid, max_length=43, unique=True, validators=[ diff --git a/django_etebase/migrations/0009_auto_20200526_1535.py b/etebase_server/django/migrations/0009_auto_20200526_1535.py similarity index 100% rename from django_etebase/migrations/0009_auto_20200526_1535.py rename to etebase_server/django/migrations/0009_auto_20200526_1535.py diff --git a/django_etebase/migrations/0010_auto_20200526_1539.py b/etebase_server/django/migrations/0010_auto_20200526_1539.py similarity index 100% rename from django_etebase/migrations/0010_auto_20200526_1539.py rename to etebase_server/django/migrations/0010_auto_20200526_1539.py diff --git a/django_etebase/migrations/0011_collectionmember_stoken.py b/etebase_server/django/migrations/0011_collectionmember_stoken.py similarity index 100% rename from django_etebase/migrations/0011_collectionmember_stoken.py rename to etebase_server/django/migrations/0011_collectionmember_stoken.py diff --git a/django_etebase/migrations/0012_auto_20200527_0743.py b/etebase_server/django/migrations/0012_auto_20200527_0743.py similarity index 100% rename from django_etebase/migrations/0012_auto_20200527_0743.py rename to etebase_server/django/migrations/0012_auto_20200527_0743.py diff --git a/django_etebase/migrations/0013_collectionmemberremoved.py b/etebase_server/django/migrations/0013_collectionmemberremoved.py similarity index 100% rename from django_etebase/migrations/0013_collectionmemberremoved.py rename to etebase_server/django/migrations/0013_collectionmemberremoved.py diff --git a/django_etebase/migrations/0014_auto_20200602_1558.py b/etebase_server/django/migrations/0014_auto_20200602_1558.py similarity index 100% rename from django_etebase/migrations/0014_auto_20200602_1558.py rename to etebase_server/django/migrations/0014_auto_20200602_1558.py diff --git a/django_etebase/migrations/0015_collectionitemrevision_salt.py b/etebase_server/django/migrations/0015_collectionitemrevision_salt.py similarity index 100% rename from django_etebase/migrations/0015_collectionitemrevision_salt.py rename to etebase_server/django/migrations/0015_collectionitemrevision_salt.py diff --git a/django_etebase/migrations/0016_auto_20200623_0820.py b/etebase_server/django/migrations/0016_auto_20200623_0820.py similarity index 100% rename from django_etebase/migrations/0016_auto_20200623_0820.py rename to etebase_server/django/migrations/0016_auto_20200623_0820.py diff --git a/django_etebase/migrations/0017_auto_20200623_0958.py b/etebase_server/django/migrations/0017_auto_20200623_0958.py similarity index 100% rename from django_etebase/migrations/0017_auto_20200623_0958.py rename to etebase_server/django/migrations/0017_auto_20200623_0958.py diff --git a/django_etebase/migrations/0018_auto_20200624_0748.py b/etebase_server/django/migrations/0018_auto_20200624_0748.py similarity index 100% rename from django_etebase/migrations/0018_auto_20200624_0748.py rename to etebase_server/django/migrations/0018_auto_20200624_0748.py diff --git a/django_etebase/migrations/0019_auto_20200626_0748.py b/etebase_server/django/migrations/0019_auto_20200626_0748.py similarity index 100% rename from django_etebase/migrations/0019_auto_20200626_0748.py rename to etebase_server/django/migrations/0019_auto_20200626_0748.py diff --git a/django_etebase/migrations/0020_remove_collectionitemrevision_salt.py b/etebase_server/django/migrations/0020_remove_collectionitemrevision_salt.py similarity index 100% rename from django_etebase/migrations/0020_remove_collectionitemrevision_salt.py rename to etebase_server/django/migrations/0020_remove_collectionitemrevision_salt.py diff --git a/django_etebase/migrations/0021_auto_20200626_0913.py b/etebase_server/django/migrations/0021_auto_20200626_0913.py similarity index 95% rename from django_etebase/migrations/0021_auto_20200626_0913.py rename to etebase_server/django/migrations/0021_auto_20200626_0913.py index 3bb6e21..356d5fd 100644 --- a/django_etebase/migrations/0021_auto_20200626_0913.py +++ b/etebase_server/django/migrations/0021_auto_20200626_0913.py @@ -2,7 +2,7 @@ import django.core.validators from django.db import migrations, models -import django_etebase.models +from etebase_server.django.models import generate_stoken_uid class Migration(migrations.Migration): @@ -62,7 +62,7 @@ class Migration(migrations.Migration): name="uid", field=models.CharField( db_index=True, - default=django_etebase.models.generate_stoken_uid, + default=generate_stoken_uid, max_length=43, unique=True, validators=[ diff --git a/django_etebase/migrations/0022_auto_20200804_1059.py b/etebase_server/django/migrations/0022_auto_20200804_1059.py similarity index 100% rename from django_etebase/migrations/0022_auto_20200804_1059.py rename to etebase_server/django/migrations/0022_auto_20200804_1059.py diff --git a/django_etebase/migrations/0023_collectionitemchunk_collection.py b/etebase_server/django/migrations/0023_collectionitemchunk_collection.py similarity index 100% rename from django_etebase/migrations/0023_collectionitemchunk_collection.py rename to etebase_server/django/migrations/0023_collectionitemchunk_collection.py diff --git a/django_etebase/migrations/0024_auto_20200804_1209.py b/etebase_server/django/migrations/0024_auto_20200804_1209.py similarity index 100% rename from django_etebase/migrations/0024_auto_20200804_1209.py rename to etebase_server/django/migrations/0024_auto_20200804_1209.py diff --git a/django_etebase/migrations/0025_auto_20200804_1216.py b/etebase_server/django/migrations/0025_auto_20200804_1216.py similarity index 100% rename from django_etebase/migrations/0025_auto_20200804_1216.py rename to etebase_server/django/migrations/0025_auto_20200804_1216.py diff --git a/django_etebase/migrations/0026_auto_20200907_0752.py b/etebase_server/django/migrations/0026_auto_20200907_0752.py similarity index 100% rename from django_etebase/migrations/0026_auto_20200907_0752.py rename to etebase_server/django/migrations/0026_auto_20200907_0752.py diff --git a/django_etebase/migrations/0027_auto_20200907_0752.py b/etebase_server/django/migrations/0027_auto_20200907_0752.py similarity index 100% rename from django_etebase/migrations/0027_auto_20200907_0752.py rename to etebase_server/django/migrations/0027_auto_20200907_0752.py diff --git a/django_etebase/migrations/0028_auto_20200907_0754.py b/etebase_server/django/migrations/0028_auto_20200907_0754.py similarity index 95% rename from django_etebase/migrations/0028_auto_20200907_0754.py rename to etebase_server/django/migrations/0028_auto_20200907_0754.py index 24c6246..9a0f1ae 100644 --- a/django_etebase/migrations/0028_auto_20200907_0754.py +++ b/etebase_server/django/migrations/0028_auto_20200907_0754.py @@ -2,7 +2,7 @@ from django.db import migrations -from django_etebase.models import AccessLevels +from etebase_server.django.models import AccessLevels def change_access_level_to_int(apps, schema_editor): diff --git a/django_etebase/migrations/0029_auto_20200907_0801.py b/etebase_server/django/migrations/0029_auto_20200907_0801.py similarity index 100% rename from django_etebase/migrations/0029_auto_20200907_0801.py rename to etebase_server/django/migrations/0029_auto_20200907_0801.py diff --git a/django_etebase/migrations/0030_auto_20200922_0832.py b/etebase_server/django/migrations/0030_auto_20200922_0832.py similarity index 100% rename from django_etebase/migrations/0030_auto_20200922_0832.py rename to etebase_server/django/migrations/0030_auto_20200922_0832.py diff --git a/django_etebase/migrations/0031_auto_20201013_1336.py b/etebase_server/django/migrations/0031_auto_20201013_1336.py similarity index 100% rename from django_etebase/migrations/0031_auto_20201013_1336.py rename to etebase_server/django/migrations/0031_auto_20201013_1336.py diff --git a/django_etebase/migrations/0032_auto_20201013_1409.py b/etebase_server/django/migrations/0032_auto_20201013_1409.py similarity index 100% rename from django_etebase/migrations/0032_auto_20201013_1409.py rename to etebase_server/django/migrations/0032_auto_20201013_1409.py diff --git a/django_etebase/migrations/0033_collection_uid.py b/etebase_server/django/migrations/0033_collection_uid.py similarity index 100% rename from django_etebase/migrations/0033_collection_uid.py rename to etebase_server/django/migrations/0033_collection_uid.py diff --git a/django_etebase/migrations/0034_auto_20201214_1124.py b/etebase_server/django/migrations/0034_auto_20201214_1124.py similarity index 100% rename from django_etebase/migrations/0034_auto_20201214_1124.py rename to etebase_server/django/migrations/0034_auto_20201214_1124.py diff --git a/django_etebase/migrations/0035_auto_20201214_1126.py b/etebase_server/django/migrations/0035_auto_20201214_1126.py similarity index 100% rename from django_etebase/migrations/0035_auto_20201214_1126.py rename to etebase_server/django/migrations/0035_auto_20201214_1126.py diff --git a/django_etebase/migrations/0036_auto_20201214_1128.py b/etebase_server/django/migrations/0036_auto_20201214_1128.py similarity index 100% rename from django_etebase/migrations/0036_auto_20201214_1128.py rename to etebase_server/django/migrations/0036_auto_20201214_1128.py diff --git a/django_etebase/migrations/0037_auto_20210127_1237.py b/etebase_server/django/migrations/0037_auto_20210127_1237.py similarity index 100% rename from django_etebase/migrations/0037_auto_20210127_1237.py rename to etebase_server/django/migrations/0037_auto_20210127_1237.py diff --git a/django_etebase/migrations/__init__.py b/etebase_server/django/migrations/__init__.py similarity index 100% rename from django_etebase/migrations/__init__.py rename to etebase_server/django/migrations/__init__.py diff --git a/django_etebase/models.py b/etebase_server/django/models.py similarity index 100% rename from django_etebase/models.py rename to etebase_server/django/models.py diff --git a/django_etebase/signals.py b/etebase_server/django/signals.py similarity index 100% rename from django_etebase/signals.py rename to etebase_server/django/signals.py diff --git a/django_etebase/token_auth/__init__.py b/etebase_server/django/token_auth/__init__.py similarity index 100% rename from django_etebase/token_auth/__init__.py rename to etebase_server/django/token_auth/__init__.py diff --git a/django_etebase/token_auth/apps.py b/etebase_server/django/token_auth/apps.py similarity index 60% rename from django_etebase/token_auth/apps.py rename to etebase_server/django/token_auth/apps.py index a0e98be..43ebb74 100644 --- a/django_etebase/token_auth/apps.py +++ b/etebase_server/django/token_auth/apps.py @@ -2,4 +2,4 @@ from django.apps import AppConfig class TokenAuthConfig(AppConfig): - name = "django_etebase.token_auth" + name = "etebase_server.django.token_auth" diff --git a/django_etebase/token_auth/migrations/0001_initial.py b/etebase_server/django/token_auth/migrations/0001_initial.py similarity index 94% rename from django_etebase/token_auth/migrations/0001_initial.py rename to etebase_server/django/token_auth/migrations/0001_initial.py index 660b38c..906005c 100644 --- a/django_etebase/token_auth/migrations/0001_initial.py +++ b/etebase_server/django/token_auth/migrations/0001_initial.py @@ -3,7 +3,7 @@ from django.conf import settings from django.db import migrations, models import django.db.models.deletion -from django_etebase.token_auth import models as token_auth_models +from etebase_server.django.token_auth import models as token_auth_models class Migration(migrations.Migration): diff --git a/django_etebase/token_auth/migrations/__init__.py b/etebase_server/django/token_auth/migrations/__init__.py similarity index 100% rename from django_etebase/token_auth/migrations/__init__.py rename to etebase_server/django/token_auth/migrations/__init__.py diff --git a/django_etebase/token_auth/models.py b/etebase_server/django/token_auth/models.py similarity index 100% rename from django_etebase/token_auth/models.py rename to etebase_server/django/token_auth/models.py diff --git a/django_etebase/utils.py b/etebase_server/django/utils.py similarity index 100% rename from django_etebase/utils.py rename to etebase_server/django/utils.py diff --git a/etebase_server/fastapi/dependencies.py b/etebase_server/fastapi/dependencies.py index 48894d6..b4d5cf4 100644 --- a/etebase_server/fastapi/dependencies.py +++ b/etebase_server/fastapi/dependencies.py @@ -6,8 +6,8 @@ from fastapi.security import APIKeyHeader from django.utils import timezone from django.db.models import QuerySet -from django_etebase import models -from django_etebase.token_auth.models import AuthToken, get_default_expiry +from etebase_server.django import models +from etebase_server.django.token_auth.models import AuthToken, get_default_expiry from etebase_server.myauth.models import UserType, get_typed_user_model from .exceptions import AuthenticationFailed from .utils import get_object_or_404 diff --git a/etebase_server/fastapi/main.py b/etebase_server/fastapi/main.py index 74798a4..e4abd6c 100644 --- a/etebase_server/fastapi/main.py +++ b/etebase_server/fastapi/main.py @@ -6,7 +6,7 @@ from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.trustedhost import TrustedHostMiddleware from fastapi.staticfiles import StaticFiles -from django_etebase import app_settings +from etebase_server.django import app_settings from .exceptions import CustomHttpException from .msgpack import MsgpackResponse diff --git a/etebase_server/fastapi/redis.py b/etebase_server/fastapi/redis.py index 60df6a4..c4d697c 100644 --- a/etebase_server/fastapi/redis.py +++ b/etebase_server/fastapi/redis.py @@ -1,7 +1,7 @@ import typing as t import aioredis -from django_etebase import app_settings +from etebase_server.django import app_settings class RedisWrapper: diff --git a/etebase_server/fastapi/routers/authentication.py b/etebase_server/fastapi/routers/authentication.py index b271357..d771a5c 100644 --- a/etebase_server/fastapi/routers/authentication.py +++ b/etebase_server/fastapi/routers/authentication.py @@ -14,11 +14,11 @@ from django.db import transaction from django.utils.functional import cached_property from fastapi import APIRouter, Depends, status, Request -from django_etebase import app_settings, models -from django_etebase.token_auth.models import AuthToken -from django_etebase.models import UserInfo -from django_etebase.signals import user_signed_up -from django_etebase.utils import create_user, get_user_queryset, CallbackContext +from etebase_server.django import app_settings, models +from etebase_server.django.token_auth.models import AuthToken +from etebase_server.django.models import UserInfo +from etebase_server.django.signals import user_signed_up +from etebase_server.django.utils import create_user, get_user_queryset, CallbackContext from etebase_server.myauth.models import UserType, get_typed_user_model from ..exceptions import AuthenticationFailed, transform_validation_error, HttpError from ..msgpack import MsgpackRoute diff --git a/etebase_server/fastapi/routers/collection.py b/etebase_server/fastapi/routers/collection.py index 3c2e511..6722c78 100644 --- a/etebase_server/fastapi/routers/collection.py +++ b/etebase_server/fastapi/routers/collection.py @@ -7,7 +7,7 @@ from django.db import transaction, IntegrityError from django.db.models import Q, QuerySet from fastapi import APIRouter, Depends, status, Request, BackgroundTasks -from django_etebase import models +from etebase_server.django import models from etebase_server.myauth.models import UserType from .authentication import get_authenticated_user from .websocket import get_ticket, TicketRequest, TicketOut diff --git a/etebase_server/fastapi/routers/invitation.py b/etebase_server/fastapi/routers/invitation.py index 2ab2f64..adb51c6 100644 --- a/etebase_server/fastapi/routers/invitation.py +++ b/etebase_server/fastapi/routers/invitation.py @@ -4,8 +4,8 @@ from django.db import transaction, IntegrityError from django.db.models import QuerySet from fastapi import APIRouter, Depends, status, Request -from django_etebase import models -from django_etebase.utils import get_user_queryset, CallbackContext +from etebase_server.django import models +from etebase_server.django.utils import get_user_queryset, CallbackContext from etebase_server.myauth.models import UserType, get_typed_user_model from .authentication import get_authenticated_user from ..exceptions import HttpError, PermissionDenied diff --git a/etebase_server/fastapi/routers/member.py b/etebase_server/fastapi/routers/member.py index dff95c1..123357b 100644 --- a/etebase_server/fastapi/routers/member.py +++ b/etebase_server/fastapi/routers/member.py @@ -4,7 +4,7 @@ from django.db import transaction from django.db.models import QuerySet from fastapi import APIRouter, Depends, status -from django_etebase import models +from etebase_server.django import models from etebase_server.myauth.models import UserType, get_typed_user_model from .authentication import get_authenticated_user from ..msgpack import MsgpackRoute diff --git a/etebase_server/fastapi/routers/test_reset_view.py b/etebase_server/fastapi/routers/test_reset_view.py index a66d1cc..7895697 100644 --- a/etebase_server/fastapi/routers/test_reset_view.py +++ b/etebase_server/fastapi/routers/test_reset_view.py @@ -3,7 +3,7 @@ from django.db import transaction from django.shortcuts import get_object_or_404 from fastapi import APIRouter, Request, status -from django_etebase.utils import get_user_queryset, CallbackContext +from etebase_server.django.utils import get_user_queryset, CallbackContext from .authentication import SignupIn, signup_save from ..msgpack import MsgpackRoute from ..exceptions import HttpError diff --git a/etebase_server/fastapi/routers/websocket.py b/etebase_server/fastapi/routers/websocket.py index 19cd5e1..019f58f 100644 --- a/etebase_server/fastapi/routers/websocket.py +++ b/etebase_server/fastapi/routers/websocket.py @@ -8,8 +8,8 @@ from fastapi import APIRouter, Depends, WebSocket, WebSocketDisconnect, status import nacl.encoding import nacl.utils -from django_etebase import models -from django_etebase.utils import CallbackContext, get_user_queryset +from etebase_server.django import models +from etebase_server.django.utils import CallbackContext, get_user_queryset from etebase_server.myauth.models import UserType, get_typed_user_model from ..dependencies import get_collection_queryset, get_item_queryset diff --git a/etebase_server/fastapi/stoken_handler.py b/etebase_server/fastapi/stoken_handler.py index b6f2999..b4c7eab 100644 --- a/etebase_server/fastapi/stoken_handler.py +++ b/etebase_server/fastapi/stoken_handler.py @@ -3,7 +3,7 @@ import typing as t from django.db.models import QuerySet from fastapi import status -from django_etebase.models import Stoken +from etebase_server.django.models import Stoken from .exceptions import HttpError diff --git a/etebase_server/fastapi/utils.py b/etebase_server/fastapi/utils.py index b215477..334633c 100644 --- a/etebase_server/fastapi/utils.py +++ b/etebase_server/fastapi/utils.py @@ -10,8 +10,8 @@ from pydantic import BaseModel as PyBaseModel from django.db.models import Model, QuerySet from django.core.exceptions import ObjectDoesNotExist -from django_etebase import app_settings -from django_etebase.models import AccessLevels +from etebase_server.django import app_settings +from etebase_server.django.models import AccessLevels from etebase_server.myauth.models import UserType, get_typed_user_model from .exceptions import HttpError, HttpErrorOut diff --git a/etebase_server/settings.py b/etebase_server/settings.py index f1db11e..5ef89e3 100644 --- a/etebase_server/settings.py +++ b/etebase_server/settings.py @@ -55,8 +55,8 @@ INSTALLED_APPS = [ "django.contrib.messages", "django.contrib.staticfiles", "etebase_server.myauth.apps.MyauthConfig", - "django_etebase.apps.DjangoEtebaseConfig", - "django_etebase.token_auth.apps.TokenAuthConfig", + "etebase_server.django.apps.DjangoEtebaseConfig", + "etebase_server.django.token_auth.apps.TokenAuthConfig", ] MIDDLEWARE = [ @@ -167,7 +167,7 @@ if any(os.path.isfile(x) for x in config_locations): if "database-options" in config: DATABASES["default"]["OPTIONS"] = config["database-options"] -ETEBASE_CREATE_USER_FUNC = "django_etebase.utils.create_user_blocked" +ETEBASE_CREATE_USER_FUNC = "etebase_server.django.utils.create_user_blocked" # Efficient file streaming (for large files) SENDFILE_BACKEND = "etebase_fastapi.sendfile.backends.simple"