Commit 3a881f83 authored by sim's avatar sim

[CONF] Move django secrets and local settings in gargantext.ini

parent 81b1aba8
......@@ -20,6 +20,7 @@ SQLAlchemy-Utils = "*"
django-celery = "*"
djangorestframework = "*"
djangorestframework-jwt = "*"
python-decouple = "*"
[requires]
......
{
"_meta": {
"hash": {
"sha256": "812bbbd579361fcd66f99a5fe8a453e712b008fcabd276b4cc803c955a3fc14c"
"sha256": "53e18b75e4a0cfdcafd2ff47bd1d6772a5638f975b59fe95f4575e4086f60346"
},
"host-environment-markers": {
"implementation_name": "cpython",
......@@ -160,6 +160,12 @@
],
"version": "==2.6.1"
},
"python-decouple": {
"hashes": [
"sha256:1317df14b43efee4337a4aa02914bf004f010cd56d6c4bd894e6474ec8c4fe2d"
],
"version": "==3.1"
},
"pytz": {
"hashes": [
"sha256:80af0f3008046b9975242012a985f04c5df1f01eed4ec1633d56cc47a75a6a48",
......
# django.ini file
[uwsgi]
[django]
DEBUG = True
SECRET_KEY = !%ktkh981)piil1%t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5%
DB_PASS = C8kdcUrAQy66U
[uwsgi]
env = DJANGO_SETTINGS_MODULE=gargantext.settings
#module = django.core.handlers.wsgi:WSGIHandler()
......
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='.')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment