This is a good solution. One trick is to symlink _default to myapp

On Monday, 16 March 2020 02:17:56 UTC-7, Jacinto Parga wrote:
>
> Finally solved.
>
>    1. I add an entrypoint to the app.yaml . The app runs fine:
>    runtime: python37
>    entrypoint: gunicorn -b :8080 -w 2 main:app 
>    
>    
>    # Handlers define how to route requests to your application.
>    handlers:
>    
>    - url: /.*
>      secure: always
>      redirect_http_response_code: 301
>      script: auto
>    
>    2. I get rid off all the apps but the default app and the app I want 
>    to deploy in the .gcloudignore:
>    # This file specifies files that are *not* uploaded to Google Cloud 
>    Platform
>    # using gcloud. It follows the same syntax as .gitignore, with the 
>    addition of
>    # "#!include" directives (which insert the entries of the given 
>    .gitignore-style
>    # file at that point).
>    #
>    # For more information, run:
>    #   $ gcloud topic gcloudignore
>    #
>    .gcloudignore
>    # If you would like to upload your .git directory, .gitignore file or 
>    files
>    # from your .gitignore file, remove the corresponding line
>    # below:
>    .git
>    .gitignore
>    
>    # Python pycache:
>    __pycache__/
>    # Ignored by the build system
>    /setup.cfg
>    
>    .travis.yml
>    *.pyc
>    *.pyo
>    *~
>    #*
>    *.1
>    *.bak
>    *.bak2
>    *.svn
>    *.w2p
>    *.class
>    *.rej
>    *.orig
>    Thumbs.db
>    .DS_Store
>    ./deposit
>    ./benchmark
>    ./build
>    ./dist
>    ./ssl
>    ./docs
>    ./logs
>    ./*.zip
>    # Only ignore the default app and the app we want to deploy
>    env/*
>    env/
>    !apps/*
>    apps/todo
>    apps/todo/*
>    apps/examples
>    apps/examples/*
>    apps/_dashboard
>    apps/_dashboard/*
>    apps/_scaffold
>    apps/_scaffold/*
>    apps/_minimal
>    apps/_minimal/*
>    !apps/_default
>    !apps/_default/*
>    !apps/myapp
>    !apps/myapp/*
>    apps/_documentation/*
>    apps/superheroes
>    apps/superheroes/*
>    apps/myfeed
>    apps/myfeed/*
>    apps/*/databases/README*
>    pps/*/databases/*
>    apps/*/uploads/*
>    apps/*/*.py[oc]
>    packages/
>    deployment_tools/*
>    deployment_tools/
>    tests/*
>    tests/
>    README.md
>    test-requirements.txt
>    source-context.json
>    password.txt
>    py4web-start.py
>    setup.py
>    Makefile
>    So when it is deployed in GAE http://myapp.appspot.com/ goes to 
>    _default/index.html url
>    3. I modify the __init.py__ file of the _default app to redirect to 
>    myapp folder:
>    from py4web import action, __version__
>    from bottle import redirect  #get redirect function from bottle
>    
>    @action("index")
>    @action.uses("index.html")
>    def index():
>          redirect("/myapp")  # The former code: return 
>    dict(version=__version__)
>    The result is that http://myapp.appspot.com/ serves 
>    http://myapp.app.com/myapp
>
> Maybe there is a more elegant way to get it. Any suggestion would be 
> appreciated.
>
> Thanks
>
> El martes, 4 de febrero de 2020, 19:46:32 (UTC+1), Jacinto Parga escribió:
>>
>> I cannot properly deploy a simple py4web app in GAE. I think it's just a 
>> .gcloudignore or a app.yaml configuration issue. The only thing I've got is 
>> a not found page.
>>
>> [image: minimal-py4web.png]
>>
>> Some help about how to route the right app in the google app engine?
>>
>> Thanks
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2a1f1673-74ec-4ccd-a547-aee5e8074dd0%40googlegroups.com.

Reply via email to