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
7885316c
Commit
7885316c
authored
Nov 08, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Can change path of Gargantext config file
parent
5f73fcdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
config.py
gargantext/util/config.py
+7
-2
mkenv.sh
tools/mkenv.sh
+22
-3
No files found.
gargantext/util/config.py
View file @
7885316c
import
os
from
configparser
import
RawConfigParser
from
decouple
import
AutoConfig
,
RepositoryIni
SEARCH_PATH
,
GARGANTEXT_CONF
=
\
os
.
path
.
split
(
os
.
environ
.
get
(
'GARGANTEXT_CONF'
,
'gargantext.ini'
))
class
GargantextIni
(
RepositoryIni
):
SECTION
=
'django'
...
...
@@ -12,7 +17,7 @@ class GargantextIni(RepositoryIni):
class
GargantextConfig
(
AutoConfig
):
SUPPORTED
=
{
'gargantext.ini'
:
GargantextIni
}
SUPPORTED
=
{
GARGANTEXT_CONF
:
GargantextIni
}
config
=
GargantextConfig
(
search_path
=
'.'
)
config
=
GargantextConfig
(
search_path
=
SEARCH_PATH
or
'.'
)
tools/mkenv.sh
View file @
7885316c
#!/
bin/
sh
#!/
usr/bin/env ba
sh
echo
"# Automatically generated file, local changes may be overwritten"
>
.env
echo
"DJANGO_SETTINGS_MODULE=gargantext.settings"
>>
.env
ENV_FILE
=
.env
read
-r
-d
''
DJANGO_VAR
<<
EOF
# Django settings module, it is unlikely that you'll need to change that
DJANGO_SETTINGS_MODULE=gargantext.settings
EOF
build_env
()
{
cat
<<
EOF
>
$ENV_FILE
$DJANGO_VAR
# Path to gargantext configuration file, you're welcome to change that; when
# a simple filename is given, it'll be searched in current directory
GARGANTEXT_CONF=gargantext.ini
EOF
}
update_env
()
{
grep
-Eq
'^\s*DJANGO_SETTINGS_MODULE\s*='
"
$ENV_FILE
"
||
echo
"
$DJANGO_VAR
"
>>
"
$ENV_FILE
"
}
[
-f
"
$ENV_FILE
"
]
&&
update_env
||
build_env
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