Forums

Running a web2py webapp "behind" Mezzanine

Hello,

Is it possible/feasible to run a web2py app behind Mezzanine in the same account? I have an existing web2py app I'd rather not rewrite, I need a CMS in front of it, and I don't much like the web2py CMS's I've seen (any recommendations?).

The setup would be: a mezzanine-based landing page/blog with a custom domain, with a subscriber-only web2py app reached either by logging in (existing subscribers) or via the payment process. UX/Bootstrap issues aside, I'd also like the URL's to maintain consistency and not reveal the switch.

Doable, or should I start in on the rewrite?

Suggestions, recommendations, and sanity checks appreciated.

What does your web2py app do? If it has a bunch of completely separate function that doesn't overlap with Mezzanine, then maybe have two webapps, both accessing the same databases etc? eg: the Mezzanine one could be cms.your-domain.com and the web2py one could be otherstuff.your-domain.com.

The cms would be entirely for marketing purposes (landing page, SEO, regular blog posts, links to external resources, etc.) so there would be no overlap in functionality. The only route from the cms to the app would be via login/subscription.

Is it possible to run a second app on a different port on the same domain? Say I have widget.com and it is setup to point to the mezzanine landing page. Could I run the w2p app on port 9000 for example, then use widget.com:9000/login as the url to access it?

You can't run apps on different ports, but you can combine apps using the werkzeug DispatcherMiddleware

why is python anywhere giving socket error while redirecting from the provider app during CAS authentication??? is it something to do with free pythonanywhere account?? Thank you..

It could be. Could you give the full stack trace and the name of the host you're trying to connect to?

I am using central authentication system for login purpose for my app..

Ticket ID

14.139.82.6.2015-11-19.14-36-56.c18f12cf-7fe4-43d8-bb5a-c2e4f2184438 <class 'socket.error'> [Errno 111] Connection refused Version web2py™ Version 2.12.3-stable+timestamp.2015.08.19.00.18.03 Python Python 2.7.6: /usr/local/bin/uwsgi (prefix: /usr) Traceback

Traceback (most recent call last): File "/home/sanketshah/web2py/gluon/restricted.py", line 227, in restricted except RestrictedError: File "/home/sanketshah/web2py/applications/courier_portal/controllers/default.py", line 489, in <module> File "/home/sanketshah/web2py/gluon/globals.py", line 412, in <lambda> 'Response.render can be called with two arguments, at most') File "/home/sanketshah/web2py/applications/courier_portal/controllers/default.py", line 461, in login session.token = CAS.login(request) File "/home/sanketshah/web2py/applications/courier_portal/models/cas.py", line 37, in <lambda> CAS.login=lambda r=request: _CAS_login(r) File "/home/sanketshah/web2py/applications/courier_portal/models/cas.py", line 21, in _CAS_login conn.endheaders() File "/usr/lib/python2.7/httplib.py", line 975, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 835, in _send_output self.send(msg) File "/usr/lib/python2.7/httplib.py", line 797, in send self.connect() File "/usr/lib/python2.7/httplib.py", line 1178, in connect self.timeout, self.source_address) File "/usr/lib/python2.7/socket.py", line 571, in create_connection raise err error: [Errno 111] Connection refused

Error snapshot help

<class 'socket.error'>([Errno 111] Connection refused)

Right, that definitely looks like it's being caused because you have a free account.

kk.. thanks.. :)

<unhijacking original thread>

You can't run apps on different ports, but you can combine apps using the werkzeug DispatcherMiddleware

Does this work with apps from different frameworks? E.g. django and web2py? I've been poking around the werkzeug docs and also looking for examples but there doesn't seem to be much out there.

I think so, since the only requirement is that they be WSGI apps.