On page 78, after the comment line
$ python manage.py makemigrations
$ python manage.py migrate
(my venv should be on)
My Terminal responded:
/Users/Ket/projects/hellowebapp/venv/lib/python2.7/site-packages/django/contrib/sites/models.py:78: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn’t declare an explicit app_label and either isn’t in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Site(models.Model):
System check identified some issues:
WARNINGS:
registration.RegistrationProfile.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
Migrations for ‘collection’:
0002_thing_user.py:
- Add field user to thing
(venv)Ketings-MacBook-Air:hellowebapp Ket$ python manage.py migrate
/Users/Ket/projects/hellowebapp/venv/lib/python2.7/site-packages/django/contrib/sites/models.py:78: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn’t declare an explicit app_label and either isn’t in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Site(models.Model):
System check identified some issues:
WARNINGS:
registration.RegistrationProfile.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
Operations to perform:
Synchronize unmigrated apps: staticfiles, humanize, messages, registration
Apply all migrations: admin, contenttypes, collection, auth, sessions
Synchronizing apps without migrations:
Creating tables…
Creating table registration_registrationprofile
Running deferred SQL…
Installing custom SQL…
Running migrations:
Rendering model states… DONE
Applying collection.0002_thing_user… OK
(venv)Ketings-MacBook-Air:hellowebapp Ket$
My web page failed to load “This webpage is not available”, and below is the error message in my terminal:
Traceback (most recent call last):
File “manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/Users/Ket/projects/hellowebapp/venv/lib/python2.7/site-packages/django/core/management/init.py”, line 338, in execute_from_command_line
utility.execute()
File “/Users/Ket/projects/hellowebapp/venv/lib/python2.7/site-packages/django/core/management/init.py”, line 312, in execute
django.setup()
File “/Users/Ket/projects/hellowebapp/venv/lib/python2.7/site-packages/django/init.py”, line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File “/Users/Ket/projects/hellowebapp/venv/lib/python2.7/site-packages/django/apps/registry.py”, line 108, in populate
app_config.import_models(all_models)
File “/Users/Ket/projects/hellowebapp/venv/lib/python2.7/site-packages/django/apps/config.py”, line 198, in import_models
self.models_module = import_module(models_module_name)
File “/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/Users/Ket/projects/hellowebapp/collection/models.py”, line 1, in
from django.contrib.auth.models import user
ImportError: cannot import name user