From 66deec827b71f0d03ddf0d1bfa1c1939dced7ef0 Mon Sep 17 00:00:00 2001 From: Andreas Burbach <aburbach@compeon.de> Date: Thu, 25 Nov 2021 12:55:30 +0100 Subject: [PATCH] change folder names --- .gitignore | 6 ++--- .gitlab-ci.yml | 6 ++--- README.md | 4 +-- .../Dockerfile | 0 .../LICENSE | 0 .../README.md | 0 .../manage.py | 2 +- .../pyproject.toml | 19 +++++++------- .../social_network}/__init__.py | 0 .../social_network}/asgi.py | 4 +-- .../social_network}/settings.py | 8 +++--- .../social_network}/urls.py | 10 +++---- .../social_network}/wsgi.py | 4 +-- .../the_social_network}/__init__.py | 0 .../the_social_network}/admin.py | 0 .../the_social_network}/apps.py | 2 +- .../migrations/0001_initial.py | 26 +++++++++---------- .../migrations/0002_auto_20211111_1220.py | 2 +- .../migrations}/__init__.py | 0 .../the_social_network}/models.py | 16 ++++++------ .../serializers/accountSerializers.py | 0 .../serializers/authenticationSerializers.py | 0 .../serializers/contentSerializers.py | 2 +- .../the_social_network}/tests.py | 0 .../the_social_network}/urls/accountUrls.py | 0 .../urls/authenticationUrls.py | 0 .../the_social_network}/urls/contentUrls.py | 0 .../the_social_network}/urls/searchUrls.py | 0 .../the_social_network}/validation.py | 0 social_network/the_social_network/version.py | 4 +++ .../the_social_network}/views/accountViews.py | 0 .../views/authenticationViews.py | 0 .../the_social_network}/views/contentViews.py | 0 .../the_social_network}/views/searchViews.py | 0 social_network/versioning.py | 16 ++++++++++++ 35 files changed, 74 insertions(+), 57 deletions(-) rename {the_social_network => social_network}/Dockerfile (100%) rename {the_social_network => social_network}/LICENSE (100%) rename {the_social_network => social_network}/README.md (100%) rename {the_social_network => social_network}/manage.py (87%) mode change 100755 => 100644 rename {the_social_network => social_network}/pyproject.toml (68%) rename {the_social_network/core/migrations => social_network/social_network}/__init__.py (100%) rename {the_social_network/the_social_network => social_network/social_network}/asgi.py (70%) rename {the_social_network/the_social_network => social_network/social_network}/settings.py (95%) rename {the_social_network/the_social_network => social_network/social_network}/urls.py (72%) rename {the_social_network/the_social_network => social_network/social_network}/wsgi.py (70%) rename {the_social_network/core => social_network/the_social_network}/__init__.py (100%) rename {the_social_network/core => social_network/the_social_network}/admin.py (100%) rename {the_social_network/core => social_network/the_social_network}/apps.py (70%) rename {the_social_network/core => social_network/the_social_network}/migrations/0001_initial.py (80%) rename {the_social_network/core => social_network/the_social_network}/migrations/0002_auto_20211111_1220.py (96%) rename {the_social_network/the_social_network => social_network/the_social_network/migrations}/__init__.py (100%) rename {the_social_network/core => social_network/the_social_network}/models.py (95%) rename {the_social_network/core => social_network/the_social_network}/serializers/accountSerializers.py (100%) rename {the_social_network/core => social_network/the_social_network}/serializers/authenticationSerializers.py (100%) rename {the_social_network/core => social_network/the_social_network}/serializers/contentSerializers.py (98%) rename {the_social_network/core => social_network/the_social_network}/tests.py (100%) rename {the_social_network/core => social_network/the_social_network}/urls/accountUrls.py (100%) rename {the_social_network/core => social_network/the_social_network}/urls/authenticationUrls.py (100%) rename {the_social_network/core => social_network/the_social_network}/urls/contentUrls.py (100%) rename {the_social_network/core => social_network/the_social_network}/urls/searchUrls.py (100%) rename {the_social_network/core => social_network/the_social_network}/validation.py (100%) create mode 100644 social_network/the_social_network/version.py rename {the_social_network/core => social_network/the_social_network}/views/accountViews.py (100%) rename {the_social_network/core => social_network/the_social_network}/views/authenticationViews.py (100%) rename {the_social_network/core => social_network/the_social_network}/views/contentViews.py (100%) rename {the_social_network/core => social_network/the_social_network}/views/searchViews.py (100%) create mode 100644 social_network/versioning.py diff --git a/.gitignore b/.gitignore index af11019..3962ab9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,8 @@ yarn-error.log* *.eslintcache */media/account/images/ -the_social_network/django_static +social_network/django_static pypi/*/ -the_social_network/dist -the_social_network/the_social_network.egg-info \ No newline at end of file +social_network/dist +social_network/the_social_network.egg-info \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9a3fad..8bb983a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,7 +33,7 @@ test: script: - echo "Testing ..." - docker-compose -f docker-compose.ci.yml pull - - docker-compose -f docker-compose.ci.yml run web sh -c "poetry run python manage.py makemigrations && poetry run python manage.py migrate && poetry run python manage.py test core -v 2" + - docker-compose -f docker-compose.ci.yml run web sh -c "poetry run python manage.py makemigrations && poetry run python manage.py migrate && poetry run python manage.py test the_social_network -v 2" deploy: only: @@ -43,9 +43,7 @@ deploy: - test script: - echo "Deploying ..." - - cd ./the_social_network - - mv ./the_social_network ./not_needed - - mv ./core ./the_social_network + - cd ./social_network - apk add py-pip - pip install poetry - poetry --version diff --git a/README.md b/README.md index 6c32fcb..f8c84bd 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # The Social Network -`the_social_network/` is the backend of the most thinkable fronted for social networks, which was developed with [Django](https://www.djangoproject.com/) and [Django Rest Framework](https://www.django-rest-framework.org/) +`social_network/` is the backend of the most thinkable fronted for social networks, which was developed with [Django](https://www.djangoproject.com/) and [Django Rest Framework](https://www.django-rest-framework.org/) This subproject is the basis for any possible type of social networks. -The `core/` subfolder is the core of this project an is managed to working as a starting point for any further works on basic social networks. +The `the_social_network/` subfolder is the core of this project an is managed to working as a starting point for any further works on basic social networks. Use the [Postman-Documentation](https://documenter.getpostman.com/view/13331140/TzRNFVaC) and run it locally for a detailed overview about the API. Make sure the database is seeded with corresponding data. diff --git a/the_social_network/Dockerfile b/social_network/Dockerfile similarity index 100% rename from the_social_network/Dockerfile rename to social_network/Dockerfile diff --git a/the_social_network/LICENSE b/social_network/LICENSE similarity index 100% rename from the_social_network/LICENSE rename to social_network/LICENSE diff --git a/the_social_network/README.md b/social_network/README.md similarity index 100% rename from the_social_network/README.md rename to social_network/README.md diff --git a/the_social_network/manage.py b/social_network/manage.py old mode 100755 new mode 100644 similarity index 87% rename from the_social_network/manage.py rename to social_network/manage.py index f7f55f9..71644c8 --- a/the_social_network/manage.py +++ b/social_network/manage.py @@ -6,7 +6,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_social_network.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'social_network.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/the_social_network/pyproject.toml b/social_network/pyproject.toml similarity index 68% rename from the_social_network/pyproject.toml rename to social_network/pyproject.toml index 749d643..a1ca3ea 100644 --- a/the_social_network/pyproject.toml +++ b/social_network/pyproject.toml @@ -1,13 +1,18 @@ +[build-system] +requires = [ "poetry-core>=1.0.0", "poetry-dynamic-versioning",] +build-backend = "poetry.core.masonry.api" + [tool.poetry] name = "the-social-network" -version = "0.0.1" +version = "0.0.0" description = "Basic social network core." -authors = ["Marc Feger <marc.feger@hhu.de>"] +authors = [ "Marc Feger <marc.feger@hhu.de>",] license = "BSD-4" readme = "README.md" -exclude = ["not_needed"] homepage = "https://gitlab.cs.uni-duesseldorf.de/feger/the-social-network" +[tool.poetry-dynamic-versioning] +enable = true [tool.poetry.dependencies] python = "^3.9" @@ -16,10 +21,4 @@ djangorestframework = "^3.12.4" Pillow = "^8.4.0" django-cors-headers = "^3.10.0" django-dotenv = "^1.4.2" -uWSGI = "^2.0.20" - -[tool.poetry.dev-dependencies] - -[build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +uWSGI = "^2.0.20" \ No newline at end of file diff --git a/the_social_network/core/migrations/__init__.py b/social_network/social_network/__init__.py similarity index 100% rename from the_social_network/core/migrations/__init__.py rename to social_network/social_network/__init__.py diff --git a/the_social_network/the_social_network/asgi.py b/social_network/social_network/asgi.py similarity index 70% rename from the_social_network/the_social_network/asgi.py rename to social_network/social_network/asgi.py index 5fea914..60f23a2 100644 --- a/the_social_network/the_social_network/asgi.py +++ b/social_network/social_network/asgi.py @@ -1,5 +1,5 @@ """ -ASGI config for the_social_network project. +ASGI config for social_network project. It exposes the ASGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ import os from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_social_network.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'social_network.settings') application = get_asgi_application() diff --git a/the_social_network/the_social_network/settings.py b/social_network/social_network/settings.py similarity index 95% rename from the_social_network/the_social_network/settings.py rename to social_network/social_network/settings.py index 84842f0..9f54f2e 100644 --- a/the_social_network/the_social_network/settings.py +++ b/social_network/social_network/settings.py @@ -1,5 +1,5 @@ """ -Django settings for the_social_network project. +Django settings for social_network project. Generated by 'django-admin startproject' using Django 3.1.2. @@ -42,7 +42,7 @@ INSTALLED_APPS = [ 'corsheaders', 'rest_framework', 'rest_framework.authtoken', - 'core', + 'the_social_network', ] MIDDLEWARE = [ @@ -56,7 +56,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'the_social_network.urls' +ROOT_URLCONF = 'social_network.urls' TEMPLATES = [ { @@ -74,7 +74,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = 'the_social_network.wsgi.application' +WSGI_APPLICATION = 'social_network.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases diff --git a/the_social_network/the_social_network/urls.py b/social_network/social_network/urls.py similarity index 72% rename from the_social_network/the_social_network/urls.py rename to social_network/social_network/urls.py index a6b7db4..44918e4 100644 --- a/the_social_network/the_social_network/urls.py +++ b/social_network/social_network/urls.py @@ -1,4 +1,4 @@ -"""the_social_network URL Configuration +"""social_network URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ @@ -21,8 +21,8 @@ from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), - url(r'^authentication/', include('core.urls.authenticationUrls')), - url(r'^accounts/', include('core.urls.accountUrls')), - url(r'^search/', include('core.urls.searchUrls')), - url(r'^contents/', include('core.urls.contentUrls')), + url(r'^authentication/', include('the_social_network.urls.authenticationUrls')), + url(r'^accounts/', include('the_social_network.urls.accountUrls')), + url(r'^search/', include('the_social_network.urls.searchUrls')), + url(r'^contents/', include('the_social_network.urls.contentUrls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/the_social_network/the_social_network/wsgi.py b/social_network/social_network/wsgi.py similarity index 70% rename from the_social_network/the_social_network/wsgi.py rename to social_network/social_network/wsgi.py index 21d6cfa..10441c1 100644 --- a/the_social_network/the_social_network/wsgi.py +++ b/social_network/social_network/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for the_social_network project. +WSGI config for social_network project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_social_network.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'social_network.settings') application = get_wsgi_application() diff --git a/the_social_network/core/__init__.py b/social_network/the_social_network/__init__.py similarity index 100% rename from the_social_network/core/__init__.py rename to social_network/the_social_network/__init__.py diff --git a/the_social_network/core/admin.py b/social_network/the_social_network/admin.py similarity index 100% rename from the_social_network/core/admin.py rename to social_network/the_social_network/admin.py diff --git a/the_social_network/core/apps.py b/social_network/the_social_network/apps.py similarity index 70% rename from the_social_network/core/apps.py rename to social_network/the_social_network/apps.py index d180014..a571ee1 100644 --- a/the_social_network/core/apps.py +++ b/social_network/the_social_network/apps.py @@ -2,4 +2,4 @@ from django.apps import AppConfig class AuthenticationConfig(AppConfig): - name = 'core' + name = 'the_social_network' diff --git a/the_social_network/core/migrations/0001_initial.py b/social_network/the_social_network/migrations/0001_initial.py similarity index 80% rename from the_social_network/core/migrations/0001_initial.py rename to social_network/the_social_network/migrations/0001_initial.py index 7ac9b1f..2da4701 100644 --- a/the_social_network/core/migrations/0001_initial.py +++ b/social_network/the_social_network/migrations/0001_initial.py @@ -26,8 +26,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True, db_index=True)), - ('from_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='from_account', to='core.account')), - ('to_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='to_account', to='core.account')), + ('from_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='from_account', to='the_social_network.account')), + ('to_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='to_account', to='the_social_network.account')), ], options={ 'ordering': ('-created',), @@ -36,7 +36,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='account', name='related_to', - field=models.ManyToManyField(blank=True, default=None, related_name='related_by', through='core.Relationship', to='core.Account'), + field=models.ManyToManyField(blank=True, default=None, related_name='related_by', through='the_social_network.Relationship', to='the_social_network.Account'), ), migrations.CreateModel( name='Statement', @@ -44,7 +44,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('content', models.CharField(max_length=120)), ('created', models.DateTimeField(auto_now_add=True, db_index=True)), - ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.account')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='the_social_network.account')), ], options={ 'ordering': ('-created',), @@ -63,8 +63,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True, db_index=True)), - ('hashtag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hashtag', to='core.hashtag')), - ('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.statement')), + ('hashtag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hashtag', to='the_social_network.hashtag')), + ('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='the_social_network.statement')), ], options={ 'ordering': ('-created',), @@ -73,15 +73,15 @@ class Migration(migrations.Migration): migrations.AddField( model_name='statement', name='tagged', - field=models.ManyToManyField(blank=True, default=None, related_name='tags', through='core.HashtagTagging', to='core.Hashtag'), + field=models.ManyToManyField(blank=True, default=None, related_name='tags', through='the_social_network.HashtagTagging', to='the_social_network.Hashtag'), ), migrations.CreateModel( name='AccountTagging', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True, db_index=True)), - ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account', to='core.account')), - ('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.statement')), + ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account', to='the_social_network.account')), + ('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='the_social_network.statement')), ], options={ 'ordering': ('-created',), @@ -90,7 +90,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='statement', name='mentioned', - field=models.ManyToManyField(blank=True, default=None, related_name='mentions', through='core.AccountTagging', to='core.Account'), + field=models.ManyToManyField(blank=True, default=None, related_name='mentions', through='the_social_network.AccountTagging', to='the_social_network.Account'), ), migrations.CreateModel( name='Reaction', @@ -98,8 +98,8 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True, db_index=True)), ('vote', models.PositiveSmallIntegerField(choices=[(1, 'like'), (2, 'dislike')], default=1)), - ('child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='child', to='core.statement')), - ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parent', to='core.statement')), + ('child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='child', to='the_social_network.statement')), + ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parent', to='the_social_network.statement')), ], options={ 'ordering': ('-created',), @@ -108,6 +108,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='statement', name='reactions', - field=models.ManyToManyField(blank=True, default=None, related_name='reaction_of', through='core.Reaction', to='core.Statement'), + field=models.ManyToManyField(blank=True, default=None, related_name='reaction_of', through='the_social_network.Reaction', to='the_social_network.Statement'), ), ] diff --git a/the_social_network/core/migrations/0002_auto_20211111_1220.py b/social_network/the_social_network/migrations/0002_auto_20211111_1220.py similarity index 96% rename from the_social_network/core/migrations/0002_auto_20211111_1220.py rename to social_network/the_social_network/migrations/0002_auto_20211111_1220.py index 4eed0fd..1044ed5 100644 --- a/the_social_network/core/migrations/0002_auto_20211111_1220.py +++ b/social_network/the_social_network/migrations/0002_auto_20211111_1220.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('core', '0001_initial'), + ('the_social_network', '0001_initial'), ] operations = [ diff --git a/the_social_network/the_social_network/__init__.py b/social_network/the_social_network/migrations/__init__.py similarity index 100% rename from the_social_network/the_social_network/__init__.py rename to social_network/the_social_network/migrations/__init__.py diff --git a/the_social_network/core/models.py b/social_network/the_social_network/models.py similarity index 95% rename from the_social_network/core/models.py rename to social_network/the_social_network/models.py index 34ef361..db6851b 100644 --- a/the_social_network/core/models.py +++ b/social_network/the_social_network/models.py @@ -14,7 +14,7 @@ class Statement(models.Model): """ This model represents an statement of an specific account. """ - author = models.ForeignKey('core.Account', on_delete=models.CASCADE) + author = models.ForeignKey('the_social_network.Account', on_delete=models.CASCADE) content = models.CharField(max_length=120, blank=False) created = models.DateTimeField(auto_now_add=True, db_index=True) # Add an hashtag between statements and hashtags over the tagging model @@ -24,7 +24,7 @@ class Statement(models.Model): symmetrical=False, related_name='tags', default=None) - mentioned = models.ManyToManyField('core.Account', + mentioned = models.ManyToManyField('the_social_network.Account', blank=True, through='AccountTagging', symmetrical=False, @@ -62,7 +62,7 @@ class Statement(models.Model): used_mentions: List[str] = self.__extract_mentioning() # resolve mentions after saving the statement for used_mention in used_mentions: - account: 'core.Account' = apps.get_model("core", "Account").objects.filter( + account: 'the_social_network.Account' = apps.get_model("the_social_network", "Account").objects.filter( user__username=used_mention).first() if account: self.add_mentioning(account=account) @@ -156,7 +156,7 @@ class Statement(models.Model): ).delete() return deleted - def __extract_mentioning(self) -> List['core.Account']: + def __extract_mentioning(self) -> List['the_social_network.Account']: """ This method extracts the mentions of accounts in the calling statement. Accounts names are alpha numeric words. @@ -165,7 +165,7 @@ class Statement(models.Model): """ return re.findall(r"@(\w+)", self.content) - def add_mentioning(self, account: 'core.Account'): + def add_mentioning(self, account: 'the_social_network.Account'): """ This method is for adding an mention of an account to the corresponding statement. :param account: The account to be mentioned. @@ -174,7 +174,7 @@ class Statement(models.Model): mentioning, created = AccountTagging.objects.get_or_create(statement=self, account=account) return created - def get_mentioning(self) -> List['core.Account']: + def get_mentioning(self) -> List['the_social_network.Account']: """ This method is to get all accounts mentioned by the calling statement. @@ -182,7 +182,7 @@ class Statement(models.Model): """ return list(self.mentioned.all()) - def remove_mentioning(self, account: 'core.Account'): + def remove_mentioning(self, account: 'the_social_network.Account'): """ This method is used to delete an specific mentioning of an account for the calling statement. @@ -244,7 +244,7 @@ class AccountTagging(Tagging): This model is to represent the mention of an account within an statement. """ # Which account should be mentioned? - account = models.ForeignKey('core.Account', related_name='account', on_delete=models.CASCADE) + account = models.ForeignKey('the_social_network.Account', related_name='account', on_delete=models.CASCADE) class Meta: ordering = ('-created',) diff --git a/the_social_network/core/serializers/accountSerializers.py b/social_network/the_social_network/serializers/accountSerializers.py similarity index 100% rename from the_social_network/core/serializers/accountSerializers.py rename to social_network/the_social_network/serializers/accountSerializers.py diff --git a/the_social_network/core/serializers/authenticationSerializers.py b/social_network/the_social_network/serializers/authenticationSerializers.py similarity index 100% rename from the_social_network/core/serializers/authenticationSerializers.py rename to social_network/the_social_network/serializers/authenticationSerializers.py diff --git a/the_social_network/core/serializers/contentSerializers.py b/social_network/the_social_network/serializers/contentSerializers.py similarity index 98% rename from the_social_network/core/serializers/contentSerializers.py rename to social_network/the_social_network/serializers/contentSerializers.py index cb936f0..a70d2d3 100644 --- a/the_social_network/core/serializers/contentSerializers.py +++ b/social_network/the_social_network/serializers/contentSerializers.py @@ -68,7 +68,7 @@ class AccountSerializer(serializers.ModelSerializer): user = UserPublicSerializer() class Meta: - model = apps.get_model("core", "Account") + model = apps.get_model("the_social_network", "Account") fields = ('user', 'image',) diff --git a/the_social_network/core/tests.py b/social_network/the_social_network/tests.py similarity index 100% rename from the_social_network/core/tests.py rename to social_network/the_social_network/tests.py diff --git a/the_social_network/core/urls/accountUrls.py b/social_network/the_social_network/urls/accountUrls.py similarity index 100% rename from the_social_network/core/urls/accountUrls.py rename to social_network/the_social_network/urls/accountUrls.py diff --git a/the_social_network/core/urls/authenticationUrls.py b/social_network/the_social_network/urls/authenticationUrls.py similarity index 100% rename from the_social_network/core/urls/authenticationUrls.py rename to social_network/the_social_network/urls/authenticationUrls.py diff --git a/the_social_network/core/urls/contentUrls.py b/social_network/the_social_network/urls/contentUrls.py similarity index 100% rename from the_social_network/core/urls/contentUrls.py rename to social_network/the_social_network/urls/contentUrls.py diff --git a/the_social_network/core/urls/searchUrls.py b/social_network/the_social_network/urls/searchUrls.py similarity index 100% rename from the_social_network/core/urls/searchUrls.py rename to social_network/the_social_network/urls/searchUrls.py diff --git a/the_social_network/core/validation.py b/social_network/the_social_network/validation.py similarity index 100% rename from the_social_network/core/validation.py rename to social_network/the_social_network/validation.py diff --git a/social_network/the_social_network/version.py b/social_network/the_social_network/version.py new file mode 100644 index 0000000..49263c2 --- /dev/null +++ b/social_network/the_social_network/version.py @@ -0,0 +1,4 @@ +__version_major__ = 0 +__version_minor__ = 0 +__version_patch__ = 1 +__version__ = '{}.{}.{}'.format(__version_major__, __version_minor__, __version_patch__) \ No newline at end of file diff --git a/the_social_network/core/views/accountViews.py b/social_network/the_social_network/views/accountViews.py similarity index 100% rename from the_social_network/core/views/accountViews.py rename to social_network/the_social_network/views/accountViews.py diff --git a/the_social_network/core/views/authenticationViews.py b/social_network/the_social_network/views/authenticationViews.py similarity index 100% rename from the_social_network/core/views/authenticationViews.py rename to social_network/the_social_network/views/authenticationViews.py diff --git a/the_social_network/core/views/contentViews.py b/social_network/the_social_network/views/contentViews.py similarity index 100% rename from the_social_network/core/views/contentViews.py rename to social_network/the_social_network/views/contentViews.py diff --git a/the_social_network/core/views/searchViews.py b/social_network/the_social_network/views/searchViews.py similarity index 100% rename from the_social_network/core/views/searchViews.py rename to social_network/the_social_network/views/searchViews.py diff --git a/social_network/versioning.py b/social_network/versioning.py new file mode 100644 index 0000000..623f10b --- /dev/null +++ b/social_network/versioning.py @@ -0,0 +1,16 @@ +import sys +import toml + +if len(sys.argv) != 2: + print("Usage: python versioning.py <version>") + sys.exit(1) + +version = sys.argv[1] + +with open("pyproject.toml", "r") as f: + toml_file = toml.load(f) + +toml_file["tool"]["poetry"]["version"] = version + +with open('pyproject.toml', 'w') as f: + new_toml_string = toml.dump(toml_file, f) \ No newline at end of file -- GitLab