Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/e-commerce.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
# Home Task
# Register/Login (email) -> Template





2 changes: 2 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,5 @@ env

.ipython/
.env


Empty file added backend/__init__.py
Empty file.
59 changes: 56 additions & 3 deletions backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

from pathlib import Path
import logging.config

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand All @@ -37,10 +38,21 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
'import_export',
'django.contrib.humanize',
'smart_selects',
'debug_toolbar',
'django_extensions',

]

LOCAL_APPS = [
"src.apps.accounts.apps.AccountsConfig",
"src.apps.accounts",
"src.apps.common",
"src.apps.store",
'src.apps.cart',
'src.apps.order',

]


Expand All @@ -53,11 +65,13 @@
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
'debug_toolbar.middleware.DebugToolbarMiddleware',
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",

]

ROOT_URLCONF = "config.urls"
Expand All @@ -73,6 +87,8 @@
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"src.apps.store.category_processors.all_categories",
"src.apps.cart.item_counter.counter",
],
},
},
Expand Down Expand Up @@ -124,16 +140,30 @@

USE_TZ = True

INTERNAL_IPS = [
# ...
"127.0.0.1",
# ...
]


EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'temurbekhamroyev41@gmail.com'
EMAIL_HOST_PASSWORD = 'vhdfvnfgwndxtdld'


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/


# static files
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "static"
# STATIC_ROOT = BASE_DIR / "static"
STATICFILES_DIRS = [
"config/static",
BASE_DIR / 'static',
]

# media config
Expand All @@ -145,3 +175,26 @@
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"


logging.config.dictConfig(
{
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"file": {"format": "%(asctime)s %(name)-12s %(levelname)-8s %(message)s"},
},
"handlers": {
"file": {
"level": "ERROR",
"class": "logging.FileHandler",
"formatter": "file",
"filename": "errors.log",
},
},
"loggers": {
"": {"level": "ERROR", "handlers": ["file"]},
"django.request": {"level": "INFO", "handlers": ["file"]},
},
}
)
Loading