Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Update project requirements and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mmafrar committed May 25, 2024
1 parent 5441eaa commit 7fa88ac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 28 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ psycopg==3.1.18
psycopg-binary==3.1.18
sqlparse==0.4.4
typing_extensions==4.11.0
tzdata==2024.1
whitenoise==6.6.0
12 changes: 6 additions & 6 deletions users/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.urls import path
from . import views
from .views import home, RegisterView, CustomLoginView, update_user
from .views import RegisterView, CustomLoginView, update_user
from django.contrib.auth import views as auth_views


Expand All @@ -11,16 +11,16 @@

urlpatterns = [
path(
"profile-management", views.ViewUserProfileView.as_view(), name="view-profile"
"profile", views.ViewUserProfileView.as_view(), name="view-profile"
),

path("edit-management", update_user, name="edit-profile"),
path("profile/edit", update_user, name="edit-profile"),


path("register/", RegisterView.as_view(), name="users-register"),
path("register", RegisterView.as_view(), name="users-register"),

path(
"login/",
"login",
CustomLoginView.as_view(
redirect_authenticated_user=True,
template_name="login.html",
Expand All @@ -29,5 +29,5 @@
name="login",
),

path("logout/", auth_views.LogoutView.as_view(), name="logout"),
path("logout", auth_views.LogoutView.as_view(), name="logout"),
]
19 changes: 4 additions & 15 deletions yummy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,28 +143,17 @@
BASE_DIR / "static"
]

# added by mash

# Image uploads
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# ended by mash

# added by naqibullah : if user is admin after log


# if user is customer
LOGIN_REDIRECT_URL = '/'

# if the user is admin ?
# LOGIN_REDIRECT_URL = '/dashboard'


# User authentication
LOGIN_URL = 'users/login'
LOGIN_REDIRECT_URL = '/' # if the user is Customer
# LOGIN_REDIRECT_URL = '/dashboard' # if the user is Admin
LOGOUT_REDIRECT_URL = '/'

# added by naqibullah finished

# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
Expand Down
7 changes: 1 addition & 6 deletions yummy/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

from django.conf.urls.static import static

from django.contrib.auth import views as auth_views
from users.views import CustomLoginView

from users.forms import LoginForm

urlpatterns = [
path('', views.index, name='index'),
Expand All @@ -38,6 +34,5 @@
path('menus/', include(('menus.urls', 'menus'), namespace='menus')),
path('orders/', include(('orders.urls', 'orders'), namespace='orders')),
path('contacts/', include(('contacts.urls', 'contacts'), namespace='contacts')),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# ended by mash

0 comments on commit 7fa88ac

Please sign in to comment.