Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Ahmed Bilal | a1f1c5708f |
|
@ -1,4 +1,3 @@
|
|||
SECRET_KEY=ldskjflkdsnejnjsdnf
|
||||
DEBUG=False
|
||||
ENABLE_DEBUG_LOG=True
|
||||
ALLOWED_HOSTS=localhost,.ungleich.ch
|
||||
ENABLE_DEBUG_LOG=True
|
|
@ -4,7 +4,6 @@ from rest_framework import exceptions
|
|||
from rest_framework import authentication
|
||||
import json
|
||||
import logging
|
||||
import pyotp
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -22,13 +21,7 @@ class OTPSeed(AbstractUser):
|
|||
"""
|
||||
inject username to ensure it stays unique / is setup at all
|
||||
"""
|
||||
if not self.is_superuser:
|
||||
self.username = "{}@{}".format(self.name, self.realm)
|
||||
else:
|
||||
self.name = self.username
|
||||
self.realm = "ungleich-admin"
|
||||
self.seed = pyotp.random_base32()
|
||||
|
||||
self.username = "{}@{}".format(self.name, self.realm)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
pyotp>=2.2.6
|
||||
django==2.2.16
|
||||
django>=2.1.2
|
||||
djangorestframework
|
||||
python-decouple>=3.1
|
||||
|
||||
# DB
|
||||
psycopg2>=2.8,<2.9
|
||||
psycopg2-binary
|
||||
|
||||
# Recommended
|
||||
markdown
|
||||
|
|
|
@ -132,7 +132,9 @@ DEBUG_DATABASES = {
|
|||
}
|
||||
|
||||
DEBUG = config('DEBUG', False, cast=bool)
|
||||
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='localhost', cast=Csv())
|
||||
ALLOWED_HOSTS = [
|
||||
".ungleich.ch"
|
||||
]
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
|
|
Loading…
Reference in New Issue