Re: new Feature: yay or neigh?

2018-04-07 Thread Jani Tiainen
Hi,

If you want to prove your idea useful write a template tag and try ti get
people to use it.

la 7. huhtikuuta 2018 klo 10.04 Samuel Muiruri 
kirjoitti:

> Hey guys,
> Think this would be a neat feature to add to django.
>
> {% if request.connection %}
> #if there's a connection to the internet returns True, by default
> tries to connect to google
> {% else %}
> #could for example load local js/css files instead of from cdn
> {% endif %}
>
> primarily could be used to check if a site/link you really for service is
> operational before moving forward
>
> {% if request.connection:"http://www.somesite/service; %}
> #load js and present service
> {% else %}
> Sorry the service seems to be unavailable for now, please try again
> later.
> {% endif %}
>
>
> --
>
> Best Regards,
>
> Samuel Muiruri.
>
> Student in Machine Learning & a veteran web developer.
>
>
>
> 
>  Virus-free.
> www.avast.com
> 
> <#m_3794760325429669718_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJZFZXpYyXd4gdEPFrS9FS3ngHR%3D0fHg1imxBGBN5tOxj_PM5w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91ocZXPVWaAExw4w-csr4xy1-ncBZEpej%2Bacb%3DtsGij7hFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: new Feature: yay or neigh?

2018-04-07 Thread Julio Biason
My 2 cents:

1.  Django )and it's template system) runs on server. When I'll the serve not 
have a connection? If the sever doesn't have a connection, it will not sis 
anyway.

2.  What you want is probably develop a PWA with offline support. This is kinda 
built in in most browse using webworkers.

Get Outlook for iOS<https://aka.ms/o0ukef>

From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf 
of Melvyn Sopacua <m.r.sopa...@gmail.com>
Sent: Saturday, April 7, 2018 12:46:45 AM
To: django-users@googlegroups.com
Subject: Re: new Feature: yay or neigh?

On zaterdag 7 april 2018 09:02:52 CEST Samuel Muiruri wrote:
> Hey guys,
> Think this would be a neat feature to add to django.
>
> {% if request.connection %}
> #if there's a connection to the internet returns True, by default tries
> to connect to google
> {% else %}
> #could for example load local js/css files instead of from cdn
> {% endif %}

Neigh. Think about what you're proposing here:

> {% if request.connection:"http://www.somesite/service; %}

So on the incoming browser request object you instantiate a connection from
your server to some site. This by no means ensures that the browser can
connect to that service.
There's also no way to "tell the browser to check availability to that site",
because once the request object is created in Django the browser has already
sent the request - it's not two-way communication.

This should be handled in javascript and Django cannot do anything for you
here as it's not part of the problem.
--
Melvyn Sopacua

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3237607.4kOfbIVUhA%40fritzbook.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/DM5PR18MB14199C9664AB49D01335B563AEB90%40DM5PR18MB1419.namprd18.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


Re: new Feature: yay or neigh?

2018-04-07 Thread Melvyn Sopacua
On zaterdag 7 april 2018 09:02:52 CEST Samuel Muiruri wrote:
> Hey guys,
> Think this would be a neat feature to add to django.
> 
> {% if request.connection %}
> #if there's a connection to the internet returns True, by default tries
> to connect to google
> {% else %}
> #could for example load local js/css files instead of from cdn
> {% endif %}

Neigh. Think about what you're proposing here:

> {% if request.connection:"http://www.somesite/service; %}

So on the incoming browser request object you instantiate a connection from 
your server to some site. This by no means ensures that the browser can 
connect to that service.
There's also no way to "tell the browser to check availability to that site", 
because once the request object is created in Django the browser has already 
sent the request - it's not two-way communication.

This should be handled in javascript and Django cannot do anything for you 
here as it's not part of the problem.
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3237607.4kOfbIVUhA%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


new Feature: yay or neigh?

2018-04-07 Thread Samuel Muiruri
Hey guys,
Think this would be a neat feature to add to django.

{% if request.connection %}
#if there's a connection to the internet returns True, by default tries
to connect to google
{% else %}
#could for example load local js/css files instead of from cdn
{% endif %}

primarily could be used to check if a site/link you really for service is
operational before moving forward

{% if request.connection:"http://www.somesite/service; %}
#load js and present service
{% else %}
Sorry the service seems to be unavailable for now, please try again
later.
{% endif %}


-- 

Best Regards,

Samuel Muiruri.

Student in Machine Learning & a veteran web developer.



Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJZFZXpYyXd4gdEPFrS9FS3ngHR%3D0fHg1imxBGBN5tOxj_PM5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.