Re: Best Django Deployment

2020-01-23 Thread Mike Dewhirst

On 24/01/2020 3:14 pm, onlinejudge95 wrote:

+1 on the question.
Mainly whether the Apache + modWSGI or Nginx is the better way to go.


I use Apache + modWSGI because I'm familiar with it. I also run a 
Mezzanine site which uses Gunicorn + nginx and the setup wasn't difficult.


I don't think performance is an immediate issue for most sites so my 
advice is:


1.  go for what you are familiar with.

2. if unfamiliar with both and your setup is simple go for nginx because 
setup is simpler


3. if brilliant documentation is your thing and you have complex 
requirements go with Apache


4. if the last nanosecond of performance is your thing get an expert to 
tune up whichever one you choose because only experts can tell the 
difference.


Good luck

Mike



On Fri, Jan 24, 2020, 7:41 AM Aldian Fazrihady > wrote:


Google AppEngine fFex will handle everything for you, but for my
requirement, the price is too expensive, so I don't use it and I
also don't use any Google cloud product to host my Django app.
If your app code is not efficient, it means it will use more
resources, then the monthly bill of AppEngine Flex will also be
higher.

Google AppEngine flex is using nginx.

On Fri, Jan 24, 2020 at 2:46 AM Motaz Hejaze mailto:trapper...@gmail.com>> wrote:

Any help friends ?

-- 
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 view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/841a0431-f1c0-473b-85df-4e6377f2bbdd%40googlegroups.com.



-- 
Regards,


Aldian Fazrihady
http://aldianfazrihady.com
-- 
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 view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAN7EoAbT10tmK87u_kLVLqYHV-JUnBgEPDziq%3DjfTwXkfjqzLA%40mail.gmail.com

.

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD%3DM5eTMot%3D59RCXhDkwwdQZDU7bCioJuFd2x-SFJr2UboYFZA%40mail.gmail.com 
.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63450ea9-2fdd-a556-5468-301568e17369%40dewhirst.com.au.


Re: Case-insensitve unique = True

2020-01-23 Thread Mike Dewhirst

On 24/01/2020 3:20 pm, Simon Charette wrote:
If you are using PostgreSQL I'd suggest using a CIText field[0] with a 
unique

constraint[1].


Surely everyone uses PostgreSQL, no?

That [0] is identical in Django 2.2 and it looks like I should migrate 
my models.CharField to django.contrib.postgresfield.CICharField


I'm already using [1] in Django 2.2

Thank you Simon you have made my day :-)

Cheers

Mike



If you are *not* using PostgreSQL your best choice is likely to 
emulate the
upcoming expression[3] support for UniqueConstraint(Lower('field')) by 
using

a RunSQL operation that performs the appropriate DDL assuming your backend
supports it.

Best,
Simon

[0] 
https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#citext-fields

[1] https://docs.djangoproject.com/en/3.0/ref/models/fields/#unique
[3] https://github.com/django/django/pull/11929

Le jeudi 23 janvier 2020 21:36:29 UTC-5, Mike Dewhirst a écrit :

What is the best way to ensure a charfield is case-insensitively
unique?

Currently I'm using a query with __iexact=True but I wonder whether
there is a better way.

Thanks

Mike


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/967c8a27-a8ec-42fc-abf5-bda76fbb5ef9%40googlegroups.com 
.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/afa46f25-214a-0de9-cc20-f58174de2bdf%40dewhirst.com.au.


Re: Case-insensitve unique = True

2020-01-23 Thread maninder singh Kumar
I wonder at that.  When I develop a model does the CharField have to be
specified case insensitive at that level.

For instance :  A search can be case insensitive and iexact is the best way.


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Fri, Jan 24, 2020 at 8:06 AM Mike Dewhirst  wrote:

> What is the best way to ensure a charfield is case-insensitively unique?
>
> Currently I'm using a query with __iexact=True but I wonder whether
> there is a better way.
>
> Thanks
>
> Mike
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/49ae5424-f079-d4eb-bc6d-aa5231efa773%40dewhirst.com.au
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABOHK3RTRmRwyMsgdryp50vVbBeopqBcu2CCQdrY9aJySjwkpg%40mail.gmail.com.


Re: Case-insensitve unique = True

2020-01-23 Thread Simon Charette
If you are using PostgreSQL I'd suggest using a CIText field[0] with a 
unique
constraint[1].

If you are *not* using PostgreSQL your best choice is likely to emulate the
upcoming expression[3] support for UniqueConstraint(Lower('field')) by using
a RunSQL operation that performs the appropriate DDL assuming your backend
supports it.

Best,
Simon

[0] 
https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#citext-fields
[1] https://docs.djangoproject.com/en/3.0/ref/models/fields/#unique
[3] https://github.com/django/django/pull/11929

Le jeudi 23 janvier 2020 21:36:29 UTC-5, Mike Dewhirst a écrit :
>
> What is the best way to ensure a charfield is case-insensitively unique? 
>
> Currently I'm using a query with __iexact=True but I wonder whether 
> there is a better way. 
>
> Thanks 
>
> Mike 
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/967c8a27-a8ec-42fc-abf5-bda76fbb5ef9%40googlegroups.com.


Re: Best Django Deployment

2020-01-23 Thread onlinejudge95
+1 on the question.
Mainly whether the Apache + modWSGI or Nginx is the better way to go.

On Fri, Jan 24, 2020, 7:41 AM Aldian Fazrihady  wrote:

> Google AppEngine fFex will handle everything for you, but for my
> requirement, the price is too expensive, so I don't use it and I also don't
> use any Google cloud product to host my Django app.
> If your app code is not efficient, it means it will use more resources,
> then the monthly bill of AppEngine Flex will also be higher.
>
> Google AppEngine flex is using nginx.
>
> On Fri, Jan 24, 2020 at 2:46 AM Motaz Hejaze  wrote:
>
>> Any help friends ?
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/841a0431-f1c0-473b-85df-4e6377f2bbdd%40googlegroups.com
>> .
>>
>
>
> --
> Regards,
>
> Aldian Fazrihady
> http://aldianfazrihady.com
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN7EoAbT10tmK87u_kLVLqYHV-JUnBgEPDziq%3DjfTwXkfjqzLA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD%3DM5eTMot%3D59RCXhDkwwdQZDU7bCioJuFd2x-SFJr2UboYFZA%40mail.gmail.com.


Case-insensitve unique = True

2020-01-23 Thread Mike Dewhirst

What is the best way to ensure a charfield is case-insensitively unique?

Currently I'm using a query with __iexact=True but I wonder whether 
there is a better way.


Thanks

Mike


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/49ae5424-f079-d4eb-bc6d-aa5231efa773%40dewhirst.com.au.


Re: Best Django Deployment

2020-01-23 Thread Aldian Fazrihady
Google AppEngine fFex will handle everything for you, but for my
requirement, the price is too expensive, so I don't use it and I also don't
use any Google cloud product to host my Django app.
If your app code is not efficient, it means it will use more resources,
then the monthly bill of AppEngine Flex will also be higher.

Google AppEngine flex is using nginx.

On Fri, Jan 24, 2020 at 2:46 AM Motaz Hejaze  wrote:

> Any help friends ?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/841a0431-f1c0-473b-85df-4e6377f2bbdd%40googlegroups.com
> .
>


-- 
Regards,

Aldian Fazrihady
http://aldianfazrihady.com

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN7EoAbT10tmK87u_kLVLqYHV-JUnBgEPDziq%3DjfTwXkfjqzLA%40mail.gmail.com.


Re: Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread Tatiana Mesa
Gracias Daniel, me seria muy útil un ejemplo.

El jue., 23 de ene. de 2020 a la(s) 15:24, DANIEL URBANO DE LA RUA (
dannybombas...@gmail.com) escribió:

> Create un tag template espera te mando doc
>
> On Thu, 23 Jan 2020, 19:38 Tatiana Mesa,  wrote:
>
>> Hola Daniel, gracias por la rápida respuesta
>>
>> Tengo el campo* DateTimeField* que trae la fecha y la hora en el mismo
>> campo. Quiero separarlos solo en la vista del Html. Sin modificar el tipo
>> de dato.
>>
>> Agradezco tu respuesta.
>>
>> El jue., 23 de ene. de 2020 a la(s) 12:27, DANIEL URBANO DE LA RUA (
>> dannybombas...@gmail.com) escribió:
>>
>>>
>>> https://docs.djangoproject.com/en/3.0/ref/forms/fields/#django.forms.TimeField
>>>
>>>
>>> El jue., 23 ene. 2020 a las 18:24, DANIEL URBANO DE LA RUA (<
>>> dannybombas...@gmail.com>) escribió:
>>>
 https://www.geeksforgeeks.org/timefield-django-models/


 El jue., 23 ene. 2020 a las 18:19, DANIEL URBANO DE LA RUA (<
 dannybombas...@gmail.com>) escribió:

> Tienes date and time field
>
> On Thu, 23 Jan 2020, 15:57 Tatiana Mesa, 
> wrote:
>
>> Buenas tardes comunidad,
>>
>> He empezado a trabajar con vistas basadas en clases en Django y tengo
>> una pequeña complicación.
>>
>> Quisiera saber de que forma puedo separar un campo *fecha (*
>> DateTimeField*), *en un input la feha y en otro input la hora en una
>> vista de *HTML.*
>>
>>
>>
>> Tengo en mi modelo un campo de *Fecha*
>> [image: image.png]
>>  Y tengo un formulario para realizar updates
>> [image: image.png]
>>
>> Les agradezco mucho sus respuestas.
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com
>> 
>> .
>>
> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAO_yRT3twv2oPWkp_hRjsm4K433QFj_U6w%2B5-fqjytNBNOSdgw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHAr%3D_2OBLQmNVD9pMaXtBor_1U7FZh8%3DgOXUenPLoCyxH1fuw%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAO_yRT2XwbGOpQasLJH5MDCNPuyeY2ozKgLC57vOGK1nzfcMgA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHAr%3D_20L6xEbVuFr05WmB9kQT1A2Jjy_p-UjBUYPANCqGYq2A%40mail.gmail.com.


Re: Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread DANIEL URBANO DE LA RUA
https://docs.djangoproject.com/en/3.0/howto/custom-template-tags/
mira bien aqui tu pudes facbicarte uno para separara la hora y la devuelves
a la vista en tiempo de ejecucion osea cuando se renderiza tu pagina creas
un archivo y lo instancias {% tag_template_name  args kwars %} puedes tomar
el string y devover lo que quieras que se renderize


un ujeplo de archivo

from django import template
from django.utils import timezone
from datetime import timedelta, date
register = template.Library()

@register.filter
def to_and(value):
value = str(value)
return value.replace(",",".")



@register.filter
def many_days(value):
today = timezone.localtime()
fecha = value - today
if fecha.days >= 0:
if fecha.days == 0:
fecha = 'Llegan Hoy'
else:
fecha = "Quedan :"+str(fecha.days)+' Dias y '+str(((str(fecha).split(','))[1
].split('.')[0]))+" h/mm"
else:
fecha = value
return fecha


El jue., 23 ene. 2020 a las 21:22, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> Create un tag template espera te mando doc
>
> On Thu, 23 Jan 2020, 19:38 Tatiana Mesa,  wrote:
>
>> Hola Daniel, gracias por la rápida respuesta
>>
>> Tengo el campo* DateTimeField* que trae la fecha y la hora en el mismo
>> campo. Quiero separarlos solo en la vista del Html. Sin modificar el tipo
>> de dato.
>>
>> Agradezco tu respuesta.
>>
>> El jue., 23 de ene. de 2020 a la(s) 12:27, DANIEL URBANO DE LA RUA (
>> dannybombas...@gmail.com) escribió:
>>
>>>
>>> https://docs.djangoproject.com/en/3.0/ref/forms/fields/#django.forms.TimeField
>>>
>>>
>>> El jue., 23 ene. 2020 a las 18:24, DANIEL URBANO DE LA RUA (<
>>> dannybombas...@gmail.com>) escribió:
>>>
 https://www.geeksforgeeks.org/timefield-django-models/


 El jue., 23 ene. 2020 a las 18:19, DANIEL URBANO DE LA RUA (<
 dannybombas...@gmail.com>) escribió:

> Tienes date and time field
>
> On Thu, 23 Jan 2020, 15:57 Tatiana Mesa, 
> wrote:
>
>> Buenas tardes comunidad,
>>
>> He empezado a trabajar con vistas basadas en clases en Django y tengo
>> una pequeña complicación.
>>
>> Quisiera saber de que forma puedo separar un campo *fecha (*
>> DateTimeField*), *en un input la feha y en otro input la hora en una
>> vista de *HTML.*
>>
>>
>>
>> Tengo en mi modelo un campo de *Fecha*
>> [image: image.png]
>>  Y tengo un formulario para realizar updates
>> [image: image.png]
>>
>> Les agradezco mucho sus respuestas.
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com
>> 
>> .
>>
> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAO_yRT3twv2oPWkp_hRjsm4K433QFj_U6w%2B5-fqjytNBNOSdgw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHAr%3D_2OBLQmNVD9pMaXtBor_1U7FZh8%3DgOXUenPLoCyxH1fuw%40mail.gmail.com
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_yRT2Q69rsFhLCBduVZkf%2BfMjmBXAGJG9Ju6NHGcjoLGxGfQ%40mail.gmail.com.


Re: Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread DANIEL URBANO DE LA RUA
Create un tag template espera te mando doc

On Thu, 23 Jan 2020, 19:38 Tatiana Mesa,  wrote:

> Hola Daniel, gracias por la rápida respuesta
>
> Tengo el campo* DateTimeField* que trae la fecha y la hora en el mismo
> campo. Quiero separarlos solo en la vista del Html. Sin modificar el tipo
> de dato.
>
> Agradezco tu respuesta.
>
> El jue., 23 de ene. de 2020 a la(s) 12:27, DANIEL URBANO DE LA RUA (
> dannybombas...@gmail.com) escribió:
>
>>
>> https://docs.djangoproject.com/en/3.0/ref/forms/fields/#django.forms.TimeField
>>
>>
>> El jue., 23 ene. 2020 a las 18:24, DANIEL URBANO DE LA RUA (<
>> dannybombas...@gmail.com>) escribió:
>>
>>> https://www.geeksforgeeks.org/timefield-django-models/
>>>
>>>
>>> El jue., 23 ene. 2020 a las 18:19, DANIEL URBANO DE LA RUA (<
>>> dannybombas...@gmail.com>) escribió:
>>>
 Tienes date and time field

 On Thu, 23 Jan 2020, 15:57 Tatiana Mesa, 
 wrote:

> Buenas tardes comunidad,
>
> He empezado a trabajar con vistas basadas en clases en Django y tengo
> una pequeña complicación.
>
> Quisiera saber de que forma puedo separar un campo *fecha (*
> DateTimeField*), *en un input la feha y en otro input la hora en una
> vista de *HTML.*
>
>
>
> Tengo en mi modelo un campo de *Fecha*
> [image: image.png]
>  Y tengo un formulario para realizar updates
> [image: image.png]
>
> Les agradezco mucho sus respuestas.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com
> 
> .
>
 --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAO_yRT3twv2oPWkp_hRjsm4K433QFj_U6w%2B5-fqjytNBNOSdgw%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHAr%3D_2OBLQmNVD9pMaXtBor_1U7FZh8%3DgOXUenPLoCyxH1fuw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_yRT2XwbGOpQasLJH5MDCNPuyeY2ozKgLC57vOGK1nzfcMgA%40mail.gmail.com.


Best Django Deployment

2020-01-23 Thread Motaz Hejaze
Any help friends ?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/841a0431-f1c0-473b-85df-4e6377f2bbdd%40googlegroups.com.


Re: Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread Tatiana Mesa
Hola Daniel, gracias por la rápida respuesta

Tengo el campo* DateTimeField* que trae la fecha y la hora en el mismo
campo. Quiero separarlos solo en la vista del Html. Sin modificar el tipo
de dato.

Agradezco tu respuesta.

El jue., 23 de ene. de 2020 a la(s) 12:27, DANIEL URBANO DE LA RUA (
dannybombas...@gmail.com) escribió:

>
> https://docs.djangoproject.com/en/3.0/ref/forms/fields/#django.forms.TimeField
>
>
> El jue., 23 ene. 2020 a las 18:24, DANIEL URBANO DE LA RUA (<
> dannybombas...@gmail.com>) escribió:
>
>> https://www.geeksforgeeks.org/timefield-django-models/
>>
>>
>> El jue., 23 ene. 2020 a las 18:19, DANIEL URBANO DE LA RUA (<
>> dannybombas...@gmail.com>) escribió:
>>
>>> Tienes date and time field
>>>
>>> On Thu, 23 Jan 2020, 15:57 Tatiana Mesa, 
>>> wrote:
>>>
 Buenas tardes comunidad,

 He empezado a trabajar con vistas basadas en clases en Django y tengo
 una pequeña complicación.

 Quisiera saber de que forma puedo separar un campo *fecha (*
 DateTimeField*), *en un input la feha y en otro input la hora en una
 vista de *HTML.*



 Tengo en mi modelo un campo de *Fecha*
 [image: image.png]
  Y tengo un formulario para realizar updates
 [image: image.png]

 Les agradezco mucho sus respuestas.



 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com
 
 .

>>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAO_yRT3twv2oPWkp_hRjsm4K433QFj_U6w%2B5-fqjytNBNOSdgw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHAr%3D_2OBLQmNVD9pMaXtBor_1U7FZh8%3DgOXUenPLoCyxH1fuw%40mail.gmail.com.


Re: Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread DANIEL URBANO DE LA RUA
https://docs.djangoproject.com/en/3.0/ref/forms/fields/#django.forms.TimeField


El jue., 23 ene. 2020 a las 18:24, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> https://www.geeksforgeeks.org/timefield-django-models/
>
>
> El jue., 23 ene. 2020 a las 18:19, DANIEL URBANO DE LA RUA (<
> dannybombas...@gmail.com>) escribió:
>
>> Tienes date and time field
>>
>> On Thu, 23 Jan 2020, 15:57 Tatiana Mesa, 
>> wrote:
>>
>>> Buenas tardes comunidad,
>>>
>>> He empezado a trabajar con vistas basadas en clases en Django y tengo
>>> una pequeña complicación.
>>>
>>> Quisiera saber de que forma puedo separar un campo *fecha (*
>>> DateTimeField*), *en un input la feha y en otro input la hora en una
>>> vista de *HTML.*
>>>
>>>
>>>
>>> Tengo en mi modelo un campo de *Fecha*
>>> [image: image.png]
>>>  Y tengo un formulario para realizar updates
>>> [image: image.png]
>>>
>>> Les agradezco mucho sus respuestas.
>>>
>>>
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com
>>> 
>>> .
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_yRT3twv2oPWkp_hRjsm4K433QFj_U6w%2B5-fqjytNBNOSdgw%40mail.gmail.com.


Re: Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread DANIEL URBANO DE LA RUA
https://www.geeksforgeeks.org/timefield-django-models/


El jue., 23 ene. 2020 a las 18:19, DANIEL URBANO DE LA RUA (<
dannybombas...@gmail.com>) escribió:

> Tienes date and time field
>
> On Thu, 23 Jan 2020, 15:57 Tatiana Mesa,  wrote:
>
>> Buenas tardes comunidad,
>>
>> He empezado a trabajar con vistas basadas en clases en Django y tengo una
>> pequeña complicación.
>>
>> Quisiera saber de que forma puedo separar un campo *fecha (*DateTimeField*),
>> *en un input la feha y en otro input la hora en una vista de *HTML.*
>>
>>
>>
>> Tengo en mi modelo un campo de *Fecha*
>> [image: image.png]
>>  Y tengo un formulario para realizar updates
>> [image: image.png]
>>
>> Les agradezco mucho sus respuestas.
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_yRT1ba6VH4-ASk%3D05Y8Q9S%2BJA8qf%2BQ4wK7M3gUaedANYmGw%40mail.gmail.com.


Re: Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread DANIEL URBANO DE LA RUA
Tienes date and time field

On Thu, 23 Jan 2020, 15:57 Tatiana Mesa,  wrote:

> Buenas tardes comunidad,
>
> He empezado a trabajar con vistas basadas en clases en Django y tengo una
> pequeña complicación.
>
> Quisiera saber de que forma puedo separar un campo *fecha (*DateTimeField*),
> *en un input la feha y en otro input la hora en una vista de *HTML.*
>
>
>
> Tengo en mi modelo un campo de *Fecha*
> [image: image.png]
>  Y tengo un formulario para realizar updates
> [image: image.png]
>
> Les agradezco mucho sus respuestas.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_yRT2O4ozQmu2btL4xHO04cKZDXzMWePhinx4D8EhA_eO_ew%40mail.gmail.com.


Separa Fecha y Hora en dos inputs utilizando ModelsForm

2020-01-23 Thread Tatiana Mesa
Buenas tardes comunidad,

He empezado a trabajar con vistas basadas en clases en Django y tengo una
pequeña complicación.

Quisiera saber de que forma puedo separar un campo *fecha (*DateTimeField*),
*en un input la feha y en otro input la hora en una vista de *HTML.*



Tengo en mi modelo un campo de *Fecha*
[image: image.png]
 Y tengo un formulario para realizar updates
[image: image.png]

Les agradezco mucho sus respuestas.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHAr%3D_3CbZXT9x_NXQ-MJH8U3tJz7JEJj3-JxBuBx_s7JxUwqQ%40mail.gmail.com.


Re: How to I create download link of some file using django

2020-01-23 Thread Kasper Laudrup

Hi Aditya,

On 23/01/2020 12.46, aditya surana wrote:

What if i don't want to add this additional feature?.



Then don't?

Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d366f1f7-12e6-b96f-b2a0-42e02a44ca31%40stacktrace.dk.


Re: How to I create download link of some file using django

2020-01-23 Thread aditya surana
What if i don't want to add this additional feature?.

On Monday, June 24, 2019 at 6:44:22 PM UTC+5:30, Nishant Boro wrote:
>
> You can use this simple module:
>
> https://github.com/nishant-boro/django-rest-framework-download-expert
>
> This module provides a simple way to serve files for download in django 
> rest framework using Apache module Xsendfile. It also has an additional 
> feature of serving downloads only to users belonging to a particular group
>
> On Thursday, May 26, 2011 at 3:04:20 PM UTC+5:30, Kann wrote:
>>
>> Dear all, 
>>
>> I am new to django and still kinda confused about how to handle 
>> download link using django. What I did up to now was having a file 
>> handle and point that handle to django's File object. So, now I have 
>> django file object but I don't know how to incorporate that file 
>> object into my template. Doing somefile.name will only give the file 
>> name on the template, though; but how do I create a downloadable link 
>> for that file from that on my template? 
>>
>> Best, 
>>
>> Kann
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d3945b94-9653-42c2-a714-b0e741c65ed7%40googlegroups.com.


Re: Got an interview, need some idea for projects.

2020-01-23 Thread Aditya Khatwa
Create a small website that shows your own portfolio such as your project
listing etc can be done in 3-5 days.
Add a form as well if you want.
Focus on the dynamic aspect rather than its aesthetic for a faster result...

On Thu, 23 Jan 2020, 12:41 Jack Lin,  wrote:

>
>
> Hi Django users, I'm Jack who currently learning Django everyday
> 
> My practice projects is little tiny function for now. however I got an
> interview yesterday which is an Django Web Developer in Stock Company.
> 
>
> The contact person told me that I should prepare a project to show my
> skills. It make me wonder should I do something bigger rather than practice
> some teeny- tiny function :(
> I got a few knowledge and a lot of interest in stock. But I got no ideas
> what can I do on a website?
>
> Any ideas?
>
>
> Sincerely Yours
> Jack Sanchez, who learn DjangoEveryDay
> 
> .
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cd6cd293-ed76-49ad-8e70-a0511088912c%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOnqjLwUOJZsTHU_pQZwhP3V4CnQ1jmB1dtFXevKm6Le6edESw%40mail.gmail.com.


Re: Django and MySQL NDB Cluster

2020-01-23 Thread Victor Guimarães Nunes
I found a (dummy) solution for this. The error was occurring when a Signal 
from post_save of User model was being triggered. In that signal I was 
performing a SomeModel.objects.get_or_create.

So, apparently the get_or_create method was implemented using transactions 
with savepoints enabled. All I had to do was check if the Signal is called 
when the instance of SomeModel is created and use SomeMode.objects.create 
instead of SomeMode.objects.get_or_create.

But it still sucks tho, because everytime I use @transaction.atomic I have 
to pass a savepoint=False parameter to it. The sucky part is, if I'm 
undertanding it right, I have to implement my own database backend only to 
disable savepoints by default on all transactions and I don't thinks it 
worths the effort.

Well, anyway, if someone already knows where I can find a MySQL NDBCLUSTER 
implementation of a django database backend I would be glad. Thank you all!

Em quarta-feira, 22 de janeiro de 2020 17:19:42 UTC-3, Victor Guimarães 
Nunes escreveu:
>
> Hi,
>
> I'm having some trouble setting up a Django project with a MySQL NDB 
> Cluster. I found I had to set the storage engine on 
> DATABASES['default']['OPTIONS'] and I did it.
>
> DATABASES = {
> 'default': config('DATABASE_URL', cast=db_url)
> }
>
> # Check if mysql database engine is NDBCLUSTER
> if config('USE_NDBCLUSTER', cast=bool, default=False):
> DATABASES['default'].update({
> 'OPTIONS': {
> 'init_command': 'SET default_storage_engine=NDBCLUSTER;',
> }
> })
>
> but almost always when I try to perform some write action on the database 
> I get the following esception:
>
> OperationalError at /admin/auth/user/add/
>
> (1178, "The storage engine for the table doesn't support SAVEPOINT")
>
>
> I don't quite get what I supposed to do about once the cluster demands a 
> NDBCLUSTER storage engine to work properly and I don't have any ideia of 
> what is savepoints and where/how I can disabled it.
>
> Any thoughts about this issue?
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e92ee650-63da-4c7d-846b-fa19b37a37dd%40googlegroups.com.


Re: Django and MySQL NDB Cluster

2020-01-23 Thread Victor Guimarães Nunes
No, the database is all set and includes some data by the way.

Em quinta-feira, 23 de janeiro de 2020 04:49:16 UTC-3, maninder singh Kumar 
escreveu:
>
> Could it be the server doesn't have the database ?
>
>  
>
> [image: --]
>   
> Maninder Kumar
> [image: http://]about.me/maninder.s.kumar
> 
> 
>  
>
>
> On Thu, Jan 23, 2020 at 1:49 AM Victor Guimarães Nunes <
> nuness...@gmail.com > wrote:
>
>> Hi,
>>
>> I'm having some trouble setting up a Django project with a MySQL NDB 
>> Cluster. I found I had to set the storage engine on 
>> DATABASES['default']['OPTIONS'] and I did it.
>>
>> DATABASES = {
>> 'default': config('DATABASE_URL', cast=db_url)
>> }
>>
>> # Check if mysql database engine is NDBCLUSTER
>> if config('USE_NDBCLUSTER', cast=bool, default=False):
>> DATABASES['default'].update({
>> 'OPTIONS': {
>> 'init_command': 'SET default_storage_engine=NDBCLUSTER;',
>> }
>> })
>>
>> but almost always when I try to perform some write action on the database 
>> I get the following esception:
>>
>> OperationalError at /admin/auth/user/add/
>>
>> (1178, "The storage engine for the table doesn't support SAVEPOINT")
>>
>>
>> I don't quite get what I supposed to do about once the cluster demands a 
>> NDBCLUSTER storage engine to work properly and I don't have any ideia of 
>> what is savepoints and where/how I can disabled it.
>>
>> Any thoughts about this issue?
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d3b6be1a-acb1-4543-b8f2-780b8ef5b62d%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5efe288f-5683-4ebe-82f3-5de9a55ae5e7%40googlegroups.com.


Re: Django and MySQL NDB Cluster

2020-01-23 Thread Victor Guimarães Nunes
Will do

Em quarta-feira, 22 de janeiro de 2020 18:32:04 UTC-3, Jason escreveu:
>
> https://code.djangoproject.com/ticket/27677
>
> Check the last comment from Tim.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e65cd43-c8d6-4c0f-9931-9f9207df7d66%40googlegroups.com.


Re: Got an interview, need some idea for projects.

2020-01-23 Thread Motaz Hejaze
Yes ..
You can follow projects from books like ..

Django 2 by example
Building Django 2 web applications

On Thu, Jan 23, 2020 at 9:10 AM Jack Lin  wrote:

>
>
> Hi Django users, I'm Jack who currently learning Django everyday
> 
> My practice projects is little tiny function for now. however I got an
> interview yesterday which is an Django Web Developer in Stock Company.
> 
>
> The contact person told me that I should prepare a project to show my
> skills. It make me wonder should I do something bigger rather than practice
> some teeny- tiny function :(
> I got a few knowledge and a lot of interest in stock. But I got no ideas
> what can I do on a website?
>
> Any ideas?
>
>
> Sincerely Yours
> Jack Sanchez, who learn DjangoEveryDay
> 
> .
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cd6cd293-ed76-49ad-8e70-a0511088912c%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-cwvt9_JBDYS-zQ38iiBowjbO0uC1%2BO1F25OTzL61pn_Q%40mail.gmail.com.