Version 5 (modified by marr, 11 years ago) ( diff )


Taiwan Settings

Remember to see ConfigurationGuidelines first. And here are example configuration and settings for Taiwan development and deployment.

Basic Settings

After bzr checking out the codes, first time running with python -S eden -M should fail, but generating eden/models/ file. Edit eden/models/ and remember to set FINISHED_EDITING_CONFIG_FILE = True. Here are some recommended settings:

  deployment_settings.L10n.countries = ["TW"]
  deployment_settings.L10n.utc_offset = "UTC +0800"
  deployment_settings.gis.edit_L0 = False
  deployment_settings.gis.edit_L1 = False
  deployment_settings.gis.edit_L2 = False
  deployment_settings.gis.edit_L3 = False
  deployment_settings.gis.locations_hierarchy = {
  #   "L4":T("Village"),
      "L5":T("Location"), # Street Address

To Import Admin Names for Taiwan

Usually this is the initial and one-time work. Enter the CLI environment to run commands:

  $ python -S eden -M

Make sure modules/ containing utf8_csv_reader(), which is included since rev1413. Place L1.csv, L2.csv, L3.csv in the top level of web2py directory.

  >>> tablename = "gis_location"
  >>> table = db[tablename]
  # Example to look for a record's id
  >>> db( == "Taiwan").select().first().id
  # L0
  >>> db( != "Taiwan").delete()
  # Here will show the number of deletion
  >>> db.commit()
  # L1
  >>> gis.import_csv("L1.csv")
  >>> db.commit()
  # L2
  >>> gis.import_csv("L2.csv")
  >>> db.commit()
  # L3
  >>> gis.import_csv("L3.csv")
  >>> db.commit()
  # Example to look for records matching a name
  >>> db.executesql("SELECT * FROM gis_location WHERE name = '光復里' and level = 'L3'")
  # Here will show a list of 13 tuples. Use SELECT count(*) in the above statement to verify.

To Enable OpenID Auth

Make sure the settings in eden/models/ is ready:

deployment_settings.auth.openid = True

Use the file at instead of original one, placed in web2py/gluon/contrib/login_methods/

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.