0

I get following error after I try to sync with the database:

Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv self.execute(*args, **options.__dict__) File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/core/management/base.py", line 284, in execute self.validate() File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/core/management/base.py", line 310, in validate num_errors = get_validation_errors(s, app) File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/core/management/validation.py", line 34, in get_validation_errors for (app_name, error) in get_app_errors().items(): File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors self._populate() File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _populate self.load_app(app_name, True) File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app models = import_module('%s.models' % app_name) File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module __import__(name) File "/home/vitaly/Documents/skillshare/src/signups/models.py", line 6, in <module> class SignUp(models.Model): File "/home/vitaly/Documents/skillshare/src/signups/models.py", line 10, in SignUp timestamp = models.DateTimeField(auto_now_add=True, auto_not=False) File "/home/vitaly/Documents/skillshare/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 737, in __init__ Field.__init__(self, verbose_name, name, **kwargs) TypeError: __init__() got an unexpected keyword argument 'auto_not' 

I'm new to Django, so I really have no idea what to think of it.

1 Answer 1

2

It is a typo, instead of auto_not, you probably meant auto_now.

Replace

timestamp = models.DateTimeField(auto_now_add=True, auto_not=False) 

with:

timestamp = models.DateTimeField(auto_now_add=True, auto_now=False) 
Sign up to request clarification or add additional context in comments.

2 Comments

Actually False is the default for both auto_now_add and auto_now, so better is just to remove auto_now entirely.
@CarlMeyer good point, thank you. Though one could say "explicit is better than implicit"..

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.