# Path: user/models.py
# class Profile(models.Model):
#     user = models.OneToOneField(
#         settings.AUTH_USER_MODEL)
#     name = models.CharField(
#         max_length=255)
#     slug = models.SlugField(
#         max_length=30,
#         unique=True)
#     about = models.TextField()
#     joined = models.DateTimeField(
#         "Date Joined",
#         auto_now_add=True)
# 
#     objects = ProfileManager()
# 
#     def __str__(self):
#         return self.user.get_username()
# 
#     def get_absolute_url(self):
#         return reverse(
#             'dj-auth:public_profile',
#             kwargs={'slug': self.slug})
# 
#     def get_update_url(self):
#         return reverse('dj-auth:profile_update')
# 
#     def natural_key(self):
#         return (self.slug,)
#     natural_key.dependencies = ['user.user']


import getpass
import sys
from django.contrib.auth import get_user_model
from django.core.exceptions import (
    ObjectDoesNotExist, ValidationError)
from django.core.management.base import (
    BaseCommand, CommandError)
from django.utils.encoding import force_str
from django.utils.text import capfirst, slugify
from user.models import Profile




class Command(BaseCommand):
    help = 'Create new User with Profile.'

    required_error = (
        'You must use --{} with --noinput.')

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.User = get_user_model()
        self.name_field = (

# Path: user/models.py
# class Profile(models.Model):
#     user = models.OneToOneField(
#         settings.AUTH_USER_MODEL)
#     name = models.CharField(
#         max_length=255)
#     slug = models.SlugField(
#         max_length=30,
#         unique=True)
#     about = models.TextField()
#     joined = models.DateTimeField(
#         "Date Joined",
#         auto_now_add=True)
# 
#     objects = ProfileManager()
# 
#     def __str__(self):
#         return self.user.get_username()
# 
#     def get_absolute_url(self):
#         return reverse(
#             'dj-auth:public_profile',
#             kwargs={'slug': self.slug})
# 
#     def get_update_url(self):
#         return reverse('dj-auth:profile_update')
# 
#     def natural_key(self):
#         return (self.slug,)
#     natural_key.dependencies = ['user.user']


# Path: user/management/commands/createuser.py
import getpass
import sys
from django.contrib.auth import get_user_model
from django.core.exceptions import (
    ObjectDoesNotExist, ValidationError)
from django.core.management.base import (
    BaseCommand, CommandError)
from django.utils.encoding import force_str
from django.utils.text import capfirst, slugify
from user.models import Profile





class Command(BaseCommand):
    help = 'Create new User with Profile.'

    required_error = (
        'You must use --{} with --noinput.')

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.User = get_user_model()
        self.name_field = (

            Profile._meta.get_field('name'))