def start_dev_appserver():
  """Starts the appengine dev_appserver program for the Django project.

  The appserver is run with default parameters. If you need to pass any special
  parameters to the dev_appserver you will have to invoke it manually.
  """
  from google.appengine.tools import dev_appserver_main
  progname = sys.argv[0]
  args = []
  # hack __main__ so --help in dev_appserver_main works OK.
  sys.modules['__main__'] = dev_appserver_main
  # Set bind ip/port if specified.
  if len(sys.argv) > 2:
    addrport = sys.argv[2]
    try:
      addr, port = addrport.split(":")
    except __HOLE__:
      addr, port = None, addrport
    if not port.isdigit():
      print "Error: '%s' is not a valid port number." % port
      sys.exit(1)
  else:
    addr, port = None, "8000"
  if addr:
    args.extend(["--address", addr])
  if port:
    args.extend(["--port", port])
  # Add email settings
  from django.conf import settings
  args.extend(['--smtp_host', settings.EMAIL_HOST,
               '--smtp_port', str(settings.EMAIL_PORT),
               '--smtp_user', settings.EMAIL_HOST_USER,
               '--smtp_password', settings.EMAIL_HOST_PASSWORD])

  # Allow skipped files so we don't die
  args.extend(['--allow_skipped_files'])

  # Pass the application specific datastore location to the server.
  p = get_datastore_paths()
  args.extend(["--datastore_path", p[0], "--history_path", p[1]])

  # Append the current working directory to the arguments.
  dev_appserver_main.main([progname] + args + [os.getcwdu()])
dataset/ETHPy150Open CollabQ/CollabQ/appengine_django/management/commands/runserver.py/start_dev_appserver