def init(opts, no_install=False, quiet=False):
if opts['<STR_LIT>'] and is_boot2docker():<EOL><INDENT>raise DatacatsError('<STR_LIT>')<EOL><DEDENT>environment_dir = opts['<STR_LIT>']<EOL>port = opts['<STR_LIT>']<EOL>address = opts['<STR_LIT>']<EOL>start_web = not opts['<STR_LIT>']<EOL>create_sysadmin = not opts['<STR_LIT>']<EOL>site_name = opts['<STR_LIT>']<EOL>site_url = opts['<STR_LIT>']<EOL>interactive = opts['<STR_LIT>']<EOL>init_db = not opts['<STR_LIT>']<EOL>environment_dir = abspath(environment_dir or '<STR_LIT:.>')<EOL>log_syslog = opts['<STR_LIT>']<EOL>environment = Environment.load(environment_dir, site_name)<EOL>if address:<EOL><INDENT>environment.address = address<EOL><DEDENT>if port:<EOL><INDENT>environment.port = int(port)<EOL><DEDENT>if site_url:<EOL><INDENT>environment.site_url = site_url<EOL><DEDENT>try:<EOL><INDENT>if environment.sites and site_name in environment.sites:<EOL><INDENT>raise DatacatsError('<STR_LIT>'<EOL>.format(site_name))<EOL><DEDENT>making_full_environment = not environment.data_exists()<EOL>if not quiet:<EOL><INDENT>write('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(environment.name, environment.site_name))<EOL><DEDENT>steps = [<EOL>lambda: environment.create_directories(create_project_dir=False)] + ([<EOL>environment.save,<EOL>environment.create_virtualenv<EOL>] if making_full_environment else []) + [<EOL>environment.save_site,<EOL>environment.start_supporting_containers,<EOL>environment.fix_storage_permissions,<EOL>]<EOL>for fn in steps:<EOL><INDENT>fn()<EOL>if not quiet:<EOL><INDENT>write('<STR_LIT:.>')<EOL><DEDENT><DEDENT>if not quiet:<EOL><INDENT>write('<STR_LIT:\n>')<EOL><DEDENT><DEDENT>except:<EOL><INDENT>if not quiet:<EOL><INDENT>print()<EOL><DEDENT>raise<EOL><DEDENT>return finish_init(environment, start_web, create_sysadmin,<EOL>log_syslog=log_syslog, do_install=not no_install,<EOL>quiet=quiet, site_url=site_url, interactive=interactive,<EOL>init_db=init_db)<EOL>
Initialize a purged environment or copied environment directory

Usage:
  datacats init [-in] [--syslog] [-s NAME] [--address=IP] [--interactive]
                [--site-url SITE_URL] [ENVIRONMENT_DIR [PORT]] [--no-init-db]

Options:
  --address=IP            Address to listen on (Linux-only)
  --interactive           Don't detach from the web container
  -i --image-only         Create the environment but don't start containers
  --no-init-db            Don't initialize the database. Useful for importing other CKANs
  -n --no-sysadmin        Don't prompt for an initial sysadmin user account
  -s --site=NAME          Pick a site to initialize [default: primary]
  --site-url SITE_URL     The site_url to use in API responses (e.g. http://example.org:{port}/)
  --syslog                Log to the syslog

ENVIRONMENT_DIR is an existing datacats environment directory. Defaults to '.'