what web2py version are you using? I have 1.99.2
This is the only variable I have defined in routes.py:
routers = dict(
BASE = dict(
domains = {
'domain1' : 'forum',
'domain2' : 'sales',
},
controllers = ['default', 'appadmin', 'view'], # also tried
'ALL' but did not work
),
)
On Thu, Nov 17, 2011 at 12:56 AM, Jonathan Lundell <[email protected]> wrote:
> On Nov 16, 2011, at 5:32 AM, Richard Baron Penman wrote:
>
>> I found listing the controllers explicitly as Bruno mentioned fixed the
>> problem.
>> Previously domain/non-default-controller returned: invalid function
>> (default/non-default-controller)
>> I would expect all controllers to work by default.
>
> I wrote a unit test that isn't seeing a problem. Would you please suggest an
> input URL that would cause the problem?
>
> Thanks.
>
>
> def test_router_domains_fs(self):
> '''
> Test URLs that map domains using test filesystem layout
> '''
> routers = dict(
> BASE = dict(
> domains = {
> "domain1.com" : "admin",
> "domain2.com" : "welcome",
> },
> ),
> )
>
> load(rdict=routers)
> self.assertEqual(filter_url('http://domain1.com'),
> '/admin/default/index')
> self.assertEqual(filter_url('http://domain2.com'),
> '/welcome/default/index')
> self.assertEqual(filter_url('http://domain1.com/gae'),
> '/admin/gae/index')
> self.assertEqual(filter_url('http://domain2.com/other'),
> '/welcome/other/index')
> self.assertEqual(filter_url('http://domain1.com/gae/f1'),
> '/admin/gae/f1')
> self.assertEqual(filter_url('http://domain2.com/f2'),
> '/welcome/default/f2')
> self.assertEqual(filter_url('http://domain2.com/other/f3'),
> '/welcome/other/f3')
>
>
>
>
>
>
>
>>
>> Richard
>>
>>
>> On Wed, Nov 16, 2011 at 2:36 PM, Jonathan Lundell <[email protected]> wrote:
>>> On Nov 15, 2011, at 8:54 PM, Bruno Rocha wrote:
>>>
>>>> On Wed, Nov 16, 2011 at 2:34 AM, Massimo Di Pierro
>>>> <[email protected]> wrote:
>>>> this should not be the case. if it is is a bug.
>>>>
>>>>
>>>> I found this some time ago and I tough it was the default behaviour.
>>>>
>>>> for the following worked
>>>>
>>>> routers = dict(
>>>> BASE = dict(
>>>> domains = {
>>>>
>>>> 'domain1.com' : 'app1',
>>>>
>>>> 'domain2.com' : 'app2',
>>>>
>>>> },
>>>> controllers=['default', 'appadmin', ..., ..., ..., ]
>>>> ),
>>>> )
>>>>
>>>> I has to list every controller, also functions
>>>>
>>>
>>> It shouldn't be necessary to list the controllers (and it's not a good idea
>>> to list controllers explicitly in the BASE router; if you need a controller
>>> list, put it in an app-specific section).
>
>
>