Hello,

Having trouble with something on which the documentation seems clear to 
me.  I'd greatly appreciate any help.  

I wanted to add a field to a model showing when a user signed on.  I 
thought this is right.

      signup_datetime = models.DateTimeField(auto_now_add=True)  



But python3 ./manage.py makemigrations objected:
 

*You are trying to add the field 'signup_datetime' with 'auto_now_add=True' 
to tootuser without a default; the database needs something to populate 
existing rows*
Any suggestions?

(When I tried

signup_datetime = models.DateTimeField(default=datetime.datetime.now, blank=
True) 

it said this:



*/usr/local/lib/python3.4/dist-packages/django/db/models/fields/__init__.py:1430:
 
RuntimeWarning: DateTimeField TootUser.signup_datetime received a naive 
datetime (2016-10-19 13:48:14.145943) while time zone support is active.  
RuntimeWarning)*
but honestly, I can't figure out what is wrong with the first try.)

-- 
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/e1764cbd-a492-4332-902f-aeb6d061a631%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to