Commit 04c30ab5 authored by B13nch3n's avatar B13nch3n
Browse files

Merge branch 'dev' into ci

parents 1746423e 2ec5fffc
......@@ -90,4 +90,24 @@ except:
raise
END
# create a normal user to play with the API
>&2 echo "Create user for the API & Token"
python3 manage.py shell << END
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
try:
User.objects.get(username='sib_ws5')
except User.DoesNotExist:
user = User.objects.create_user('sib_ws5', password='s1bday5ZOZO')
user.is_superuser=False
user.is_staff=False
user.save()
Token.objects.create(user=user, key='d76afaba0d07F19a9ad66bDb8e71024ce6f9a81f')
except Exception as dexc:
if str(dexc) == 'UNIQUE constraint failed: auth_user.username':
pass
except:
raise
END
exec "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment