Skip to content

Commit

Permalink
add option to connect to project specific database
Browse files Browse the repository at this point in the history
  • Loading branch information
uprel committed Oct 14, 2021
1 parent 58d0790 commit adc5bd1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/wsgi/data.wsgi
Expand Up @@ -25,14 +25,13 @@ import psycopg2.extras #z.b. für named column indexes
import json
import sys
import os
import importlib

# append the Python path with the wsgi-directory
qwcPath = os.path.dirname(__file__)
if not qwcPath in sys.path:
sys.path.append(qwcPath)

import qwc_connect

def application(environ, start_response):
request = Request(environ)
filt = [];
Expand All @@ -42,6 +41,13 @@ def application(environ, start_response):

try:

#which connection to load
connect = "qwc_connect"
if "connect" in request.params:
connect = request.params["connect"]

qwc_connect = importlib.import_module(connect)

table = request.params["table"]
gtype = request.params["gtype"]
categoryString = ''
Expand Down

0 comments on commit adc5bd1

Please sign in to comment.