Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
26130f6e
Commit
26130f6e
authored
Dec 05, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CONF] Add django timezone to have correct log timestamps
parent
7eec499e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
settings.py
gargantext/backend/settings.py
+2
-2
gargantext.template.ini
tools/conf/gargantext.template.ini
+2
-0
mkconf.sh
tools/mkconf.sh
+8
-0
No files found.
gargantext/backend/settings.py
View file @
26130f6e
...
@@ -120,7 +120,7 @@ AUTH_PASSWORD_VALIDATORS = [
...
@@ -120,7 +120,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE
=
'en-us'
LANGUAGE_CODE
=
'en-us'
TIME_ZONE
=
'UTC'
TIME_ZONE
=
config
(
'TIME_ZONE'
,
default
=
'UTC'
)
USE_I18N
=
True
USE_I18N
=
True
...
@@ -154,7 +154,7 @@ djcelery.setup_loader()
...
@@ -154,7 +154,7 @@ djcelery.setup_loader()
BROKER_URL
=
'amqp://guest:guest@localhost:5672/'
BROKER_URL
=
'amqp://guest:guest@localhost:5672/'
CELERY_ACCEPT_CONTENT
=
[
'pickle'
,
'json'
,
'msgpack'
,
'yaml'
]
CELERY_ACCEPT_CONTENT
=
[
'pickle'
,
'json'
,
'msgpack'
,
'yaml'
]
CELERY_TIMEZONE
=
'Europe/Paris'
CELERY_TIMEZONE
=
TIME_ZONE
CELERYBEAT_SCHEDULER
=
'djcelery.schedulers.DatabaseScheduler'
CELERYBEAT_SCHEDULER
=
'djcelery.schedulers.DatabaseScheduler'
CELERY_IMPORTS
=
(
CELERY_IMPORTS
=
(
"gargantext.util.toolchain"
,
"gargantext.util.toolchain"
,
...
...
tools/conf/gargantext.template.ini
View file @
26130f6e
...
@@ -6,6 +6,8 @@ DEBUG = {DEBUG}
...
@@ -6,6 +6,8 @@ DEBUG = {DEBUG}
SECRET_KEY
=
{SECRET_KEY}
SECRET_KEY
=
{SECRET_KEY}
# Space-separated list of hosts
# Space-separated list of hosts
ALLOWED_HOSTS
=
ALLOWED_HOSTS
=
# Time-zone, possible values here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TIME_ZONE
=
{TIME_ZONE}
# PostgreSQL access
# PostgreSQL access
DB_HOST
=
{DB_HOST}
DB_HOST
=
{DB_HOST}
DB_PORT
=
{DB_PORT}
DB_PORT
=
{DB_PORT}
...
...
tools/mkconf.sh
View file @
26130f6e
...
@@ -82,6 +82,12 @@ fi
...
@@ -82,6 +82,12 @@ fi
echo
"▸ Generate secret key for Django..."
echo
"▸ Generate secret key for Django..."
SECRET_KEY
=
$(
pipenv run python ./tools/gensecret.py 2>/dev/null
)
SECRET_KEY
=
$(
pipenv run python ./tools/gensecret.py 2>/dev/null
)
TIME_ZONE
=
$((
timedatectl
|
grep
'Time zone'
|
sed
-
E
's/^\s*Time zone:\s*(\S+).*$/\1/g'
)
2
>/
dev/null
)
if
[
-
z
"
$TIME_ZONE
"
]
;
then
echo
"WARNING: Couldn't find out local timezone, fallback to UTC."
TIME_ZONE
=
${
TIME_ZONE
:-
UTC
}
fi
echo
"▸ PostgreSQL configuration..."
echo
"▸ PostgreSQL configuration..."
DB_NAME_DEFAULT
=
gargandb
DB_NAME_DEFAULT
=
gargandb
...
@@ -132,6 +138,7 @@ DB_URI="postgres://"$(escape_url "$PGREST_USER")":"$(escape_url "$PGREST_PASS")"
...
@@ -132,6 +138,7 @@ DB_URI="postgres://"$(escape_url "$PGREST_USER")":"$(escape_url "$PGREST_PASS")"
PGREST_DB_URI
=
$(
escape_pgrest
"
$DB_URI
"
)
PGREST_DB_URI
=
$(
escape_pgrest
"
$DB_URI
"
)
PGREST_SECRET_KEY
=
$(
escape_pgrest
"
$SECRET_KEY
"
)
PGREST_SECRET_KEY
=
$(
escape_pgrest
"
$SECRET_KEY
"
)
SECRET_KEY
=
$(
escape_ini
"
$SECRET_KEY
"
)
SECRET_KEY
=
$(
escape_ini
"
$SECRET_KEY
"
)
TIME_ZONE
=
$(
escape_ini
"
$TIME_ZONE
"
)
DB_HOST
=
$(
escape_ini
"
${
DB_HOST
:-
127
.0.0.1
}
"
)
DB_HOST
=
$(
escape_ini
"
${
DB_HOST
:-
127
.0.0.1
}
"
)
DB_PORT
=
$(
escape_ini
"
${
DB_PORT
:-
5432
}
"
)
DB_PORT
=
$(
escape_ini
"
${
DB_PORT
:-
5432
}
"
)
DB_NAME
=
$(
escape_ini
"
$DB_NAME
"
)
DB_NAME
=
$(
escape_ini
"
$DB_NAME
"
)
...
@@ -142,6 +149,7 @@ VENV=$(escape_ini "$VENV")
...
@@ -142,6 +149,7 @@ VENV=$(escape_ini "$VENV")
echo
"▸ Generate configuration file from
$GARGANTEXT_TEMPLATE
..."
echo
"▸ Generate configuration file from
$GARGANTEXT_TEMPLATE
..."
sed
-
E
-
e
"s/[{]DEBUG[}]/
$DEBUG
/g"
\
sed
-
E
-
e
"s/[{]DEBUG[}]/
$DEBUG
/g"
\
-
e
"s/[{]SECRET_KEY[}]/
$SECRET_KEY
/g"
\
-
e
"s/[{]SECRET_KEY[}]/
$SECRET_KEY
/g"
\
-
e
"s/[{]TIME_ZONE[}]/
$TIME_ZONE
/g"
\
-
e
"s/[{]DB_HOST[}]/
$DB_HOST
/g"
\
-
e
"s/[{]DB_HOST[}]/
$DB_HOST
/g"
\
-
e
"s/[{]DB_PORT[}]/
$DB_PORT
/g"
\
-
e
"s/[{]DB_PORT[}]/
$DB_PORT
/g"
\
-
e
"s/[{]DB_NAME[}]/
$DB_NAME
/g"
\
-
e
"s/[{]DB_NAME[}]/
$DB_NAME
/g"
\
...
...
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