Reverting back to admin pages as login and updates in the mobile api

This commit is contained in:
Vivek
2025-12-17 22:05:13 +05:30
parent 48c8abb366
commit 105da4a876
39 changed files with 2147 additions and 452 deletions

View File

@@ -26,19 +26,29 @@ INSTALLED_APPS = [
'events',
'accounts',
'templatetags',
'mobile_web_api',
'mobile_api',
'web_api',
'rest_framework',
'rest_framework.authtoken'
]
INSTALLED_APPS += [
"corsheaders",
]
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
]
CORS_ALLOWED_ORIGINS = [
"http://localhost:5173",
]
ROOT_URLCONF = 'eventify.urls'
@@ -61,24 +71,24 @@ TEMPLATES = [
WSGI_APPLICATION = 'eventify.wsgi.application'
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR / 'db.sqlite3',
# }
# }
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'eventify_uat_db', # your DB name
'USER': 'eventify_uat', # your DB user
'PASSWORD': 'eventifyplus@!@#$', # your DB password
'HOST': '0.0.0.0', # or IP/domain
'PORT': '5440', # default PostgreSQL port
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'eventify_uat_db', # your DB name
# 'USER': 'eventify_uat', # your DB user
# 'PASSWORD': 'eventifyplus@!@#$', # your DB password
# 'HOST': '0.0.0.0', # or IP/domain
# 'PORT': '5440', # default PostgreSQL port
# }
# }
AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},

View File

@@ -1,23 +1,37 @@
from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views as auth_views
from accounts.views import dashboard
from accounts.customer_views import RegisterView
from accounts.customer_views import login_view, logout_view, customer_dashboard
# from accounts.views import dashboard, login_view, logout_view, UserListView, UserCreateView, UserUpdateView, UserDeleteView
# from accounts.customer_views import RegisterView
# from accounts.customer_views import login_view, logout_view, customer_dashboard, customer_calendar
# from accounts.customer_views import customer_profile
from accounts import views
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path("", login_view, name="login"),
path("logout/", logout_view, name="logout"),
path("register/", RegisterView.as_view(), name="register"),
path('dashboard/', customer_dashboard, name='customer_dashboard'),
# path("", login_view, name="login"),
# path("logout/", logout_view, name="logout"),
# path("register/", RegisterView.as_view(), name="register"),
# path('dashboard/', customer_dashboard, name='customer_dashboard'),
# path('calendar/', customer_calendar, name='customer_calendar'),
# path('profile/', customer_profile, name='customer_profile'),
path('', views.login_view, name='login'),
path('logout/', views.logout_view, name='logout'),
path('dashboard/', views.dashboard, name='dashboard'),
path('users/', views.UserListView.as_view(), name='user_list'),
path('users/add/', views.UserCreateView.as_view(), name='user_add'),
path('users/<int:pk>/edit/', views.UserUpdateView.as_view(), name='user_edit'),
path('users/<int:pk>/delete/', views.UserDeleteView.as_view(), name='user_delete'),
path('master-data/', include('master_data.urls')),
path('events/', include('events.urls')),
path('accounts/', include('accounts.urls')),
path('api/', include('mobile_web_api.urls')),
path('api/', include('mobile_api.urls')),
# path('web-api/', include('web_api.urls')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)