code: def create_db(name, owner=None, encoding=u'UTF-8', template='template1',
                **kwargs):
      
  
      flags = u''
      if encoding:
          flags = u'-E %s' % encoding
      if owner:
          flags = u'%s -O %s' % (flags, owner)
      if template and template != 'template1':
          flags = u'%s --template=%s' % (flags, template)
      sudo('createdb %s %s' % (flags, name), user='postgres', **kwargs)
docs: Create a Postgres database.