Disallowed User Agents | Force To upgrade

2018-01-06 Thread Ruchit Bhatt
 

In my new Django project, i am planning to use CSS Grid for template 
layout. To make site responsive without using bootstrap.

So here i want to know how can i block or force to upgrade those browser 
which doesn't support CSS grid ??


For testing purpose i tried this in *settings.py* but nothing works


DISALLOWED_USER_AGENTS = (re.compile(r'IE\s[0-9]+', re.IGNORECASE), )


is there any better way to do this ? where i can force user to upgrade 
their browser 


Thank you

-- 
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/ff9aad10-52ad-43c3-b0ed-eb313fc20b28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Form help_text and error list styling

2018-01-11 Thread Ruchit Bhatt
Hi
I have made form for signup using Django 2.0 as below

 {% csrf_token %}
{% for non_field_error in form.non_field.errors %}
 {{ non_field_error }} 
{% endfor %}
{% for field in form %}
{{ field }}
{% if field.help_text %}
{% autoescape off %}
 {{ field.help_text }} 
{% endautoescape %}
{% endif %}
{% for error in field.errors %}
{% autoescape off %}
 {{ error }} 
{% endautoescape %}
{% endfor %}
{% endfor %}


Now i want to know how can i style error list and help text using css 
(which can work in all device) ?
And is it good practice to render each and every input field, errors & help 
separately (one by one using for loop) ?

 

-- 
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/93706232-0298-4b16-98b7-723986f0c777%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
*models.py*
class HumanUser(AbstractUser):
birth_date = models.DateField(null=True, blank=True, verbose_name=u
"DOB")

*forms.py*
class profile_form(forms.ModelForm):

def __init__(self, *args, **kwargs):
kwargs.setdefault('label_suffix', '')
super(profile_form, self).__init__(*args, **kwargs)
for field in self.fields:
self.fields[field].widget.attrs.update({'class': 'form-control 
form-control-line', })

class Meta:
model = User
fields = [
'full_name',
'birth_date',
'mobile',
'bio',
'gender',
]


This is my code where birth_date type is showing as text instead of date in 
HTML..any idea why ?





-- 
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/a8d31158-393f-4a03-8805-116508234d35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
yes, it should be


ok i will check that link

-- 
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/fc1fd33c-503b-49ef-b498-bd9ea19958ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: modelform DateField rendering as text

2018-01-22 Thread Ruchit Bhatt
Is there any bootstrap hack to fix this ??

-- 
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/bc041046-1fb5-4945-85b8-5efaae4934a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: modelform DateField rendering as text

2018-01-23 Thread Ruchit Bhatt
Hi,i tried that and got this.
Double "type" (no override).



-- 
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/1bbb3d83-ac49-4698-a1b1-4d14b513e953%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: modelform DateField rendering as text

2018-01-23 Thread Ruchit Bhatt
*solved*

forms.DateInput.input_type="date"
forms.DateTimeInput.input_type="datetime-local" 

-- 
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/613d4a97-bed8-4c3b-9ecc-3b7e0fb975e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dynamic update template

2018-01-27 Thread Ruchit Bhatt
Hi folks,
Currently i am using Django at basic/intermediate level. And in my web 
template, single page contains more than one *Forms*, many *chart.js* 
widgets for to plot graph, plus 2-3 small widget for task management.
Now i want to make my site more dynamic (i.e update UI without reloading 
whole page).

For this, some articles suggest AJAX, some are AngularJs or React or Vue 
supporter.
My question is can't we do this by using only Django (i.e without using 
frontend framework)?


-- 
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/03910d6a-5305-47a2-8bf3-a08535e614b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dynamic update template

2018-01-27 Thread Ruchit Bhatt
Ok,so you are suggesting front-end framework to make life easier. Do you have 
any personal choice over angularjs / React / Vue ? One more thing, how security 
will work in this case because javascript runs on client side & anybody can 
read how js code comunicating with backend ?

-- 
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/3af04d03-9142-4cf7-85a8-c9521dabe41e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dynamic update template

2018-01-27 Thread Ruchit Bhatt
Ok.Thank you so much for reply.

-- 
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/fa6755ae-21fb-4833-a8b6-536c0002d56c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.