Re: How to get datetime from server

2018-09-06 Thread ireoluwa fakeye
It's better you import from django.util

On Thu, 6 Sep 2018, 17:08 Thiago Luiz Parolin, 
wrote:

> Hi,
> I am building a django system that prevent user from upload a file after a
> date.
> This date is setting using:
> today = datetime.date.today()
>
> but if the user alters his computer date, he can upload file normally
> after the end date.
> how can i assing to 'today', the date from server and not client computer?
>
> Thanks
> --
> Thiago
>
> --
> 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/CANbmKys-Yfc0JeZNaa3uG0hribKrUBN3PDGA-HAegxN2%2BBM69Q%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/CAO87g12zCGsvJDATiJqEayVjNLhfh%2BmG6cKbb4qKE7dBTjdu%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to get datetime from server

2018-09-06 Thread Thiago Luiz Parolin
Hi,
I am building a django system that prevent user from upload a file after a
date.
This date is setting using:
today = datetime.date.today()

but if the user alters his computer date, he can upload file normally after
the end date.
how can i assing to 'today', the date from server and not client computer?

Thanks
-- 
Thiago

-- 
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/CANbmKys-Yfc0JeZNaa3uG0hribKrUBN3PDGA-HAegxN2%2BBM69Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get datetime from server

2018-09-06 Thread Thiago Luiz Parolin
Sorry, my mistake!
In manage.py runserver, the server is my computer and the time displayed is
my computer time.
Putting the code in production server all work as expected!


Em qui, 6 de set de 2018 às 10:29, Thiago Luiz Parolin <
thiago.paro...@unesp.br> escreveu:

> Hi,
> I am building a django system that prevent user from upload a file after a
> date.
> This date is setting using:
> today = datetime.date.today()
>
> but if the user alters his computer date, he can upload file normally
> after the end date.
> how can i assing to 'today', the date from server and not client computer?
>
> Thanks
> --
> Thiago
>
>

-- 
Thiago Luiz Parolin

-- 
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/CANbmKysgDgv8URLTL_yXGbcxDSsSKGDh__dHOr5z0pZF4OwxnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.