feat: added gonk and qol

This commit is contained in:
2025-01-08 16:27:45 +01:00
parent 7d021ebaa0
commit fc0cdad246
4 changed files with 691 additions and 161 deletions
+6 -5
View File
@@ -30,6 +30,7 @@ THIRD_PARTY_APPS = [
"django_filters", "django_filters",
"watchman", "watchman",
"drf_spectacular", "drf_spectacular",
"gonk",
"rest_framework_simplejwt", "rest_framework_simplejwt",
"tailwind", "tailwind",
] ]
@@ -87,14 +88,14 @@ WSGI_APPLICATION = "config.wsgi.application"
# Database # Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases # https://docs.djangoproject.com/en/5.1/ref/settings/#databases
DATABASES = { DATABASES = {
"default": DATABASE_URL, "default": DATABASE_URL,
} }
# Password validation # Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [ AUTH_PASSWORD_VALIDATORS = [
{ {
@@ -113,7 +114,7 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/ # https://docs.djangoproject.com/en/5.1/topics/i18n/
LANGUAGE_CODE = "es-es" LANGUAGE_CODE = "es-es"
@@ -127,7 +128,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/ # https://docs.djangoproject.com/en/5.1/howto/static-files/
STATIC_URL = "/static/" STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "static" STATIC_ROOT = BASE_DIR / "static"
@@ -184,7 +185,7 @@ SPECTACULAR_SETTINGS = {
"SERVE_INCLUDE_SCHEMA": False, "SERVE_INCLUDE_SCHEMA": False,
} }
CELERY_BROKER_URL = env.str("CELERY_BROKER_URL", default="redis://172.17.0.1:6379/0") CELERY_BROKER_URL = env.str("CELERY_BROKER_URL", default="memory://localhost:8000//")
CELERY_TIME_ZONE = TIME_ZONE CELERY_TIME_ZONE = TIME_ZONE
CELERY_ALWAYS_EAGER = DEBUG CELERY_ALWAYS_EAGER = DEBUG
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -1,6 +1,7 @@
boto3==1.34.105 boto3==1.34.105
celery==5.4.0 celery==5.4.0
django==5.1.3 django==5.1.4
django-celery-beat==2.7.0
django-cors-headers==3.13.0 django-cors-headers==3.13.0
django-cryptography==1.1 django-cryptography==1.1
django-debug-toolbar==4.4.6 django-debug-toolbar==4.4.6
@@ -14,8 +15,9 @@ django-tailwind==3.8.0
django-unfold==0.42.0 django-unfold==0.42.0
djangorestframework==3.15.2 djangorestframework==3.15.2
dj-database-url==1.0.0 dj-database-url==1.0.0
djangorestframework-simplejwt==5.3.1 djangorestframework-simplejwt==5.4.0
drf-spectacular==0.26.1 drf-spectacular==0.26.1
gonk==0.6.1
ipython==8.16.1 ipython==8.16.1
Pillow==11.0.0 Pillow==11.0.0
psycopg2-binary==2.9.9 psycopg2-binary==2.9.9
+19 -11
View File
@@ -1,5 +1,7 @@
from django.urls import path from django.urls import path
from django.conf.urls.i18n import i18n_patterns
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.utils.text import gettext_lazy as _
from web.views.components import ( from web.views.components import (
cart, cart,
cart_dropdown, cart_dropdown,
@@ -24,19 +26,22 @@ from web.views.web import (
app_name = "web" app_name = "web"
urlpatterns = [ i18n_resolvers = i18n_patterns(
path("", index, name="index"), path("", index, name="index"),
path("wishlist", login_required(wishlist, login_url="/login/"), name="wishlist"), path(_("wishlist"), login_required(wishlist, login_url="/login/"), name="wishlist"),
path("categories/<str:slug>/", category_view, name="category_view"), path(_("categories/<str:slug>/"), category_view, name="category_view"),
path("products/<int:pk>/<str:slug>/", product_detail, name="product_detail"), path(_("products/<int:pk>/<str:slug>/"), product_detail, name="product_detail"),
path("cart/", cart_detail, name="cart_detail"), path(_("cart/"), cart_detail, name="cart_detail"),
path("order/<str:uuid>/", order_detail, name="order"), path(_("order/<str:uuid>/"), order_detail, name="order"),
# users # users
path("login/", login, name="login"), path(_("login/"), login, name="login"),
path("logout/", logout, name="logout"), path(_("logout/"), logout, name="logout"),
path("register/", register, name="register"), path(_("register/"), register, name="register"),
path("reset-password/", reset_password, name="reset-password"), path(_("reset-password/"), reset_password, name="reset-password"),
path("my-account/", my_account, name="my_account"), path(_("my-account/"), my_account, name="my_account"),
)
urlpatterns = [
# components # components
path("web/components/products/", list_products, name="list_products"), path("web/components/products/", list_products, name="list_products"),
path( path(
@@ -63,3 +68,6 @@ urlpatterns = [
# manifest # manifest
path("manifest.json", manifest, name="manifest_json"), path("manifest.json", manifest, name="manifest_json"),
] ]
for resolver in i18n_resolvers:
urlpatterns += resolver.url_patterns