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/
|
/front/node_modules/
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
/media/
|
/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 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():
|
class Settings():
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
|
||||||
self.secret_key='V7bvDZMztr3EU8S9g1Dipw'
|
self.secret_key='V7bvDZMztr3EU8S9g1Dipw'
|
||||||
self.redis_hosts = [("127.0.0.1", 6379)]
|
self.redis_hosts = [("127.0.0.1", 6379)]
|
||||||
self.access_token_lifetime = timedelta(minutes=480)
|
self.access_token_lifetime = timedelta(minutes=480)
|
||||||
self.refresh_token_lifetime = timedelta(days=1)
|
self.refresh_token_lifetime = timedelta(days=1)
|
||||||
self.db = {
|
self.db = {
|
||||||
'default':{
|
'default':{
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': str(os.getenv('ENGINE')),
|
||||||
'NAME': 'accounting',
|
'NAME': str(os.getenv('DBNAME')),
|
||||||
'USER': 'root',
|
'USER': str(os.getenv('USER')),
|
||||||
'PASSWORD': 'Vojn1389',
|
'PASSWORD': str(os.getenv('PASSWORD')),
|
||||||
'HOST': '127.0.0.1',
|
'HOST': str(os.getenv('HOST')),
|
||||||
'PORT': '3306',
|
'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 = request.user
|
||||||
# user = DictEmployee.objects.get(login='9966-00-125')
|
# user = DictEmployee.objects.get(login='9966-00-125')
|
||||||
now = datetime.datetime.now()
|
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)
|
votes = self.get_votes_by_status(status, now)
|
||||||
serialized_votes = VoteSerializer(votes, many=True).data
|
serialized_votes = VoteSerializer(votes, many=True).data
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ async error => {
|
|||||||
|
|
||||||
async function getVotes(status) {
|
async function getVotes(status) {
|
||||||
try {
|
try {
|
||||||
const response = await axiosApiInstance.get('/api/vote/getvotes/', {
|
const response = await axiosApiInstance.post('/api/vote/getvotes/', {
|
||||||
params: {
|
params: {
|
||||||
status,
|
status,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user