Re: Filtering serializermethodfield in DRF

2021-02-23 Thread Kunal Solanke
I don't the exact use case here, but you can pass context while passing
data to specializer.And then use it inside creializer clas by self.context.
In this case you can pass query params to context

On Wed, Feb 24, 2021, 10:15 shreeh...@gmail.com 
wrote:

> I have to filter my queryset based on a query param. I have to filter
> based on serializermethodfield.
> Any help would be appreciated.
>
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0a62f492-3a41-4692-9140-48dd23d7bdbbn%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/CAOecAny7o-MrFSgaNR%2B2tKqshbxUMFtShxHw%3DiCk%2Betp-o8dZw%40mail.gmail.com.


Filtering serializermethodfield in DRF

2021-02-23 Thread shreeh...@gmail.com
I have to filter my queryset based on a query param. I have to filter based 
on serializermethodfield. 
Any help would be appreciated.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0a62f492-3a41-4692-9140-48dd23d7bdbbn%40googlegroups.com.


Re: django voluntary work.

2021-02-23 Thread Sharif Mehedi
 Mr. Gilwell Muhati,
Since you haven't made any decision yet probably because you are doubting my 
ability to work with docker. I can assure you even though I am new to docker, I 
am a quick learner, and have gone through the official docker guide, I will 
have no trouble using docker.
I only ask you to give me a chance to prove myself.
Thank you    - Mehedi
On Tuesday, February 23, 2021, 12:24:39 PM GMT+6, Sharif Mehedi 
 wrote:  
 
 >>> Hello @Sharif,>>> Do you have any experience with the following:->>>   
   
   - version control? git or svn? 
   - docker?

>>> Regards,

>>> Gilwell Muhati | +254 710 739 116 |
>>> ~~“The mind is its own place and in itself can make a heaven of hell, a 
>>> hell of heaven…”~~John Milton
Hello Gilwell Muhati,
I have experience with git (version control), and as with docker, I took a 
tutorial and set up a docker container environment with wsl-2 (Ubuntu 18.04 
Bionic), I understand how docker works and can work with docker.
Thank you for considering me to include in your team. I will be glad to get 
instructions from you in getting started on your workflow.
Regards,- MehediOn Monday, February 22, 2021 at 10:31:33 PM UTC+6 
gilw...@gmail.com wrote:

Hello @Sharif,Do you have any experience with the following:-   
   - version control? git or svn? 
   - docker?

Regards,

Gilwell Muhati | +254 710 739 116 |
 ~~“The mind is its own place and in itself can make a heaven of hell, a hell 
of heaven…”~~John Milton 

On Mon, Feb 22, 2021 at 6:55 PM Sharif Mehedi  wrote:

Hello everybody,I am trying to start a career in development. I can work around 
any problem with python. I have gone through a fair amount of django 
documentation.I am looking forward to work as a volunteer on any professional 
django project that should boost my learning and also assist on building a 
resume. I am not expecting any payment. If you hire me and see that I can 
assist on your work flow, then I am hoping I can join your team as a paid 
contributor.It would be a great help if anybody suggest anybody else where 
there is such a scope to join as a volunteer.Thank you for spending your time 
in reading this.- Mehedi



-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbeb0825-2860-407d-8764-70e6de4759a9n%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/a699f454-902f-4448-8ec8-33543985f5dbn%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/1884353950.1906585.1614139171484%40mail.yahoo.com.


Re: AttributeError: 'NoneType' object has no attribute 'replace'

2021-02-23 Thread Kasper Laudrup

On 23/02/2021 17.56, Abnilson Rafael wrote:

Hi,
I'm getting error above when I try to this program:


The get_language() member function/method of your "translation" 
object/variable doesn't return anything and you most likely expect it to 
return a string.


Try to figure out how that could happen and you'll most likely have the 
solution.


Hard to help you any further without knowing anything about what you are 
trying to achieve.


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/b8f083f9-5640-c8d0-7043-88a7a646ce85%40stacktrace.dk.


Re: Django does't send email on the remote server

2021-02-23 Thread ule...@gmail.com
I have this same problem when i use smtp = out.telenet.be
on my local server it works fine but when it use pythonanywhere.com i get 
OSError: [Errno 101] Network is unreachable

Op dinsdag 23 februari 2021 om 11:06:09 UTC+1 schreef soko...@gmail.com:

> I am trying to send an email when a user fills out a form on my site.
> Everything works on my local server, letters are sent and I am got them.
> On a remote timeweb.com server with the same settings, letters are not 
> sent.
> Tried DEBUG = False and True
> I tried different mail services: gmail, mail, yandex, timeweb mail.
> In gmail included "Unreliable applications that have access to the 
> account".
> And here I included https://accounts.google.com/DisplayUnlockCaptcha
> Nothing helps.
>
> Who knows, please tell me where to dig.
>

-- 
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/c0645f72-f24a-4ad5-978a-cfed3eedbe0en%40googlegroups.com.


“Did you mean?” search query

2021-02-23 Thread dupakoor kannan
Hello everyone,

I would like to implement a search for miss spelled words from the
database. I read the answers
https://stackoverflow.com/questions/476394/django-did-you-mean-query. Do we
have any other apps or an easy way? Any pointers?


Thank you


Kannan

-- 
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/CADiZb_e_YtwPj%3Dgi-VWL%3DGxoBwut2-aB5A6RyCaSidNsEaVGQw%40mail.gmail.com.


Re: Why is this acting like a permanent redirect?

2021-02-23 Thread Robert F
Thanks David.  I'll give this a try.

On Monday, February 22, 2021 at 4:56:11 PM UTC-8 David Nugent wrote:

> Hi Robert,
>
> To point out the most likely cause of the issue: LOGIN_REDIRECT_URL is a 
> url, not a route name.
>
> Possibly could use a reverse_lazy('login-redirect') here after import 
> django.urls, but - untested.
>
> Regards,
> David
>
> On 23 February 2021 at 07:07:52, Robert F (robe...@gmail.com) wrote:
>
> I have a Django view that I redirect a user to after they login:
>
> # settings.py
> LOGIN_REDIRECT_URL = 'login-redirect'
>
> # account/urls.py
> urlpatterns = [
> path('', include('django.contrib.auth.urls')),
> ...
> ]
>
> # home/views.py
> from account.models import Member
>
> def login_redirect(request):
> """
> Redirect member to appropriate page when they log in.
> """
> member = Member.objects.get(user__id__exact=request.user.id)
> if member.has_profile:
> return redirect('homepage', member_id=member.id)
> else:
> return redirect('profile-create', member_id=member.id)
>
> If I start Django's development server and execute this code when the 
> condition ```member.has_profile = True```, Django redirects me to the 
> homepage view as expected.  But if I then go into the database and set 
> has_profile to False, restart the web server, and execute code again, my 
> website acts as if the code isn't executed.  Instead, I'm sent immediately 
> to the homepage view again.  I can see this by looking at the terminal 
> console:
>
> [19/Feb/2021 ...] "GET /account/login/ HTTP/1.0" 200 4268   # I'm 
> using Django's default login method
> [19/Feb/2021 ...] "POST /account/login HTTP/1.0" 302 0
> [19/Feb/2021 ...] "GET /home/login_redirect/ HTTP/1.0" 200 4599
>
> This happens even though I am restarting the server and clearing my 
> browser's cache.  In fact, I can edit the login_redirect function so that 
> it only contains a single line ```pass``` and I'm still sent to the 
> homepage after logging in.
>
> def login_redirect(request):
> pass
>
> Why is this happening?  I'm not doing a permanent redirect.  And should I 
> not be using the redirect method in my login_redirect method to send a user 
> to a different page depending on whether or not they have a profile?
>
> -- 
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8423cc0d-b83b-4115-b9fa-6a28e93210d8n%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/d108d8e4-9ffa-4747-890c-ae5c3dc0367an%40googlegroups.com.


Re: Help needed

2021-02-23 Thread Rodrigo Delfino
Such as others have said, you should remove ```auto_now=True```, after 
that, you cant  forget to run ```makemigrantions``` and ```migrate```

Em terça-feira, 23 de fevereiro de 2021 às 03:04:24 UTC-3, 
bhurk...@gmail.com escreveu:

> Hello everyone,
>
> I am trying to select the custom date but 
> datetime=models.DateTimeField(auto_now=True)
> is only taking current date 
> Please help me 
>

-- 
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/a7e3f5bd-e65a-4f06-9d82-0183929376can%40googlegroups.com.


Re: Django does't send email on the remote server

2021-02-23 Thread ramadhan ngallen
Change
EMAIL_PORT = 465
EMAIL_USE_TLS=False
EMAIL_USE_SSL=True

On your sendmail function set sail_silently=False so that we can  see an error 
on terminal
On 23 Feb 2021, 14:15 +0300, Sergei Sokov , wrote:
> 'setting.py'
> EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
> EMAIL_HOST_USER = "em...@gmail.com"
> EMAIL_HOST = "smtp.gmail.com" EMAIL_PORT = 587
> EMAIL_USE_TLS = True
> EMAIL_HOST_PASSWORD = "Your_Password"
>
>  • I have chtcked spam, I have tried different email services
>  • I switched the security allow less secure app on
> вторник, 23 февраля 2021 г. в 12:05:27 UTC+1, anubhavg...@gmail.com:
> > you should be using app password instead of less secure option
> >
> > On Tue, Feb 23, 2021 at 3:36 PM Sergei Sokov  wrote:
> > > I am trying to send an email when a user fills out a form on my site.
> > > Everything works on my local server, letters are sent and I am got them.
> > > On a remote timeweb.com server with the same settings, letters are not 
> > > sent.
> > > Tried DEBUG = False and True
> > > I tried different mail services: gmail, mail, yandex, timeweb mail.
> > > In gmail included "Unreliable applications that have access to the 
> > > account".
> > > And here I included https://accounts.google.com/DisplayUnlockCaptcha
> > > Nothing helps.
> > >
> > > Who knows, please tell me where to dig.
> > > --
> > > 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...@googlegroups.com.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/django-users/9c081e17-30ad-4bf9-9728-6b3010b3736an%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/5a345341-e0b6-4d81-87d4-b2cbdcbbd1c0n%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/450d8109-6251-4975-9fbc-73bf8286dd5a%40Spark.


Re: Django does't send email on the remote server

2021-02-23 Thread Sergei Sokov


'setting.py'
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST_USER = "em...@gmail.com"
EMAIL_HOST = "smtp.gmail.com" EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_PASSWORD = "Your_Password"


   I have chtcked spam, I have tried different email services   
   I switched the security allow less secure app on
   
вторник, 23 февраля 2021 г. в 12:05:27 UTC+1, anubhavg...@gmail.com: 

> you should be using app password instead of less secure option 
>
> On Tue, Feb 23, 2021 at 3:36 PM Sergei Sokov  wrote:
>
>> I am trying to send an email when a user fills out a form on my site.
>> Everything works on my local server, letters are sent and I am got them.
>> On a remote timeweb.com server with the same settings, letters are not 
>> sent.
>> Tried DEBUG = False and True
>> I tried different mail services: gmail, mail, yandex, timeweb mail.
>> In gmail included "Unreliable applications that have access to the 
>> account".
>> And here I included https://accounts.google.com/DisplayUnlockCaptcha
>> Nothing helps.
>>
>> Who knows, please tell me where to dig.
>>
>> -- 
>>
> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9c081e17-30ad-4bf9-9728-6b3010b3736an%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/5a345341-e0b6-4d81-87d4-b2cbdcbbd1c0n%40googlegroups.com.


Re: Django does't send email on the remote server

2021-02-23 Thread Anubhav Gupta
alse please share the program to have a look on

On Tue, Feb 23, 2021 at 3:57 PM Anubhav Gupta 
wrote:

> you should be using app password instead of less secure option
>
> On Tue, Feb 23, 2021 at 3:36 PM Sergei Sokov  wrote:
>
>> I am trying to send an email when a user fills out a form on my site.
>> Everything works on my local server, letters are sent and I am got them.
>> On a remote timeweb.com server with the same settings, letters are not
>> sent.
>> Tried DEBUG = False and True
>> I tried different mail services: gmail, mail, yandex, timeweb mail.
>> In gmail included "Unreliable applications that have access to the
>> account".
>> And here I included https://accounts.google.com/DisplayUnlockCaptcha
>> Nothing helps.
>>
>> Who knows, please tell me where to dig.
>>
>> --
>> 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/9c081e17-30ad-4bf9-9728-6b3010b3736an%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/CALibKYLzWKRSKd%2Bcxhd7hg2nFdvGja-0%3DU%2BPs9wNit5%3DCwBzqw%40mail.gmail.com.


Re: Django does't send email on the remote server

2021-02-23 Thread Anubhav Gupta
you should be using app password instead of less secure option

On Tue, Feb 23, 2021 at 3:36 PM Sergei Sokov  wrote:

> I am trying to send an email when a user fills out a form on my site.
> Everything works on my local server, letters are sent and I am got them.
> On a remote timeweb.com server with the same settings, letters are not
> sent.
> Tried DEBUG = False and True
> I tried different mail services: gmail, mail, yandex, timeweb mail.
> In gmail included "Unreliable applications that have access to the
> account".
> And here I included https://accounts.google.com/DisplayUnlockCaptcha
> Nothing helps.
>
> Who knows, please tell me where to dig.
>
> --
> 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/9c081e17-30ad-4bf9-9728-6b3010b3736an%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/CALibKYLVEE3TanOuBx1C%2Bvm37hBLCpPSsrBOETRUyjbxj5bfOA%40mail.gmail.com.


Re: Help needed

2021-02-23 Thread FIRDOUS BHAT
Why don't you change field type to Char and save the datetimestamp by your
side?

On Tue, Feb 23, 2021 at 12:21 PM neha bhurke  wrote:

> I have done all these codes but it is saving only the current date .
> Any other method
> *Regard,*
> *Neha Bhurke*
>
> *Precise Industrial Solutions Private Limited*
>
> Mob: +91 7738946067 I O: +91 22 28943214
>
> Add: 115, 1st Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near
> National Park, Borivali (E), Mumbai-400066
>
>
>
> On Tue, Feb 23, 2021 at 12:10 PM Omkar Parab 
> wrote:
>
>> datetime=models.DateTimeField(auto_now=False) ?
>> Or remove "auto_now"
>> datetime=models.DateTimeField()
>>
>> On Tue, Feb 23, 2021, 11:34 AM neha bhurke  wrote:
>>
>>> Hello everyone,
>>>
>>> I am trying to select the custom date but
>>> datetime=models.DateTimeField(auto_now=True)
>>> is only taking current date 
>>> Please help me
>>>
>>> --
>>> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%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/CAEwf5Q2k2Ah3j_eSmCpjZSkfDEFKDqRySULc8Wb5kOQSwJaTRg%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/CAFB6YJpvoNNhVhgZe_Te0M4UU%2BSuS2Xdvp52BirasdJhoX-LcA%40mail.gmail.com.


Re: Help needed

2021-02-23 Thread Chelsea Fan
Replace auto_now to auto_add_now


On Tue, 23 Feb 2021, 9:04 am neha bhurke,  wrote:

> Hello everyone,
>
> I am trying to select the custom date but
> datetime=models.DateTimeField(auto_now=True)
> is only taking current date 
> Please help me
>
> --
> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAJwZndeAx%2BLoEKiVNogcE-M2FV-zjd97Vk2j2j6LaqZDE7xSoQ%40mail.gmail.com.


Re: Help needed

2021-02-23 Thread FIRDOUS BHAT
You definitely have to remove, auto_now=True

On Tue, Feb 23, 2021 at 11:34 AM neha bhurke  wrote:

> Hello everyone,
>
> I am trying to select the custom date but
> datetime=models.DateTimeField(auto_now=True)
> is only taking current date 
> Please help me
>
> --
> 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/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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/CAFB6YJqT46%3DfA_fZ%2BLGK7LmVCU3jsdbvZFh5W0BWEx3Oxh0_tg%40mail.gmail.com.


Re: Help needed

2021-02-23 Thread John
I think you are misunderstanding the use of `auto_now=True`. It will 
always set that field to the time when the object was last saved; it's 
not meant to be a form field. See 
https://docs.djangoproject.com/en/3.1/ref/models/fields/#datefield. What 
are you trying to do? Have a date field that is preset to today's date? 
If it's that, then the next paragraph in the docs explains how to set 
`default=`.


John

On 23/02/2021 07:14, neha bhurke wrote:

I have created the form
this is my views.py.
def newdata(request):
 if request.method =="POST":
 MyDataform = Dataform(request.POST)
 if MyDataform.is_valid():
 MyDataform.save()
 results = machinelist.objects.all()
 #result = data.objects.all() return redirect('/', {'data': 
results})
 else:
 MyDataform=Dataform()
 results = machinelist.objects.all()
 result = insert.objects.all()
 return redirect('/',{'data': results},{'record':result})
 else:
 results = machinelist.objects.all()
 result = insert.objects.all()
 return redirect('/', {'data': results},{'record':result})
This is my forms.py
class Dataform(forms.ModelForm):
 class Meta:
 model = insert
 fields ="__all__"
*Regard,*
*Neha Bhurke*
*
*

*Precise Industrial Solutions Private Limited*

Mob: +91 7738946067 I O: +91 22 28943214

Add: 115, 1^st  Floor, Hari Om Plaza, Behind Omkareshwar Mandir, Near 
National Park, Borivali (E), Mumbai-400066





On Tue, Feb 23, 2021 at 12:35 PM Danny > wrote:


Maybe it is not related to the model definition, but rather the
.save() object?

On Tuesday, February 23, 2021 at 1:52:04 PM UTC+7
bhurk...@gmail.com  wrote:

I have done all these codes but it is saving only the
current date .
Any other method
*Regard,*
*Neha Bhurke*
*
*

*Precise Industrial Solutions Private Limited*

Mob: +91 7738946067  I O: +91 22
28943214 

Add: 115, 1^st  Floor, Hari Om Plaza, Behind Omkareshwar
Mandir, Near National Park, Borivali (E), Mumbai-400066




On Tue, Feb 23, 2021 at 12:10 PM Omkar Parab
 wrote:

datetime=models.DateTimeField(auto_now=False) ?
Or remove "auto_now"
datetime=models.DateTimeField()

On Tue, Feb 23, 2021, 11:34 AM neha bhurke
 wrote:

Hello everyone,

I am trying to select the custom date but
datetime=models.DateTimeField(auto_now=True)
is only taking current date 
Please help me
-- 
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...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/b1c53101-c7c6-403f-9b43-6713d7f66c07n%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...@googlegroups.com.

To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAJY8mfxi-bxtyMVWiOWCESK969Ok6nZaoyhWNSLvFO_0tEGp1Q%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/c98c61c4-f767-4917-88e2-aed03c91c7can%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 

Django does't send email on the remote server

2021-02-23 Thread Sergei Sokov
I am trying to send an email when a user fills out a form on my site.
Everything works on my local server, letters are sent and I am got them.
On a remote timeweb.com server with the same settings, letters are not sent.
Tried DEBUG = False and True
I tried different mail services: gmail, mail, yandex, timeweb mail.
In gmail included "Unreliable applications that have access to the account".
And here I included https://accounts.google.com/DisplayUnlockCaptcha
Nothing helps.

Who knows, please tell me where to dig.

-- 
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/9c081e17-30ad-4bf9-9728-6b3010b3736an%40googlegroups.com.