Django models, adding new value, migrations
<p>I worked with django 1.9 and added a new field (creation_date) to myapp/models.py.
After that I run "python manage.py makemigrations". I got: </p>

<blockquote>
  <p>Please select a fix:</p>
  
  <ol>
  <li>Provide a one-off default now (will be set on all existing rows)</li>
  <li>Quit, and let me add a default in models.py."</li>
  </ol>
</blockquote>

<p>I choose 1-st option and added value in wrong format '10.07.2016'.
After this mistake I couldn't run "python manage.py migrate".</p>

<p>So I decided to change models.py and add a default value "datetime.now".
But after that I still have problems with "python manage.py makemigrations". I see such things like that:</p>

<blockquote>
  <p>django.core.exceptions.ValidationError: [u"'10.07.2016' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]</p>
</blockquote>

<p>How to solve this problem?</p>

<p>As long as your migration isn't applied to the database you can manually update your migration file located in <code>myapp/migrations/*.py</code>. Find the string '10.07.2016' and update it to a supported format.</p>

<p>A less attractive solution would be to delete the old migration file (as long as it isn't apllied to the database) and create a new migrations file with <code>python manage.py makemigrations</code>. Because you've updated the model to use a default value it won't ask for a one-off default this time.</p>

<p>To check whether a migration is applied to the database run: <code>python manage.py showmigrations</code>.</p>

python django django-models django-migrations