Spaces:
Build error
Build error
Download create_superuser.py from chartManD/cata_system: direct link, hf CLI and curl.
- Browser
- Download file 423 Bytes
-
https://huggingface.co/spaces/chartManD/cata_system/resolve/main/create_superuser.py
- Command line
-
hf download hf://spaces/chartManD/cata_system/create_superuser.py
-
curl -L -o create_superuser.py https://huggingface.co/spaces/chartManD/cata_system/resolve/main/create_superuser.py
423 Bytes
| from django.contrib.auth import get_user_model | |
| import os | |
| User = get_user_model() | |
| username = os.getenv("SUPERUSER_USERNAME") | |
| email = os.getenv("SUPERUSER_EMAIL") | |
| password = os.getenv("SUPERUSER_PASSWORD") | |
| if not User.objects.filter(username=username).exists(): | |
| User.objects.create_superuser(username=username, email=email, password=password) | |
| print("Superusuario creado") | |
| else: | |
| print("Superusuario existente") | |