def initialize_data():
    # To use this, import into django shell and run it.
    # Should I restructure this to run it directly from cli?

    # Create superuser, and regular user.
    ru_username = os.environ['RU_USERNAME']
    su_username = os.environ['SU_USERNAME']

    try:
        su = User.objects.create_superuser(username=su_username,
                                           password=os.environ['SU_PASSWORD'],
                                           email='')
        add_userprofile(su)
        print("Created superuser %s." % su_username)
    except IntegrityError:
        print('The user %s already exists.' % su_username)
        su = User.objects.filter(username=su_username)[0]

    try:
        ru = User.objects.create_user(username=ru_username,
                                      password=os.environ['RU_PASSWORD'])
        add_userprofile(ru)
        print("Created regular user %s." % ru_username)
    except IntegrityError:
        print('The user %s already exists.' % ru_username)
        ru = User.objects.filter(username=ru_username)[0]
Do some housekeeping (cache expiration, timeout handling).
dataset/ETHPy150Open openlearningtools/opencompetencies/competencies/my_admin.py/initialize_data--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python3-alpha/python-libs/pyxmpp2/client.py/Client.regular_tasks