Re: [flask] Restrict module to domain
- From:
- Thadeus Burgess
- Date:
- 2010-09-03 @ 18:29
I have two apps. One backend, it has access to every model in the
system, plus its own set of models used for management.
The frontend contains a signup form, so it needs access to only say, 5
of the total models in the system. Just so it can run this form and
have people sign up.
These are running on two different WSGI instances, each bound to a
different domain.
Lets say for example, I need to add another signup form to the
frontend... but it collects slightly different data, and is supposed
to live on a separate domain, while still accessing all of the same
models. But it also shares the same design layout as the frontend, it
just is on its own domain.
Currently I have to make a completely separate flask instance, and
copy the templates over and make a single view for this new signup
form.
Ideally, I would like to just create a new module for the frontend
app, but bind it to the specific domain. So if you navigate to
domainA.com you get the normal signup form, and domainB.com gets this
new signup form.
This would also save from having to set up a new WSGI instance just
for this second signup form, all I would need to do is edit my virtual
hosts and give it an alias, and flask can figure the routing from
there.
--
Thadeus
On Fri, Sep 3, 2010 at 1:03 PM, Dan Jacob <danjac354@gmail.com> wrote:
> Could you give an example ?
>
> On 3 September 2010 18:46, Thadeus Burgess <thadeusb@thadeusb.com> wrote:
>> I know you can restrict a module to only a subdomain, but what if you
>> need to restrict certain modules to whole domains?
>>
>> --
>> Thadeus
>>
>