settings modifications

This commit is contained in:
2024-03-03 02:56:36 +03:00
parent f602d2b39e
commit d85fa03da7
10 changed files with 76 additions and 37 deletions
+1
View File
@@ -1 +1,2 @@
SECRET_KEY=
ENVIRONMENT=
+16 -21
View File
@@ -4,26 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="03e03f4d-45bc-4bed-b39e-371f1d24898e" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.env" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.env.example" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/store.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Pipfile" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Pipfile.lock" afterDir="false" />
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/db.sqlite3" afterDir="false" />
<change afterPath="$PROJECT_DIR$/manage.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/store/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/store/asgi.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/store/settings.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/store/urls.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/store/wsgi.py" afterDir="false" />
<list default="true" id="03e03f4d-45bc-4bed-b39e-371f1d24898e" name="Changes" comment="Initial commit">
<change beforePath="$PROJECT_DIR$/.env.example" beforeDir="false" afterPath="$PROJECT_DIR$/.env.example" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/store/settings.py" beforeDir="false" afterPath="$PROJECT_DIR$/store/settings.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -106,8 +90,17 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1709421008833</updated>
<workItem from="1709421138204" duration="1545000" />
<workItem from="1709421138204" duration="2573000" />
</task>
<task id="LOCAL-00001" summary="Initial commit">
<option name="closed" value="true" />
<created>1709422770100</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1709422770100</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -118,5 +111,7 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="Initial commit" />
<option name="LAST_COMMIT_MESSAGE" value="Initial commit" />
</component>
</project>
View File
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+6
View File
@@ -0,0 +1,6 @@
from django.apps import AppConfig
class ProductsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'products'
View File
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+3
View File
@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.
+30 -5
View File
@@ -16,7 +16,6 @@ import os
load_dotenv()
ENVIRONMENT = os.environ.get('ENVIRONMENT')
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@@ -38,8 +37,7 @@ elif ENVIRONMENT == 'development':
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
DJANGO_APPS = ['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
@@ -47,6 +45,16 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
]
THIRD_PARTY_APPS = [
'rest_framework'
]
LOCAL_APPS = [
'products.apps.ProductsConfig',
]
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
@@ -62,7 +70,7 @@ ROOT_URLCONF = 'store.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates']
'DIRS': []
,
'APP_DIRS': True,
'OPTIONS': {
@@ -81,13 +89,30 @@ WSGI_APPLICATION = 'store.wsgi.application'
# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR / 'db.sqlite3',
# }
# }
if ENVIRONMENT == 'development':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
elif ENVIRONMENT == 'production':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get("DB_NAME"),
'USER': os.environ.get("DB_USER"),
'PASSWORD': os.environ.get("DB_PASSWORD"),
'HOST': os.environ.get("DB_HOST")
}
}
# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators