pythondjangodjango-modelsdjango-syncdbsyncdb

syncdb error in django when trying to run python manage.py syncdb


Im Following a django tutorial but I triple checked everything and its no working for me this is what I get.... what did I do wrong.

python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/core/management/base.py", line 284, in execute
self.validate()
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/core/management/base.py", line 310, in validate
num_errors = get_validation_errors(s, app)
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/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 "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors
self._populate()
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _populate
self.load_app(app_name, True)
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
models = import_module('%s.models' % app_name)
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
  File "/Volumes/SWEETMEDIA/Development/Python/hackernews/hn/stories/models.py", line 6, in <module>
(hackernews)
sweetmedia: /Volumes/SweetMedia/Development/Python/hackernews/hn                                                                                              ▸▸▸▹▹▹▹▹▹▹
→ 

This is what I have in DATABASES

 DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

This is models.py from the app stories maybe I have something in here im not picking up?

from urlparse import urlparse
from django.db import models
from django.contrib.auth.models import User

class Story(models.Model):    
    title = models.CharField(max_length=200)    
    url = models.URLField()    
    points = models.IntergerField()    
    moderator = models.ForeignKey(User)    
    created_at = models.DateTimeField(auto_now_add=True)    
    updated_at = models.DateTimeField(auto_now=True)    

    @property
    def domain(self):
    return urlparse(self.url).netloc    

Solution

  • In the moderators model I had:

    points = models.IntergerField()
    

    and "Inte(r)gerField" does not exist! lol I mistyped it. I corrected it to:

    points = models.IntegerField()