This commit is contained in:
1 parent
7da9fa3d14
commit
02bd680383
6 files changed
+22
-18
No files matched your search
+2
-1
@@ -6,4 +6,5 @@ portal/ds.py
|
||||
/front/node_modules/
|
||||
*.sqlite3
|
||||
/media/
|
||||
/static/
|
||||
/static/
|
||||
*.env
|
||||
@@ -0,0 +1,6 @@
|
||||
ENGINE=django.db.backends.mysql
|
||||
DBNAME = accounting
|
||||
USER =
|
||||
PASSWORD=
|
||||
HOST=127.0.0.1
|
||||
PORT=3306
|
||||
+11
-6
@@ -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')),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
class Settings():
|
||||
def __init__(self) -> None:
|
||||
self.secret_key=''
|
||||
self.redis_hosts = []
|
||||
self.db = {
|
||||
}
|
||||
|
||||
pass
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user