input: Write a function to create a Django application with a model that stores the name, address, and email of a user. The function should handle the creation of the Django project, definition of the User model, and the migration of the models. If the operation is successful, return 'Django app created and migrated successfully'. If there is an error during any step, return 'Operation failed'.
  
  assert create_django_app() == 'Django app created and migrated successfully'
output: 
  def create_django_app():
      try:
          import os
          from django.core.management import call_command
          from django.db import models
          from django.apps import AppConfig
  
          # Create Django project
          project_name = 'myproject'
          app_name = 'myapp'
          os.system(f'django-admin startproject {project_name}')
          os.chdir(project_name)
  
          # Create Django app
          os.system(f'python manage.py startapp {app_name}')
  
          # Define User model
          class User(models.Model):
              name = models.CharField(max_length=100)
              address = models.CharField(max_length=200)
              email = models.EmailField()
  
              def __str__(self):
                  return self.name
  
          # Add User model to app's models.py
          with open(f'{app_name}/models.py', 'a') as f:
              f.write(f'\n\nclass User(models.Model):\n    name = models.CharField(max_length=100)\n    address = models.CharField(max_length=200)\n    email = models.EmailField()\n\n    def __str__(self):\n        return self.name\n')
  
          # Add app to INSTALLED_APPS in settings.py
          with open(f'{project_name}/settings.py', 'r') as f:
              settings = f.read()
          if app_name not in settings:
              with open(f'{project_name}/settings.py', 'a') as f:
                  f.write(f'\nINSTALLED_APPS.append("{app_name}")\n')
  
          # Make migrations and migrate
          call_command('makemigrations', app_name)
          call_command('migrate')
  
          return 'Django app created and migrated successfully'
      except Exception as e:
          return 'Operation failed'
  