diff options
| author | spl3g <spleefer6@gmail.com> | 2026-05-31 16:12:10 +0300 |
|---|---|---|
| committer | spl3g <spleefer6@gmail.com> | 2026-05-31 16:12:10 +0300 |
| commit | 611f3017c00dd9a220402489602defab66f2c9f0 (patch) | |
| tree | 8e068f6100e8a0aab1ffb3aa0c6878651ea28103 /config | |
| parent | d2e7e7141037377d293b00e691fa835694783f26 (diff) | |
add login and products views
Diffstat (limited to 'config')
| -rw-r--r-- | config/settings.py | 7 | ||||
| -rw-r--r-- | config/urls.py | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/config/settings.py b/config/settings.py index ed0ea02..8ba7d50 100644 --- a/config/settings.py +++ b/config/settings.py @@ -80,7 +80,7 @@ DATABASES = { "USER": "postgres", "PASSWORD": "123456", "HOST": "localhost", - "PORT": "5445", + "PORT": "4444", } } @@ -120,5 +120,8 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/6.0/howto/static-files/ +STATIC_URL = "static/" +STATICFILES_DIRS = [BASE_DIR / "static"] +MEDIA_URL = "/media/" +MEDIA_ROOT = BASE_DIR / "media" -STATIC_URL = 'static/' diff --git a/config/urls.py b/config/urls.py index 56f8c8c..ff27744 100644 --- a/config/urls.py +++ b/config/urls.py @@ -16,7 +16,18 @@ Including another URLconf """ from django.contrib import admin from django.urls import path +from django.contrib.auth.views import LogoutView +from django.conf import settings +from django.conf.urls.static import static + +from core.views import UserLoginView, ProductListView urlpatterns = [ path('admin/', admin.site.urls), + path("", UserLoginView.as_view(), name="login"), + path("logout/", LogoutView.as_view(), name="logout"), + path("products/", ProductListView.as_view(), name="products"), ] + +if settings.DEBUG: + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
