Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cp_video_dokku
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Dzehil
cp_video_dokku
Commits
b56e90b0
You need to sign in or sign up before continuing.
Commit
b56e90b0
authored
Mar 09, 2023
by
Ilya Simonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add env for settings
parent
adb779c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
41 deletions
+32
-41
settings.py
cp_video/settings.py
+31
-9
base.cpython-39.pyc
cp_video/settings/__pycache__/base.cpython-39.pyc
+0
-0
local.cpython-39.pyc
cp_video/settings/__pycache__/local.cpython-39.pyc
+0
-0
local.py
cp_video/settings/local.py
+0
-31
manage.py
manage.py
+1
-1
No files found.
cp_video/settings
/base
.py
→
cp_video/settings.py
View file @
b56e90b0
...
...
@@ -11,6 +11,10 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import
os
import
environ
env
=
environ
.
Env
(
DEBUG
=
(
bool
,
False
))
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
...
...
@@ -19,12 +23,15 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__fil
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'o7jfem6!p5(1+jhnua$xe!h&$hk=^(krk-!j8m&y5k4xpzx=2h'
SECRET_KEY
=
env
(
'SECRET_KEY'
)
# Take environment variables from .env file
environ
.
Env
.
read_env
(
os
.
path
.
join
(
BASE_DIR
,
'.env'
))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
DEBUG
=
env
(
'DEBUG'
)
ALLOWED_HOSTS
=
[]
ALLOWED_HOSTS
=
env
(
'ALLOWED_HOSTS'
,
default
=
[])
# Application definition
...
...
@@ -77,11 +84,15 @@ WSGI_APPLICATION = 'cp_video.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# }
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
os
.
path
.
join
(
BASE_DIR
,
'db.sqlite3'
),
}
'default'
:
env
.
db
(
'DATABASE_URL'
,
default
=
'postgres://user:pass@postgreshost:5432/dbname'
),
}
...
...
@@ -126,6 +137,17 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
# Celery
CELERY_BROKER_URL
=
'redis://127.0.0.1:6379'
# https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html#using-celery-with-django
REDIS_HOST
=
'127.0.0.1'
REDIS_PORT
=
'6379'
CELERY_BROKER_URL
=
env
(
'CELERY_BROKER_URL'
,
default
=
f
'redis://{REDIS_HOST}:{REDIS_PORT}/0'
)
# AWS
AWS_STORAGE_BUCKET_NAME
=
'clutchpoints-videos'
AWS_ACCESS_KEY_ID
=
'AKIAIJTVDVADPOGYKCTA'
AWS_SECRET_ACCESS_KEY
=
'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'
AWS_REGION_NAME
=
'us-east-1'
# CloudFront
AWS_S3_CUSTOM_DOMAIN
=
'd3uwup860a90xk.cloudfront.net'
cp_video/settings/__pycache__/base.cpython-39.pyc
deleted
100644 → 0
View file @
adb779c5
File deleted
cp_video/settings/__pycache__/local.cpython-39.pyc
deleted
100644 → 0
View file @
adb779c5
File deleted
cp_video/settings/local.py
deleted
100644 → 0
View file @
adb779c5
from
.base
import
*
DEBUG
=
True
ALLOWED_HOSTS
=
[
'*'
]
INSTALLED_APPS
+=
[
'debug_toolbar'
]
MIDDLEWARE
=
MIDDLEWARE
+
[
'debug_toolbar.middleware.DebugToolbarMiddleware'
]
INTERNAL_IPS
=
(
'127.0.0.1'
,
)
# Database
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'NAME'
:
'cp_video'
,
'USER'
:
'django'
,
'PASSWORD'
:
'django'
,
'HOST'
:
'127.0.0.1'
,
}
}
# AWS
AWS_STORAGE_BUCKET_NAME
=
'clutchpoints-videos'
AWS_ACCESS_KEY_ID
=
'AKIAIJTVDVADPOGYKCTA'
AWS_SECRET_ACCESS_KEY
=
'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'
AWS_REGION_NAME
=
'us-east-1'
# CloudFront
AWS_S3_CUSTOM_DOMAIN
=
'd3uwup860a90xk.cloudfront.net'
manage.py
View file @
b56e90b0
...
...
@@ -5,7 +5,7 @@ import sys
def
main
():
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'cp_video.settings
.local
'
)
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'cp_video.settings'
)
try
:
from
django.core.management
import
execute_from_command_line
except
ImportError
as
exc
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment