diff --git a/src/back/.gitignore b/src/back/.gitignore index 00e319c32..5b983bbaf 100644 --- a/src/back/.gitignore +++ b/src/back/.gitignore @@ -6,4 +6,5 @@ portal/ds.py /front/node_modules/ *.sqlite3 /media/ -/static/ \ No newline at end of file +/static/ +*.env \ No newline at end of file diff --git a/src/back/portal/.envfish b/src/back/portal/.envfish new file mode 100644 index 000000000..3da11e43d --- /dev/null +++ b/src/back/portal/.envfish @@ -0,0 +1,6 @@ +ENGINE=django.db.backends.mysql +DBNAME = accounting +USER = +PASSWORD= +HOST=127.0.0.1 +PORT=3306 \ No newline at end of file diff --git a/src/back/portal/ds.py b/src/back/portal/ds.py index 5414a5646..a784c8cea 100644 --- a/src/back/portal/ds.py +++ b/src/back/portal/ds.py @@ -1,18 +1,23 @@ from datetime import timedelta +from dotenv import load_dotenv +import os +dotenv_path = os.path.join(os.path.dirname(__file__), '.env') +load_dotenv(dotenv_path) class Settings(): def __init__(self) -> None: + self.secret_key='V7bvDZMztr3EU8S9g1Dipw' self.redis_hosts = [("127.0.0.1", 6379)] self.access_token_lifetime = timedelta(minutes=480) self.refresh_token_lifetime = timedelta(days=1) self.db = { 'default':{ - 'ENGINE': 'django.db.backends.mysql', - 'NAME': 'accounting', - 'USER': 'root', - 'PASSWORD': 'Vojn1389', - 'HOST': '127.0.0.1', - 'PORT': '3306', + 'ENGINE': str(os.getenv('ENGINE')), + 'NAME': str(os.getenv('DBNAME')), + 'USER': str(os.getenv('USER')), + 'PASSWORD': str(os.getenv('PASSWORD')), + 'HOST': str(os.getenv('HOST')), + 'PORT': str(os.getenv('PORT')), } } diff --git a/src/back/portal/ds_FISH.py b/src/back/portal/ds_FISH.py deleted file mode 100644 index 455e9c99c..000000000 --- a/src/back/portal/ds_FISH.py +++ /dev/null @@ -1,8 +0,0 @@ -class Settings(): - def __init__(self) -> None: - self.secret_key='' - self.redis_hosts = [] - self.db = { - } - - pass diff --git a/src/back/vote/views.py b/src/back/vote/views.py index 8d449b60f..122f929c1 100644 --- a/src/back/vote/views.py +++ b/src/back/vote/views.py @@ -13,8 +13,8 @@ class GetVotes(APIView): user = request.user # user = DictEmployee.objects.get(login='9966-00-125') now = datetime.datetime.now() - status = request.query_params.get('status') - + status = request.data.get('params')['status'] + print(status) votes = self.get_votes_by_status(status, now) serialized_votes = VoteSerializer(votes, many=True).data diff --git a/src/front/src/utils/axios-api.js b/src/front/src/utils/axios-api.js index 7f7fc607b..2690f82b3 100644 --- a/src/front/src/utils/axios-api.js +++ b/src/front/src/utils/axios-api.js @@ -90,7 +90,7 @@ async error => { async function getVotes(status) { try { - const response = await axiosApiInstance.get('/api/vote/getvotes/', { + const response = await axiosApiInstance.post('/api/vote/getvotes/', { params: { status, }