Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hacky implementation of create_debug_users.py #68

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions create_debug_users.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
#!/usr/bin/env python3

from __future__ import annotations

import os
import subprocess
import sys
from getpass import getpass

import django

if not __file__.endswith("shell.py"):
subprocess.call(
[
sys.executable,
os.path.join(os.path.dirname(__file__), "manage.py"),
"shell",
"-c",
open(__file__).read(),
]
)
exit()
import tin.tests.create_users as users


from tin.tests.create_users import add_users_to_database
def main():
# hide user password from showing on terminal
password = getpass("Enter password for all users: ")
users.add_users_to_database(password=password, verbose=True)

password = input("Enter password for all users: ")

add_users_to_database(password=password, verbose=True)
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tin.settings")
django.setup()
main()
Loading