mirror of
https://github.com/andwati/store-api.git
synced 2026-10-29 14:22:14 +00:00
settings modifications
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
SECRET_KEY=
|
SECRET_KEY=
|
||||||
|
ENVIRONMENT=
|
||||||
Generated
+16
-21
@@ -4,26 +4,10 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="03e03f4d-45bc-4bed-b39e-371f1d24898e" name="Changes" comment="">
|
<list default="true" id="03e03f4d-45bc-4bed-b39e-371f1d24898e" name="Changes" comment="Initial commit">
|
||||||
<change afterPath="$PROJECT_DIR$/.env" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.env.example" beforeDir="false" afterPath="$PROJECT_DIR$/.env.example" afterDir="false" />
|
||||||
<change 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 afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/store/settings.py" beforeDir="false" afterPath="$PROJECT_DIR$/store/settings.py" 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>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -106,8 +90,17 @@
|
|||||||
<option name="number" value="Default" />
|
<option name="number" value="Default" />
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1709421008833</updated>
|
<updated>1709421008833</updated>
|
||||||
<workItem from="1709421138204" duration="1545000" />
|
<workItem from="1709421138204" duration="2573000" />
|
||||||
</task>
|
</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 />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -118,5 +111,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||||
|
<MESSAGE value="Initial commit" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Initial commit" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class ProductsConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'products'
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
||||||
+40
-15
@@ -16,7 +16,6 @@ import os
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
ENVIRONMENT = os.environ.get('ENVIRONMENT')
|
ENVIRONMENT = os.environ.get('ENVIRONMENT')
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
@@ -38,15 +37,24 @@ elif ENVIRONMENT == 'development':
|
|||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
DJANGO_APPS = ['django.contrib.admin',
|
||||||
'django.contrib.admin',
|
'django.contrib.auth',
|
||||||
'django.contrib.auth',
|
'django.contrib.contenttypes',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.sessions',
|
||||||
'django.contrib.sessions',
|
'django.contrib.messages',
|
||||||
'django.contrib.messages',
|
'django.contrib.staticfiles',
|
||||||
'django.contrib.staticfiles',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
THIRD_PARTY_APPS = [
|
||||||
|
'rest_framework'
|
||||||
|
]
|
||||||
|
|
||||||
|
LOCAL_APPS = [
|
||||||
|
'products.apps.ProductsConfig',
|
||||||
|
]
|
||||||
|
|
||||||
|
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
@@ -62,7 +70,7 @@ ROOT_URLCONF = 'store.urls'
|
|||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [BASE_DIR / 'templates']
|
'DIRS': []
|
||||||
,
|
,
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
@@ -81,13 +89,30 @@ WSGI_APPLICATION = 'store.wsgi.application'
|
|||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
# DATABASES = {
|
||||||
'default': {
|
# 'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
# 'ENGINE': 'django.db.backends.sqlite3',
|
||||||
'NAME': BASE_DIR / 'db.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
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user