Hi everybody,
I'm new in Django framework. I installed version 1.3.1 over Python 2.7.3 in Ubuntu.
I already did all steps but i have an error when i execute python manage.py sql polls to create my table's project in mysql.
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 219, in execute
self.validate()
File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "/usr/lib/python2.7/dist-packages/django/core/management/validation.py", line 35, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 146, in get_app_errors
self._populate()
File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 61, in _populate
self.load_app(app_name, True)
File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 78, in load_app
models = import_module('.models', app_name)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/ewok/www/webapp_camposchilenos/polls/models.py", line 9, in <module>
class Choice(models.Model):
File "/home/ewok/www/webapp_camposchilenos/polls/models.py", line 10, in Choice
poll = models.ForeingKey(Poll)
AttributeError: 'module' object has no attribute 'ForeingKey'
I checked my module and everything seems ok:
1 from django.db import models
2
3 # Create your models here.
4
5 class Poll(models.Model):
6 question = models.CharField(max_length=200)
7 pub_date = models.DateTimeField('date published')
8
9 class Choice(models.Model):
10 poll = models.ForeingKey(Poll)
11 choice = models.CharField(max_length=200)
12 votes = models.IntegerField()
13
Thank you for helping me.
Cheers,
Rodrigo
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/RF82XBgPJ8QJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment