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
36ffd264
Commit
36ffd264
authored
Jul 04, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] Move database url in settings to share it
parent
d664a75e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
settings.py
gargantext/settings.py
+4
-1
db.py
gargantext/util/db.py
+1
-4
No files found.
gargantext/settings.py
View file @
36ffd264
...
...
@@ -140,7 +140,10 @@ DATABASES = {
},
}
}
DATABASES
[
'default'
][
'URL'
]
=
\
'postgresql+psycopg2://{USER}:{PASSWORD}@{HOST}:{PORT}/{NAME}'
.
format
(
**
DATABASES
[
'default'
]
)
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
...
...
gargantext/util/db.py
View file @
36ffd264
...
...
@@ -10,10 +10,7 @@ from sqlalchemy import delete
def
get_engine
():
from
sqlalchemy
import
create_engine
url
=
'postgresql+psycopg2://{USER}:{PASSWORD}@{HOST}:{PORT}/{NAME}'
.
format
(
**
settings
.
DATABASES
[
'default'
]
)
return
create_engine
(
url
return
create_engine
(
settings
.
DATABASES
[
'default'
][
'URL'
]
,
use_native_hstore
=
True
,
json_serializer
=
json_dumps
,
pool_size
=
20
,
max_overflow
=
0
...
...
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