[web2py] Re: py4web in Google App Engine route app

2020-03-16 Thread Jacinto Parga
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/972cbcc2-991c-4ed9-a20e-84c002cd3c5c%40googlegroups.com.


Re: [web2py] Fullcalendar v4 and web2py

2020-03-16 Thread António Ramos
{{response.files.append(URL(r=request,c='static/js',f='fullcalendar.min.js'))}}
{{response.files.append(URL(r=request,c='static/css',f='fullcalendar.min.css'))}}
{{extend 'layout.html'}}


.myclass{
background-color: white;

}
#calendar .fc-agenda-axis, #calendar .fc-widget-header {
  background-color: #C2E6FF;
  border-color: #AED0EA;
  font-weight: normal;
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;

  border-radius: 3px ;
}
#calendar .fc-event {
  box-shadow: 2px 2px 2px #706868;

}
.fc-today {
   background-color: #C2E6FF;
}
.fc-day-number {
font-size: 14px;
}
.fc-content{
text-align:right ;
cursor:pointer;
}
.fc h2 {
   font-size: 20px;
}
.fc-scroller {
   overflow-y: hidden !important;
}



$(document).ready(function() {

var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();

$('#calendar').fullCalendar({
firstDay:1,
displayEventTime:true,
monthNames:
["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho",
"Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" ],
monthNamesShort:
['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
   dayNames: [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta',
'Sexta', 'Sábado'],
   dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
   buttonText: {
today: 'hoje',
month: 'mês',
week: 'semana',
day: 'dia'
   },
header:{
  left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay',


},
eventClick: function(info) {
alert('Event: ' + info.event.title);
alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
alert('View: ' + info.view.type);

// change the border color just for fun
info.el.style.borderColor = 'red';
  },
  dayClick: function(date, jsEvent, view) {
$("#inicio").val(date.format()+"T09:00");
$("#fim").val(date.format()+"T18:00");

},
editable: false,
defaultView:'month',
displayEventTime: true,
displayEventEnd:true,
  eventClick: function(event) {
console.log(event);
if (event.url) {
window.open(event.url, "_blank");
return false;
}
},
height: "auto",
events: [
{{for task in ret:}}

   {{color='#f00'}}

{
{{temp=db.auth_user(id=task["person"])}}
title: '{{=temp["nick"]}}\n

{{=task["description"]}}', color : '{{=color}}', textColor:"#FFF", start:'{{=task["eventstart"]}}', end: '{{=task["eventend"]}}', }, {{pass}} ], eventRender: function( event, element, view ) { var title = element .find('.fc-title, .fc-list-item-title'); title.html(title.text()); }, }); }); {{=form}} Em dom., 15 de mar. de 2020 às 17:46, Andrea Fae' escreveu: > Anyone have any eocumentation with a examples about using Fullcalendar.io > v4 javascript calendar with web2py? > thank you > > -- > 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/113d00b6-37b0-4bcc-8185-4863be823ae4%40googlegroups.com > > . > -- 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/CAEM0BxNCyZRBAZRtQ08AxSRBjhh6jQ-zWCZrOF0LdLG0acY%3Dqw%40mail.gmail.com.