[web2py] Re: Hosting my web2py application

2020-10-28 Thread mostwanted
I've come across alot of information on setting up a domestic webserver I 
just wasnt sure if the same setup of hosting a PHP application would apply 
to hosting a Python application, I just thought it could be different but 
if its all the same thing I'll pick one & try it out.

Regards

On Tuesday, October 27, 2020 at 11:51:36 PM UTC+2 jonatha...@whatho.net 
wrote:

> Do you want instructions on how to set up and run a server (Linux, 
> Windows?) on your home premises?
> Instructions on how to install web2py on such a server?
> Instructions on how to provide access to web browsers out on the internet 
> (e.g. setting up IP addresses on which the server can be contacted?)
>
> These are big topics which (I would suggest) are outside the scope of this 
> group, and might require a fair bit of research. Also there are lots of 
> options depending on your requirements. None of it's specially difficult 
> but most of it is not specific to web2py.
>
>
> On Tuesday, 27 October 2020 at 15:44:30 UTC mostwanted wrote:
>
>> How do I setup a private home server to host my web2py application? What 
>> do i need & how do i put it together? If anyone has done it before please 
>> share the process or direct me to where I can find the information.
>>
>> Regards;
>>
>> Mostwanted
>>
>

-- 
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/bda36beb-a932-487e-ba15-d018283371d9n%40googlegroups.com.


[web2py] Re: Hosting my web2py application

2020-10-28 Thread Rufus
There is at least one good tutorial on YouTube about setting up a private 
home webserver on a Raspberry Pi, including
how to create a Dynamic DNS entry with Google. Here's One:  
 https://www.youtube.com/watch?v=vzojwG7OB7c=1415s

On Tuesday, October 27, 2020 at 11:44:30 AM UTC-4 mostwanted wrote:

> How do I setup a private home server to host my web2py application? What 
> do i need & how do i put it together? If anyone has done it before please 
> share the process or direct me to where I can find the information.
>
> Regards;
>
> Mostwanted
>

-- 
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/2176a575-acb5-4eb2-b260-36758964d732n%40googlegroups.com.


[web2py] Re: Add to home screen

2020-10-28 Thread mostwanted
I was finally able to get my app to prompt add to screen. My app is hosted 
on pythonanywhere.com & its all thanks to Giles Thomas overthere at 
Pythonanywhere.com for assisting me with what I could do. 

What I did was that I set up a static file mapping on my "Web" tab page. 
I set  "URL"  to "/sw.js" and "Directory"  to 
"/home/myusername/web2py/applications/init/static/js/sw.js" In my 
pythonanywhere.com dashboard. 

>From there I changed the navigator.serviceWorker.register('/sw-location') 
arguments of the /main.js script to point to my /sw.js script served now 
from my root directory & no longer from sub-directories in my app as set up 
above:

*Main.js Script*
window.onload = () =>
{
  'use strict';

  if ('serviceWorker' in navigator)
{
   * navigator.serviceWorker.register('https://www.my-app.com/sw.js');*
  }
} 

Regards;

Mostwanted
On Wednesday, October 28, 2020 at 8:19:20 AM UTC+2 mostwanted wrote:

> Hey guys, I'm still here, struggling with the add to home PWA 
> fucntionality. Has anyone found a solution? Please share or assist.
>
> Regards
>
> On Monday, August 24, 2020 at 10:42:57 AM UTC+2 mostwanted wrote:
>
>> Hey guys i'm still struggling with the *add to home screen* prompt, 
>> please look at my code above & suggest something. Help me to get this to 
>> work. I really need this functionality, please help me.
>>
>> Regards;
>>
>> Mostwanted
>> On Friday, May 29, 2020 at 12:46:38 AM UTC+2 mostwanted wrote:
>>
>>> Ok! So far I have been able to get some aspects of my PWA project 
>>> working, The issue is that I have to install the app manually from the 
>>> browser's menu but it installs with its icon & it can be launched from the 
>>> icon with a splash screen, that's a minor success, it also opens fully like 
>>> a standalone app, another achievement, it shows its respecting the manifest 
>>> file rules,  Now the major problems are that offline functionality & a 
>>> prompt by the browser to install the app on home screen are not working and 
>>> apparently this is caused by a service worker that can not be detected! The 
>>> error says:
>>>
>>> *"No matching service worker detected. You may need to reload page or 
>>> check that the scope of the service worker for the current page encloses 
>>> the scope of the start URL from the manifest."*
>>>
>>> I do not understand this message at all, I went through the internet 
>>> looking for possible answers but none of them are clear! Some are saying 
>>> the solution is to place the service worker in the root directory! But guys 
>>> please forgive my ignorance but where is the web2py root directory?! If 
>>> anyone has been able to overcome this issue or understands the solution to 
>>> it i'd greatly appreciate your assistance, my site is being hosted by 
>>> pythonanywhere I dont know if this matters (Root Directories & all)!
>>> This is my code below:
>>>
>>> *LAYOUT CODE:*
>>>
>>> 
>>>
>>>   
>>>   >> href="/init/static/images/icon_152x152.png">
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   >> content="/init/static/images/icon_144x144.png">
>>>   
>>>
>>>
>>>   
>>>
>>>
>>> *MAIN.JS*
>>> window.onload = () =>
>>> {
>>>   'use strict';
>>>
>>>   if ('serviceWorker' in navigator) {
>>> navigator.serviceWorker.register('/init/static/js/sw.js');
>>>   }
>>> }
>>>
>>>
>>> *SW.JS*
>>> var cacheName = 'hello-pwa';
>>> var filesToCache = [
>>>   '/',
>>>   '/init/',
>>> ];
>>>
>>> /* Start the service worker and cache all of the app's content */
>>> self.addEventListener('install', function(e) {
>>>   e.waitUntil(
>>> caches.open(cacheName).then(function(cache) {
>>>   return cache.addAll(filesToCache);
>>> })
>>>   );
>>> });
>>>
>>> /* Serve cached content when offline */
>>> self.addEventListener('fetch', function(e) {
>>>   e.respondWith(
>>> caches.match(e.request).then(function(response) {
>>>   return response || fetch(e.request);
>>> })
>>>   );
>>> });
>>>
>>>
>>> *MANIFEST.JSON*
>>> {
>>>   "name": "Hello World",
>>>   "short_name": "Hello",
>>>   "lang": "en-US",
>>>   "background_color": "#DE3C4B",
>>>   "theme_color": "#DE3C4B",
>>>   "icons": [
>>> {
>>>   "src": "/init/static/images/icon_72x72.png",
>>>   "sizes": "72x72",
>>>   "type": "image/png"
>>> },
>>> {
>>>   "src": "/init/static/images/icon_96x96.png",
>>>   "sizes": "96x96",
>>>   "type": "image/png"
>>> },
>>> {
>>>   "src": "/init/static/images/icon_128x128.png",
>>>   "sizes": "128x128",
>>>   "type": "image/png"
>>> },
>>> {
>>>   "src": "/init/static/images/icon_144x144.png",
>>>   "sizes": "144x144",
>>>   "type": "image/png"
>>> },
>>> {
>>>   "src": "/init/static/images/icon_152x152.png",
>>>   "sizes": "152x152",
>>>   "type": "image/png"
>>> },
>>> {
>>>   "src": "/init/static/images/icon_192x192.png",
>>>   "sizes": "192x192",
>>>   "type": "image/png"
>>> },
>>> {
>>>   "src": 

[web2py] Re: Add to home screen

2020-10-28 Thread mostwanted
Hey guys, I'm still here, struggling with the add to home PWA 
fucntionality. Has anyone found a solution? Please share or assist.

Regards

On Monday, August 24, 2020 at 10:42:57 AM UTC+2 mostwanted wrote:

> Hey guys i'm still struggling with the *add to home screen* prompt, 
> please look at my code above & suggest something. Help me to get this to 
> work. I really need this functionality, please help me.
>
> Regards;
>
> Mostwanted
> On Friday, May 29, 2020 at 12:46:38 AM UTC+2 mostwanted wrote:
>
>> Ok! So far I have been able to get some aspects of my PWA project 
>> working, The issue is that I have to install the app manually from the 
>> browser's menu but it installs with its icon & it can be launched from the 
>> icon with a splash screen, that's a minor success, it also opens fully like 
>> a standalone app, another achievement, it shows its respecting the manifest 
>> file rules,  Now the major problems are that offline functionality & a 
>> prompt by the browser to install the app on home screen are not working and 
>> apparently this is caused by a service worker that can not be detected! The 
>> error says:
>>
>> *"No matching service worker detected. You may need to reload page or 
>> check that the scope of the service worker for the current page encloses 
>> the scope of the start URL from the manifest."*
>>
>> I do not understand this message at all, I went through the internet 
>> looking for possible answers but none of them are clear! Some are saying 
>> the solution is to place the service worker in the root directory! But guys 
>> please forgive my ignorance but where is the web2py root directory?! If 
>> anyone has been able to overcome this issue or understands the solution to 
>> it i'd greatly appreciate your assistance, my site is being hosted by 
>> pythonanywhere I dont know if this matters (Root Directories & all)!
>> This is my code below:
>>
>> *LAYOUT CODE:*
>>
>> 
>>
>>   
>>   > href="/init/static/images/icon_152x152.png">
>>   
>>   
>>   
>>   
>>   
>>   
>>   > content="/init/static/images/icon_144x144.png">
>>   
>>
>>
>>   
>>
>>
>> *MAIN.JS*
>> window.onload = () =>
>> {
>>   'use strict';
>>
>>   if ('serviceWorker' in navigator) {
>> navigator.serviceWorker.register('/init/static/js/sw.js');
>>   }
>> }
>>
>>
>> *SW.JS*
>> var cacheName = 'hello-pwa';
>> var filesToCache = [
>>   '/',
>>   '/init/',
>> ];
>>
>> /* Start the service worker and cache all of the app's content */
>> self.addEventListener('install', function(e) {
>>   e.waitUntil(
>> caches.open(cacheName).then(function(cache) {
>>   return cache.addAll(filesToCache);
>> })
>>   );
>> });
>>
>> /* Serve cached content when offline */
>> self.addEventListener('fetch', function(e) {
>>   e.respondWith(
>> caches.match(e.request).then(function(response) {
>>   return response || fetch(e.request);
>> })
>>   );
>> });
>>
>>
>> *MANIFEST.JSON*
>> {
>>   "name": "Hello World",
>>   "short_name": "Hello",
>>   "lang": "en-US",
>>   "background_color": "#DE3C4B",
>>   "theme_color": "#DE3C4B",
>>   "icons": [
>> {
>>   "src": "/init/static/images/icon_72x72.png",
>>   "sizes": "72x72",
>>   "type": "image/png"
>> },
>> {
>>   "src": "/init/static/images/icon_96x96.png",
>>   "sizes": "96x96",
>>   "type": "image/png"
>> },
>> {
>>   "src": "/init/static/images/icon_128x128.png",
>>   "sizes": "128x128",
>>   "type": "image/png"
>> },
>> {
>>   "src": "/init/static/images/icon_144x144.png",
>>   "sizes": "144x144",
>>   "type": "image/png"
>> },
>> {
>>   "src": "/init/static/images/icon_152x152.png",
>>   "sizes": "152x152",
>>   "type": "image/png"
>> },
>> {
>>   "src": "/init/static/images/icon_192x192.png",
>>   "sizes": "192x192",
>>   "type": "image/png"
>> },
>> {
>>   "src": "/init/static/images/icon_384x384.png",
>>   "sizes": "384x384",
>>   "type": "image/png"
>> },
>> {
>>   "src": "/init/static/images/icon_512x512.png",
>>   "sizes": "512x512",
>>   "type": "image/png"
>> }
>>   ],
>> "start_url": "/init",
>>   "scope": "/init",
>>   "display": "standalone"
>>
>> }
>>
>>
>> Regards;
>>
>> Mostwanted 
>>
>>
>> On Wednesday, May 27, 2020 at 12:08:15 PM UTC+2, mostwanted wrote:
>>>
>>> Whats the simplest way to get my web2py application to prompt users to 
>>> add to screen? I have tried alot of things but none are working, there are 
>>> no prompts happening! Some say its only achievable through a PWA design, i 
>>> tried this 
>>> https://groups.google.com/forum/#!searchin/web2py/pwa$20me%7Csort:date/web2py/rHBfs1zFG44/gKS6EOmlAgAJ
>>>  
>>>
>>> nothing is working, if anyone has a way to achieve this with web2py i'd 
>>> appreciate your assistance.
>>>
>>> Regards;
>>>
>>> Mostwanted
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py