From 4ffee6fec6be236d22901057041bb5fcd5ba877d Mon Sep 17 00:00:00 2001 From: Andrew4Coding Date: Fri, 11 Oct 2024 14:03:00 +0700 Subject: [PATCH] feat: move modules to own folder --- auth/urls.py | 10 ---------- auth/views.py | 11 ---------- eventyog/settings.py | 3 ++- eventyog/urls.py | 4 ++-- {auth => modules/authentication}/__init__.py | 0 {auth => modules/authentication}/admin.py | 0 {auth => modules/authentication}/apps.py | 4 ++-- .../authentication}/migrations/__init__.py | 0 modules/authentication/models.py | 3 +++ {auth => modules/authentication}/tests.py | 0 modules/authentication/urls.py | 8 ++++++++ modules/authentication/views.py | 20 +++++++++++++++++++ {main => modules/main}/__init__.py | 0 {main => modules/main}/admin.py | 0 {main => modules/main}/apps.py | 2 +- .../main}/management/commands/reset_db.py | 0 .../main}/management/commands/seed_db.py | 0 .../main}/migrations/0001_initial.py | 0 .../main}/migrations/0002_alter_event_uuid.py | 0 .../migrations/0003_alter_event_location.py | 0 ...ndise_image_url_alter_merchandise_stock.py | 0 {main => modules/main}/migrations/__init__.py | 0 {main => modules/main}/models.py | 0 {main => modules/main}/tests.py | 0 {main => modules/main}/urls.py | 3 +-- {main => modules/main}/views.py | 0 26 files changed, 39 insertions(+), 29 deletions(-) delete mode 100644 auth/urls.py delete mode 100644 auth/views.py rename {auth => modules/authentication}/__init__.py (100%) rename {auth => modules/authentication}/admin.py (100%) rename {auth => modules/authentication}/apps.py (55%) rename {auth => modules/authentication}/migrations/__init__.py (100%) create mode 100644 modules/authentication/models.py rename {auth => modules/authentication}/tests.py (100%) create mode 100644 modules/authentication/urls.py create mode 100644 modules/authentication/views.py rename {main => modules/main}/__init__.py (100%) rename {main => modules/main}/admin.py (100%) rename {main => modules/main}/apps.py (82%) rename {main => modules/main}/management/commands/reset_db.py (100%) rename {main => modules/main}/management/commands/seed_db.py (100%) rename {main => modules/main}/migrations/0001_initial.py (100%) rename {main => modules/main}/migrations/0002_alter_event_uuid.py (100%) rename {main => modules/main}/migrations/0003_alter_event_location.py (100%) rename {main => modules/main}/migrations/0004_merchandise_image_url_alter_merchandise_stock.py (100%) rename {main => modules/main}/migrations/__init__.py (100%) rename {main => modules/main}/models.py (100%) rename {main => modules/main}/tests.py (100%) rename {main => modules/main}/urls.py (66%) rename {main => modules/main}/views.py (100%) diff --git a/auth/urls.py b/auth/urls.py deleted file mode 100644 index c32f209..0000000 --- a/auth/urls.py +++ /dev/null @@ -1,10 +0,0 @@ -from django.urls import path -from auth.views import * - -app_name = 'auth' - -urlpatterns = [ - path('register', register, name='register'), - path('login', login, name='login'), - path('onboarding', onboarding, name='onboarding') -] \ No newline at end of file diff --git a/auth/views.py b/auth/views.py deleted file mode 100644 index 1f2cd2d..0000000 --- a/auth/views.py +++ /dev/null @@ -1,11 +0,0 @@ -from django.shortcuts import render -from django.http import HttpResponse - -def register(request): - return HttpResponse("Hello World") - -def login(request): - pass - -def onboarding(request): - pass diff --git a/eventyog/settings.py b/eventyog/settings.py index 070fded..3cb595c 100644 --- a/eventyog/settings.py +++ b/eventyog/settings.py @@ -40,7 +40,8 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'main', + 'modules.main', + 'modules.authentication', 'whitenoise.runserver_nostatic' ] diff --git a/eventyog/urls.py b/eventyog/urls.py index 77268b4..487719b 100644 --- a/eventyog/urls.py +++ b/eventyog/urls.py @@ -19,6 +19,6 @@ urlpatterns = [ path('admin/', admin.site.urls), - path('', include('main.urls')), - path('auth', include('auth.urls')) + path('', include('modules.main.urls')), + path('auth', include('modules.authentication.urls')) ] diff --git a/auth/__init__.py b/modules/authentication/__init__.py similarity index 100% rename from auth/__init__.py rename to modules/authentication/__init__.py diff --git a/auth/admin.py b/modules/authentication/admin.py similarity index 100% rename from auth/admin.py rename to modules/authentication/admin.py diff --git a/auth/apps.py b/modules/authentication/apps.py similarity index 55% rename from auth/apps.py rename to modules/authentication/apps.py index 836fe02..bb315db 100644 --- a/auth/apps.py +++ b/modules/authentication/apps.py @@ -1,6 +1,6 @@ from django.apps import AppConfig -class AuthConfig(AppConfig): +class AuthenticationConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' - name = 'auth' + name = 'modules.authentication' diff --git a/auth/migrations/__init__.py b/modules/authentication/migrations/__init__.py similarity index 100% rename from auth/migrations/__init__.py rename to modules/authentication/migrations/__init__.py diff --git a/modules/authentication/models.py b/modules/authentication/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/modules/authentication/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/auth/tests.py b/modules/authentication/tests.py similarity index 100% rename from auth/tests.py rename to modules/authentication/tests.py diff --git a/modules/authentication/urls.py b/modules/authentication/urls.py new file mode 100644 index 0000000..09cae24 --- /dev/null +++ b/modules/authentication/urls.py @@ -0,0 +1,8 @@ +from django.urls import path +from modules.authentication.views import * + +app_name = 'main' + +urlpatterns = [ + path('', login, name='main'), +] \ No newline at end of file diff --git a/modules/authentication/views.py b/modules/authentication/views.py new file mode 100644 index 0000000..15f0a63 --- /dev/null +++ b/modules/authentication/views.py @@ -0,0 +1,20 @@ +from django.shortcuts import render + +# Create your views here. +def login(request): + pass + +def logout(request): + pass + +def register(request): + pass + +def profile(request): + pass + +def edit_profile(request): + pass + +def change_password(request): + pass \ No newline at end of file diff --git a/main/__init__.py b/modules/main/__init__.py similarity index 100% rename from main/__init__.py rename to modules/main/__init__.py diff --git a/main/admin.py b/modules/main/admin.py similarity index 100% rename from main/admin.py rename to modules/main/admin.py diff --git a/main/apps.py b/modules/main/apps.py similarity index 82% rename from main/apps.py rename to modules/main/apps.py index 167f044..023227d 100644 --- a/main/apps.py +++ b/modules/main/apps.py @@ -3,4 +3,4 @@ class MainConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' - name = 'main' + name = 'modules.main' diff --git a/main/management/commands/reset_db.py b/modules/main/management/commands/reset_db.py similarity index 100% rename from main/management/commands/reset_db.py rename to modules/main/management/commands/reset_db.py diff --git a/main/management/commands/seed_db.py b/modules/main/management/commands/seed_db.py similarity index 100% rename from main/management/commands/seed_db.py rename to modules/main/management/commands/seed_db.py diff --git a/main/migrations/0001_initial.py b/modules/main/migrations/0001_initial.py similarity index 100% rename from main/migrations/0001_initial.py rename to modules/main/migrations/0001_initial.py diff --git a/main/migrations/0002_alter_event_uuid.py b/modules/main/migrations/0002_alter_event_uuid.py similarity index 100% rename from main/migrations/0002_alter_event_uuid.py rename to modules/main/migrations/0002_alter_event_uuid.py diff --git a/main/migrations/0003_alter_event_location.py b/modules/main/migrations/0003_alter_event_location.py similarity index 100% rename from main/migrations/0003_alter_event_location.py rename to modules/main/migrations/0003_alter_event_location.py diff --git a/main/migrations/0004_merchandise_image_url_alter_merchandise_stock.py b/modules/main/migrations/0004_merchandise_image_url_alter_merchandise_stock.py similarity index 100% rename from main/migrations/0004_merchandise_image_url_alter_merchandise_stock.py rename to modules/main/migrations/0004_merchandise_image_url_alter_merchandise_stock.py diff --git a/main/migrations/__init__.py b/modules/main/migrations/__init__.py similarity index 100% rename from main/migrations/__init__.py rename to modules/main/migrations/__init__.py diff --git a/main/models.py b/modules/main/models.py similarity index 100% rename from main/models.py rename to modules/main/models.py diff --git a/main/tests.py b/modules/main/tests.py similarity index 100% rename from main/tests.py rename to modules/main/tests.py diff --git a/main/urls.py b/modules/main/urls.py similarity index 66% rename from main/urls.py rename to modules/main/urls.py index 68f7794..0452e59 100644 --- a/main/urls.py +++ b/modules/main/urls.py @@ -1,6 +1,5 @@ from django.urls import path -from main.views import * -from auth.views import * +from modules.main.views import * app_name = 'main' diff --git a/main/views.py b/modules/main/views.py similarity index 100% rename from main/views.py rename to modules/main/views.py