No because by the time the controller is executed the the request went
through the routes.
On Saturday, 2 August 2014 17:29:05 UTC-5, Michael Gheith wrote:
>
> Is there way to programmatically set a path prefix in a controller rather
> than in routes.py?
>
> Best,
> Michael Joseph Gheith
>
> On
Is there way to programmatically set a path prefix in a controller rather
than in routes.py?
Best,
Michael Joseph Gheith
On Tuesday, July 29, 2014 4:47:17 PM UTC-5, Michael Gheith wrote:
>
> Hello,
>
> I rewrote what you had Massimo as the following (and it compiled just
> fine):
>
> routes_in
Hello,
I rewrote what you had Massimo as the following (and it compiled just fine):
routes_in = [('/sam/(?P\w+)/$a/$c/$f', '/$a/$c/$f/\g')]
routes_out = [('/$a/$c/$f/(?P)', '/sam/\g/$a/$c/$f')]
I see what you are trying to do - although it's still not producing the
desired result unfortunat
Hello Massimo,
I got a compile error when trying your suggestion of:
routes_in = [('/sam/$client/$a/$c/$f', '/$a/$c/$f/$client')]
routes_out = [('/$a/$c/$f/$client','/sam/$client/$a/$c/$f')]
Traceback (most recent call last):
File "web2py.py", line 18, in
import gluon.widget
File "
The problem is that fater routes_in removes the prefix web2py does not know
any more whether you requested client1 or client2. Should the application
be able to discriminate?
1) If not, this should be handle through apache or nginx, not via routes.
If you want to use routes you can make one app
I plan on shoving this in the app specific routes.py - so it shouldn't mess
with the other apps.
I tried your code, but it didn't work as expected. You have the right idea
though in regards to what I'm trying to do lyn2py. I want to literally
shove anything in front of app/controller/function
I am not exactly sure I understand your question, and I don't know how your
code looks like, but you could try this:
routes_in = (
('/$anything/$a/$c/$f', '/$a/$c/$f/$anything')
)
If you are going to have multiple apps though, this routing system will
most likely break
That's a great idea lyn2py, but I expect to run multiple applications in
one web2py instance. I can't have all my applications with the name of sam
unfortunately.
I just discovered that I can add a URL prefix of "fff" with the following
code:
routes_in = (
('/fff/$a/$c/$f', '/$a/
In that case,
Make sam your app's name, client1 and 2 can be the functions within the
controller, or separate controllers for each client.
If they share functions, you could shift your function's logic outside
(into a module).
On Thursday, July 24, 2014 11:50:28 PM UTC+8, Michael Gheith wrot
Hello lyn2py,
Thank you for your response. Unfortunately it is necessary for me to have
the URL prefix of /sam/. I would imagine your strategy would work
if it was possible to dynamically add a URL prefix, but I don't think there
is a way to do that. Anyone else have any ideas? Massimo?
Be
You are pointing client1 and client2 to the same representation of the
routes. It won't work properly.
If you have separate domains for separate clients, see scripts/autoroutes.py
If you want to serve customized to different clients, you might want to do
http://127.0.0.1:8000/sam//default/inde
11 matches
Mail list logo