Version 66 (modified by Fran Boon, 14 years ago) ( diff )

Enable Scheduled Tasks

Configuration Guidelines

How to configure a new instance.

File Permissions

chown www-data web2py/applications/admin/cron
chown www-data web2py/applications/admin/cron/crontab
chown www-data web2py/applications/admin/cache/
chown www-data web2py/applications/admin/databases/
chown www-data web2py/applications/admin/errors/
chown www-data web2py/applications/admin/languages/
chown www-data web2py/applications/admin/sessions/
chown www-data web2py/applications/admin/uploads/
cd web2py/applications
bzr branch lp:sahana-eden eden
chown www-data eden/cron
chown www-data eden/cache/
chown www-data eden/databases/
chown www-data eden/errors/
chown www-data eden/languages/
chown www-data eden/sessions/
chown www-data eden/static/img/markers
chown www-data eden/static/scripts/tools
chown www-data eden/static/styles/S3/sahana.css
chown www-data eden/static/styles/S3/sahana.min.css
chown www-data eden/uploads/
mkdir eden/uploads/gis_cache
mkdir eden/uploads/images
mkdir eden/uploads/tracks
chown www-data eden/uploads/gis_cache
chown www-data eden/uploads/images
chown www-data eden/uploads/tracks

Database Setup

Production system should use MySQL:

  • Edit models/


Before the 1st login, edit models/

deployment_settings.auth.hmac_key = "akeytochange"

Configurable Options

These can be set via

  • Admin Name/Email/Tel
  • Debug: improve performance by deselecting this option.
  • Self-Registration: disable Self-Registration by deselecting this option.
  • Audit Read: Enable Auditing of all Read operations (Display)
  • Audit Write: Enable Auditing of all Write operations (Create/Update/Delete)

In time these will be configured by Web Setup.

Some options are currently only configurable via editing {{models/}}:

deployment_settings.auth.registration_requires_verification = False
deployment_settings.auth.registration_requires_approval = False
deployment_settings.base.public_url = ""
deployment_settings.base.migrate = True
deployment_settings.mail.server = ""
deployment_settings.mail.sender = ""
deployment_settings.mail.approver = ""
deployment_settings.L10n.utc_offset = "UTC +0000"

We would like to expose these to a Web Setup, although it's low priority as these are mostly installation-time decisions.

Disable unnecessary modules, which is currently done in models/

Can also reorganise the Modules menu completely to better display those relevant to the instance:

  • edit file models/
  • section: s3.menu_modules

If you wish to hide some fields which you don't want to confuse your system, then you can do something like this models/ instead of amending the main model (this means that future merges from trunk won't clobber your changes):

# Hide unnecessary fields
tablename = 'pr_person'
table = db[table]
table.pr_pe_label.readable = False
table.pr_pe_label.writable = False
table.local_name.readable = False
table.local_name.writable = False
table.opt_pr_gender.readable = False
table.opt_pr_gender.writable = False
table.opt_pr_age_group.readable = False
table.opt_pr_age_group.writable = False = False = False
table.mobile_phone.readable = False
table.mobile_phone.writable = False
table.date_of_birth.readable = False
table.date_of_birth.writable = False
table.opt_pr_nationality.readable = False
table.opt_pr_nationality.writable = False
table.opt_pr_country.readable = False
table.opt_pr_country.writable = False
table.opt_pr_religion.readable = False
table.opt_pr_religion.writable = False
table.opt_pr_marital_status.readable = False
table.opt_pr_marital_status.writable = False
table.occupation.readable = False
table.occupation.writable = False

Mapping Options


Default Map Portal:

  • Lat
  • Lon
  • Zoom

Bounds of relevant area:

  • Min Lon
  • Max Lat
  • Min Lon
  • Max Lat

Selecting Base Layers:

Test out whether OpenStreetMap, Google, Yahoo or Bing have the best road maps & Satellite imagery

API Keys for Google, Yahoo & MultiMap layers:

Import Admin Boundaries:


By default the 1st user to register will gain the Administrator role.

All other users have just the 'Authenticated' level of access, which by default allows full Read/Update/Delete access to all records.

To add roles to users, go to the Administration menu & within User Management choose 'Membership'.

Security policy is configured in models/

Enable Scheduled Tasks

Edit cron/crontab to enable sending of emails & SMS:

# Send outgoing emails every 5 minutes
*/5   *       *       *       *       root *msg/process_email_via_api
# Send outgoing SMS every 5 minutes
*/5   *       *       *       *       root *msg/process_sms_via_api

Ticket Viewer

Add the following to of your web2py installation for pretty error pages & the ability to view Tickets.

  • copy from, if one doesn't yet exist.
routes_onerror = [
        ('eden/401', '/eden/default/user/login'),
        ('eden/*', '/eden/errors/index'),
        ('*/*', '/eden/errors/index'),

favicon.ico & robots.txt

These can be provided via 2 different means:

  • mod_rewrite
  • web2py/ copy & edit


Ensure these files are writable by the webserver:

chown www-data /path/to/web2py/applications/eden/static/scripts/tools
chown www-data /path/to/web2py/applications/eden/static/styles/S3/sahana.css
chown www-data /path/to/web2py/applications/eden/static/styles/S3/sahana.min.css

Colour scheme:


  • copy new logo to static/img
  • point to this using Admin Panel


  • amend views/footer.html


Internet Hosting

Can switch to having users download files from CDNs instead of your server.
This can improve performance in 2 ways:

jQuery from Google by uncommenting the line in views/sahana_scripts_min.html

ext-all.js & ext-all.css from Cachefly by uncommenting the lines in views/gis/gis_scripts_min.html & views/gis/ol_js_loaders.html

Performance Optimisation

  • set Empty=False in models/ instead of doing a DAL hit
  • set modules to load from a hardocded app name instead of substituting request.application in models/


Attachments (5)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.