Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sifrovacka
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
sifrovacka
Commits
96ccb563
Commit
96ccb563
authored
3 years ago
by
Zdenek Kubala
Browse files
Options
Downloads
Patches
Plain Diff
set production env vars
parent
b1959230
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
django_apps/settings.py
+20
-4
20 additions, 4 deletions
django_apps/settings.py
django_apps/urls.py
+1
-0
1 addition, 0 deletions
django_apps/urls.py
sifrovacka/templates/base.html
+4
-4
4 additions, 4 deletions
sifrovacka/templates/base.html
sifrovacka/urls.py
+2
-0
2 additions, 0 deletions
sifrovacka/urls.py
with
27 additions
and
8 deletions
django_apps/settings.py
+
20
−
4
View file @
96ccb563
...
...
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from
pathlib
import
Path
from
os
import
getenv
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR
=
Path
(
__file__
).
resolve
().
parent
.
parent
...
...
@@ -20,11 +21,17 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'
django-insecure-kog+-x*xtt5e7shmxa-ddldzdtz@u#*tj^s9jzm#%&ghy*a8x%
'
SECRET_KEY
=
getenv
(
'
SECRET_KEY
'
)
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
False
#DEBUG = True
#DEBUG = False
DJANGO_ENV
=
getenv
(
'
DJANGO_ENV
'
,
'
production
'
).
lower
()
if
DJANGO_ENV
==
'
local
'
:
DEBUG
=
True
elif
DJANGO_ENV
==
'
production
'
:
DEBUG
=
False
ALLOWED_HOSTS
=
[
'
*
'
]
...
...
@@ -86,6 +93,9 @@ DATABASES = {
}
}
if
DJANGO_ENV
==
'
production
'
:
DATABASES
=
{
"
default
"
:
env
.
db
(
"
DATABASE_URL
"
)}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
...
...
@@ -136,7 +146,6 @@ LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL
=
'
index
'
# Custom settings STATIC
STATIC_URL
=
"
/static/
"
STATIC_ROOT
=
BASE_DIR
/
'
static
'
#STATICFILES_DIRS = BASE_DIR / 'static'
...
...
@@ -172,3 +181,10 @@ TINYMCE_DEFAULT_CONFIG = {
'
statusbar
'
:
True
,
}
# Custom settings Registration
ACCOUNT_ACTIVATION_DAYS
=
7
EMAIL_HOST
=
'
mail2.playzone.cz
'
EMAIL_PORT
=
587
EMAIL_USE_TLS
=
True
EMAIL_HOST_USER
=
getenv
(
'
SMTP_USER
'
)
EMAIL_HOST_PASSWORD
=
getenv
(
'
SMTP_PASSWORD
'
)
This diff is collapsed.
Click to expand it.
django_apps/urls.py
+
1
−
0
View file @
96ccb563
...
...
@@ -27,3 +27,4 @@ urlpatterns = [
if
settings
.
DEBUG
:
urlpatterns
+=
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
urlpatterns
+=
static
(
settings
.
STATIC_URL
,
document_root
=
settings
.
STATIC_ROOT
)
This diff is collapsed.
Click to expand it.
sifrovacka/templates/base.html
+
4
−
4
View file @
96ccb563
...
...
@@ -41,11 +41,11 @@
outline
:
none
;
font-size
:
15px
;
}
.active
,
.collapsible
:hover
{
background-color
:
#555
;
}
.content
{
padding
:
0
18px
;
overflow
:
hidden
;
...
...
@@ -53,7 +53,7 @@
max-height
:
0
;
transition
:
max-height
0.2s
ease-out
;
}
</style>
</style>
{% if settings.SIFROVACKA_ENV == "prod" and settings.ONBOARDING_MATOMO_ID %}
{% include "shared/matomo_snippet.html" with matomo_id=settings.ONBOARDING_MATOMO_ID %}
...
...
@@ -72,7 +72,7 @@
<div>
<div
class=
"container container--wide navbar__content navbar__content--initialized"
>
<div
class=
"navbar__brand my-4 flex items-center lg:pr-8 lg:my-0"
>
<a
href=
"/"
>
<img
src=
"https://styleguide.pir-test.eu/2.3.x/images/logo-round-white.svg"
class=
"w-8"
>
</a>
<img
src=
"https://styleguide.pir-test.eu/2.3.x/images/logo-round-white.svg"
class=
"w-8"
>
<span
class=
"pl-4 font-bold text-xl lg:border-r lg:border-grey-300 lg:pr-8"
>
<a
href=
{%
url
"
index
"%}
>
Šifrovačka
</a>
{% if settings.SIFROVACKA_ENV == "dev" %}
<sup
class=
"text-cyan-100"
>
(DEV)
</sup>
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
sifrovacka/urls.py
+
2
−
0
View file @
96ccb563
...
...
@@ -6,6 +6,8 @@ from . import views
urlpatterns
=
[
# accounts uls
# two step auth not working yet
# path('accounts/', include('django_registration.backends.activation.urls')),
path
(
'
accounts/
'
,
include
(
'
django_registration.backends.one_step.urls
'
)),
path
(
'
accounts/
'
,
include
(
'
django.contrib.auth.urls
'
)),
# the 'name' value as called by the {% url %} template tag
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment