Is it possible to host endpoint and WSGIApplication application in the same app engine project
<p>I implemented endpoint project:</p>

<pre><code>@endpoints.api(name='froom', version='v1', description='froom API')
class FRoomApi(remote.Service):   
    @endpoints.method(FbPutRoomRequest, RoomMessage, path='putroom/{id}', http_method='PUT', name='putroom')
    def put_room(self, request):
        entity = FRoom().put_room(request, request.id)
        return entity.to_request_message()

application = endpoints.api_server([FRoomApi],restricted=False)
</code></pre>

<p>app.yaml</p>

<pre><code>- url: /_ah/spi/.*
  script: froomMain.application 

- url: .*
  static_files: index.html
  upload: index.html
</code></pre>

<p>and I have separate wsgi-jinja project:</p>

<pre><code>routes = [
    Route(r'/', handler='handlers.PageHandler:root', name='pages-root'),
    # Wipe DS
    Route(r'/tasks/wipe-ds', handler='handlers.WipeDSHandler', name='wipe-ds'),
    ]
config = {
    'webapp2_extras.sessions': {
        'secret_key': 'someKey'
    },
    'webapp2_extras.jinja2': {
        'filters': {
            'do_pprint': do_pprint,
            },
        },
    }
application = webapp2.WSGIApplication(routes, debug=DEBUG, config=config)
</code></pre>

<p>app.yaml</p>

<pre><code>- url: /.*
  script: froomMain.application
</code></pre>

<p>Is it possible to host those two projects in the same application</p>

<p>The fundamental problem that needs to be addressed is defining the appropriate overall app request namespace so that routing to the appropriate sub-app can be made reliably, keeping in mind that:</p>

<ul>
<li><strong>only one sub-app</strong> can be designated as the default one (which will handle requests not matching any of the other sub-app namespaces).</li>
<li>the namespaces for all non-default sub-apps <strong>must be checked before</strong> the namespace for the default sub-app</li>
<li>the decision to route to one sub-app is final, if it fails to handle the request it'll return a 404, there is no fallback to another sub-app which might be able to handle the request</li>
</ul>

<p>In your case the complication arises from the conflicting namespaces of the sub-apps. For example both the <code>/</code> and the <code>/tasks/wipe-ds</code> paths from the wsgi-jinja project collide with the <code>.*</code> namespace in the endpoints project. To make it work one of the sub-apps namespaces must be modified. </p>

<p>Since the endpoints project contains a lot of auto-generated code it's more difficult to change, so I'd leave that as the default one and modify the wsgi-jinja one, for example by prefix-ing it with <code>/www</code>. For this to work the wsgi-jinja's internal routes need to be modified accordingly:</p>

<ul>
<li><code>/</code> -> <code>/www</code></li>
<li><code>/tasks/wipe-ds</code> -> <code>/www/tasks/wipe-ds</code></li>
</ul>

<p>Both your existing projects seem to have a <code>froomMain.py</code> file with an <code>application</code> global inside, conflicting. I'd rename wsgi-jinja's one, let's say to <code>www.py</code>:</p>

<pre><code>routes = [
    Route(r'/www/', handler='handlers.PageHandler:root', name='pages-root'),
    # Wipe DS
    Route(r'/www/tasks/wipe-ds', handler='handlers.WipeDSHandler', name='wipe-ds'),
    ]
config = {
    'webapp2_extras.sessions': {
        'secret_key': 'someKey'
    },
    'webapp2_extras.jinja2': {
        'filters': {
            'do_pprint': do_pprint,
            },
        },
    }
application = webapp2.WSGIApplication(routes, debug=DEBUG, config=config)
</code></pre>

<p>Your <code>app.yaml</code> file would then be:</p>

<pre><code>- url: /www/.*
  script: www.application

- url: /_ah/spi/.*
  script: froomMain.application 

- url: .*
  static_files: index.html
  upload: index.html
</code></pre>

python google-app-engine wsgi endpoint