| 1 | | I used virtualenvwrapper==3.1 |
| 2 | | $mkvirtualenv mysite |
| 3 | | $workon mysite |
| 4 | | (mysite)$pip install Django-1.4c2.tar.gz |
| 5 | | (mysite)$pip install south |
| 6 | | (mysite)$tar zxvf MySQL-python-1.2.3.tar.gz |
| 7 | | (mysite)$cd MySQL-python-1.2.3 |
| 8 | | (mysite)$vi site.cfg |
| 9 | | uncommented mysql_config and changed -> /usr/local/mysql/bin/mysql_config |
| 10 | | changed registry_key -> SOFTWARE\MySQL AB\MySQL Server 5.1 |
| 11 | | (mysite)$python setup.py build |
| 12 | | (mysite)$python setup install |
| 13 | | |
| 14 | | (mysite)$pip freeze |
| 15 | | Django==1.4c2 |
| 16 | | MySQL-python==1.2.3 |
| 17 | | South==0.7.3 |
| 18 | | wsgiref==0.1.2 |
| 19 | | |
| 20 | | (mysite)$django-admin.py startproject mysite |
| 21 | | (mysite)$./manage.py startapp polls |
| 22 | | add something to models.py |
| 23 | | -------------------------------------------------------------------------- |
| 24 | | from django.db import models |
| 25 | | |
| 26 | | class Poll(models.Model): |
| 27 | | question = models.CharField(max_length=200) |
| 28 | | -------------------------------------------------------------------------- |
| 29 | | created a mysql database 'mysite' with utf-8 unicode |
| 30 | | changed database to mysql |
| 31 | | added south and polls to INSTALLED_APPS |
| 32 | | USE_TZ is True by default |
| 33 | | (mysite)$python manage.py syncdb |
| 34 | | create superuser : no |
| 35 | | (mysite)$python manage convert_to_south polls |
| 36 | | got this |
| 37 | | ------------------------------------------------------------------------------ |
| 38 | | Creating migrations directory at '/Users/don/Workspaces/test_work/mysite/polls/migrations'... |
| 39 | | Creating __init__.py in '/Users/don/Workspaces/test_work/mysite/polls/migrations'... |
| 40 | | + Added model polls.Poll |
| 41 | | Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate polls |
| 42 | | - Soft matched migration 0001 to 0001_initial. |
| 43 | | Running migrations for polls: |
| 44 | | - Migrating forwards to 0001_initial. |
| 45 | | > polls:0001_initial |
| 46 | | (faked) |
| 47 | | /Users/don/.virtualenvs/mysite/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-03-21 02:00:29.098454) while time zone support is active. |
| 48 | | RuntimeWarning) |
| 49 | | |
| 50 | | App 'polls' converted. Note that South assumed the application's models matched the database |
| 51 | | (i.e. you haven't changed it since last syncdb); if you have, you should delete the polls/migrations |
| 52 | | directory, revert models.py so it matches the database, and try again. |
| 53 | | |
| 54 | | ------------------------------------------------------------------------------ |
| 55 | | and everytime I changed Poll model and migrate it always got this warning |
| 56 | | (mysite)$python manage.py schemamigration polls --auto |
| 57 | | (mysite)$python manage.py migrate polls |
| 58 | | ------------------------------------------------------------------------------ |
| 59 | | Running migrations for polls: |
| 60 | | - Migrating forwards to 0002_auto__add_field_poll_name. |
| 61 | | > polls:0002_auto__add_field_poll_name |
| 62 | | /Users/don/.virtualenvs/mysite/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-03-21 02:05:13.321314) while time zone support is active. |
| 63 | | RuntimeWarning) |
| 64 | | - Loading initial data for polls. |
| 65 | | Installed 0 object(s) from 0 fixture(s) |
| 66 | | ------------------------------------------------------------------------------ |
| 67 | | I pip install pytz got nothing help. |
| 68 | | But when I created a new virtualenv with django1.3.1, there is no warning at all. |
| 69 | | like this |
| 70 | | ------------------------------------------------------------------------------ |
| 71 | | (mysite2)don$ python manage.py schemamigration polls --auto |
| 72 | | + Added field title on polls.Poll |
| 73 | | Created 0002_auto__add_field_poll_title.py. You can now apply this migration with: ./manage.py migrate polls |
| 74 | | (mysite2)don$ python manage.py migrate pollsRunning migrations for polls: |
| 75 | | - Migrating forwards to 0002_auto__add_field_poll_title. |
| 76 | | > polls:0002_auto__add_field_poll_title |
| 77 | | - Loading initial data for polls. |
| 78 | | No fixtures found. |
| 79 | | |
| 80 | | ------------------------------------------------------------------------------ |
| | 1 | I used virtualenvwrapper==3.1<br> |
| | 2 | $mkvirtualenv mysite<br> |
| | 3 | $workon mysite<br> |
| | 4 | (mysite)$pip install Django-1.4c2.tar.gz<br> |
| | 5 | (mysite)$pip install south<br> |
| | 6 | (mysite)$tar zxvf MySQL-python-1.2.3.tar.gz<br> |
| | 7 | (mysite)$cd MySQL-python-1.2.3<br> |
| | 8 | (mysite)$vi site.cfg <br> |
| | 9 | uncommented mysql_config and changed -> /usr/local/mysql/bin/mysql_config<br> |
| | 10 | changed registry_key -> SOFTWARE\MySQL AB\MySQL Server 5.1<br> |
| | 11 | (mysite)$python setup.py build<br> |
| | 12 | (mysite)$python setup install<br> |
| | 13 | <br> |
| | 14 | (mysite)$pip freeze<br> |
| | 15 | Django==1.4c2<br> |
| | 16 | MySQL-python==1.2.3<br> |
| | 17 | South==0.7.3<br> |
| | 18 | wsgiref==0.1.2<br> |
| | 19 | <br> |
| | 20 | (mysite)$django-admin.py startproject mysite<br> |
| | 21 | (mysite)$./manage.py startapp polls<br> |
| | 22 | add something to models.py<br> |
| | 23 | --------------------------------------------------------------------------<br> |
| | 24 | from django.db import models<br> |
| | 25 | <br> |
| | 26 | class Poll(models.Model):<br> |
| | 27 | question = models.CharField(max_length=200)<br> |
| | 28 | --------------------------------------------------------------------------<br> |
| | 29 | created a mysql database 'mysite' with utf-8 unicode<br> |
| | 30 | changed database to mysql<br> |
| | 31 | added south and polls to INSTALLED_APPS<br> |
| | 32 | USE_TZ is True by default<br> |
| | 33 | (mysite)$python manage.py syncdb<br> |
| | 34 | create superuser : no<br> |
| | 35 | (mysite)$python manage convert_to_south polls<br> |
| | 36 | got this<br> |
| | 37 | ------------------------------------------------------------------------------<br> |
| | 38 | Creating migrations directory at '/Users/don/Workspaces/test_work/mysite/polls/migrations'...<br> |
| | 39 | Creating __init__.py in '/Users/don/Workspaces/test_work/mysite/polls/migrations'...<br> |
| | 40 | + Added model polls.Poll<br> |
| | 41 | Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate polls<br> |
| | 42 | - Soft matched migration 0001 to 0001_initial.<br> |
| | 43 | Running migrations for polls:<br> |
| | 44 | - Migrating forwards to 0001_initial.<br> |
| | 45 | > polls:0001_initial<br> |
| | 46 | (faked)<br> |
| | 47 | /Users/don/.virtualenvs/mysite/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-03-21 02:00:29.098454) while time zone support is active.<br> |
| | 48 | RuntimeWarning)<br> |
| | 49 | <br> |
| | 50 | App 'polls' converted. Note that South assumed the application's models matched the database<br> |
| | 51 | (i.e. you haven't changed it since last syncdb); if you have, you should delete the polls/migrations<br> |
| | 52 | directory, revert models.py so it matches the database, and try again.<br> |
| | 53 | <br> |
| | 54 | ------------------------------------------------------------------------------<br> |
| | 55 | and everytime I changed Poll model and migrate it always got this warning<br> |
| | 56 | (mysite)$python manage.py schemamigration polls --auto<br> |
| | 57 | (mysite)$python manage.py migrate polls<br> |
| | 58 | ------------------------------------------------------------------------------<br> |
| | 59 | Running migrations for polls:<br> |
| | 60 | - Migrating forwards to 0002_auto__add_field_poll_name.<br> |
| | 61 | > polls:0002_auto__add_field_poll_name<br> |
| | 62 | /Users/don/.virtualenvs/mysite/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-03-21 02:05:13.321314) while time zone support is active.<br> |
| | 63 | RuntimeWarning)<br> |
| | 64 | - Loading initial data for polls.<br> |
| | 65 | Installed 0 object(s) from 0 fixture(s)<br> |
| | 66 | ------------------------------------------------------------------------------<br> |
| | 67 | I pip install pytz got nothing help.<br> |
| | 68 | But when I created a new virtualenv with django1.3.1, there is no warning at all.<br> |
| | 69 | like this<br> |
| | 70 | ------------------------------------------------------------------------------<br> |
| | 71 | (mysite2)don$ python manage.py schemamigration polls --auto<br> |
| | 72 | + Added field title on polls.Poll<br> |
| | 73 | Created 0002_auto__add_field_poll_title.py. You can now apply this migration with: ./manage.py migrate polls<br> |
| | 74 | (mysite2)don$ python manage.py migrate pollsRunning migrations for polls:<br> |
| | 75 | - Migrating forwards to 0002_auto__add_field_poll_title.<br> |
| | 76 | > polls:0002_auto__add_field_poll_title<br> |
| | 77 | - Loading initial data for polls.<br> |
| | 78 | No fixtures found.<br> |
| | 79 | <br> |
| | 80 | ------------------------------------------------------------------------------<br> |