Web2py with environment configuration

Does web2py support, regardless of configuration, configuration for the environment (development, production, production, etc.)? Something similar to Grails and Ruby on Rails.

I read / looked through the official book, but could not find anything.

+3
source share
1 answer

Web2py developers do not think this is a good approach.

We do not believe in the sharp difference between development and production. For eaxmple, if the application has an error, the error is always recorded and registered, it is never displayed to the user, it is displayed only to the administrator.

In addition, web2py does not have a configuration file at all, because applications must be portable without changing the settings.

, Rails Django. , , . . :

  settings = dict()
  if request.env.http_host == 'http://127.0.0.1:8000'
       settings['development']=True
  else:
       settings['development']=False
  if settings['development']:
       db = DAL('sqlite://....')
  else:
       db = DAL('mysql://....')

, . , ['development'] = True False constant, , Rails.

+4

All Articles