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
6eb50501
Commit
6eb50501
authored
Nov 03, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CONF] Move django secrets and local settings in gargantext.ini
parent
24cd6f49
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
13 deletions
+44
-13
Pipfile
Pipfile
+1
-0
Pipfile.lock
Pipfile.lock
+7
-1
gargantext.ini
gargantext.ini
+6
-2
settings.py
gargantext/settings.py
+12
-10
config.py
gargantext/util/config.py
+18
-0
No files found.
Pipfile
View file @
6eb50501
...
@@ -20,6 +20,7 @@ SQLAlchemy-Utils = "*"
...
@@ -20,6 +20,7 @@ SQLAlchemy-Utils = "*"
django-celery = "*"
django-celery = "*"
djangorestframework = "*"
djangorestframework = "*"
djangorestframework-jwt = "*"
djangorestframework-jwt = "*"
python-decouple = "*"
[requires]
[requires]
...
...
Pipfile.lock
View file @
6eb50501
{
{
"_meta": {
"_meta": {
"hash": {
"hash": {
"sha256": "
812bbbd579361fcd66f99a5fe8a453e712b008fcabd276b4cc803c955a3fc14c
"
"sha256": "
53e18b75e4a0cfdcafd2ff47bd1d6772a5638f975b59fe95f4575e4086f60346
"
},
},
"host-environment-markers": {
"host-environment-markers": {
"implementation_name": "cpython",
"implementation_name": "cpython",
...
@@ -160,6 +160,12 @@
...
@@ -160,6 +160,12 @@
],
],
"version": "==2.6.1"
"version": "==2.6.1"
},
},
"python-decouple": {
"hashes": [
"sha256:1317df14b43efee4337a4aa02914bf004f010cd56d6c4bd894e6474ec8c4fe2d"
],
"version": "==3.1"
},
"pytz": {
"pytz": {
"hashes": [
"hashes": [
"sha256:80af0f3008046b9975242012a985f04c5df1f01eed4ec1633d56cc47a75a6a48",
"sha256:80af0f3008046b9975242012a985f04c5df1f01eed4ec1633d56cc47a75a6a48",
...
...
gargantext.ini
View file @
6eb50501
# django.ini file
[django]
[uwsgi]
DEBUG
=
True
SECRET_KEY
=
!%ktkh981)piil1%t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5%
DB_PASS
=
C8kdcUrAQy66U
[uwsgi]
env
=
DJANGO_SETTINGS_MODULE=gargantext.settings
env
=
DJANGO_SETTINGS_MODULE=gargantext.settings
#module = django.core.handlers.wsgi:WSGIHandler()
#module = django.core.handlers.wsgi:WSGIHandler()
...
...
gargantext/settings.py
View file @
6eb50501
...
@@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
...
@@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
"""
"""
import
os
import
os
from
gargantext.util.config
import
config
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
...
@@ -20,13 +22,13 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
...
@@ -20,13 +22,13 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'!
%
ktkh981)piil1
%
t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5
%
'
SECRET_KEY
=
config
(
'SECRET_KEY'
)
# SECURITY WARNING: don't run with debug turned on in production!
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
DEBUG
=
config
(
'DEBUG'
,
default
=
False
,
cast
=
bool
)
MAINTENANCE
=
False
MAINTENANCE
=
config
(
'MAINTENANCE'
,
default
=
False
,
cast
=
bool
)
ALLOWED_HOSTS
=
[]
ALLOWED_HOSTS
=
config
(
'ALLOWED_HOSTS'
,
default
=
''
,
cast
=
lambda
v
:
list
(
filter
(
None
,
v
.
split
(
' '
))))
# Application definition
# Application definition
...
@@ -79,11 +81,11 @@ WSGI_APPLICATION = 'gargantext.wsgi.application'
...
@@ -79,11 +81,11 @@ WSGI_APPLICATION = 'gargantext.wsgi.application'
DATABASES
=
{
DATABASES
=
{
'default'
:
{
'default'
:
{
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'NAME'
:
'gargandb'
,
'NAME'
:
config
(
'DB_NAME'
,
default
=
'gargandb'
)
,
'USER'
:
'gargantua'
,
'USER'
:
config
(
'DB_USER'
,
default
=
'gargantua'
)
,
'PASSWORD'
:
'C8kdcUrAQy66U'
,
'PASSWORD'
:
config
(
'DB_PASS'
)
,
'HOST'
:
'127.0.0.1'
,
'HOST'
:
config
(
'DB_HOST'
,
default
=
'127.0.0.1'
)
,
'PORT'
:
'5432'
,
'PORT'
:
config
(
'DB_PORT'
,
default
=
'5432'
)
,
'TEST'
:
{
'TEST'
:
{
'NAME'
:
'test_gargandb'
,
'NAME'
:
'test_gargandb'
,
},
},
...
@@ -193,4 +195,4 @@ API_TOKENS = {
...
@@ -193,4 +195,4 @@ API_TOKENS = {
# BOOL Interpreter
# BOOL Interpreter
BOOL_TOOLS_PATH
=
"/srv/gargantext/
gargantext/util/crawlers/sparql"
BOOL_TOOLS_PATH
=
"
gargantext/util/crawlers/sparql"
gargantext/util/config.py
0 → 100644
View file @
6eb50501
from
configparser
import
RawConfigParser
from
decouple
import
AutoConfig
,
RepositoryIni
class
GargantextIni
(
RepositoryIni
):
SECTION
=
'django'
def
__init__
(
self
,
source
):
self
.
parser
=
RawConfigParser
()
with
open
(
source
)
as
file_
:
self
.
parser
.
readfp
(
file_
)
class
GargantextConfig
(
AutoConfig
):
SUPPORTED
=
{
'gargantext.ini'
:
GargantextIni
}
config
=
GargantextConfig
(
search_path
=
'.'
)
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