Spaces:
Runtime error
Runtime error
Download app.py from pplonski/deploy-mercury: direct link, hf CLI and curl.
- Browser
- Download file 483 Bytes
-
https://huggingface.co/spaces/pplonski/deploy-mercury/resolve/main/app.py
- Command line
-
hf download hf://spaces/pplonski/deploy-mercury/app.py
-
curl -L -o app.py https://huggingface.co/spaces/pplonski/deploy-mercury/resolve/main/app.py
483 Bytes
| import os | |
| from subprocess import Popen | |
| os.environ["ALLOWED_HOSTS"] = "pplonski-deploy-mercury.hf.space" | |
| os.environ["DJANGO_SUPERUSER_PASSWORD"] = "test" | |
| os.environ["DJANGO_SUPERUSER_USERNAME"] = "test" | |
| os.environ["DJANGO_SUPERUSER_EMAIL"] = "test@example.com" | |
| command = ["mercury", "createsuperuser", "--noinput"] | |
| worker = Popen(command) | |
| worker.wait() | |
| command = ["mercury", "run", f"0.0.0.0:{os.environ.get('PORT', 7860)}", "--verbose"] | |
| worker = Popen(command) | |
| worker.wait() |