これに対する解決策を見つけることができませんでした。
models.py
class Product(models.Model):
prod_id = models.IntegerField(primary_key = True)
prod_name = models.CharField(max_length=128)
prod_price = models.FloatField()
prod_quantity = models.CharField(max_length=75)
prod_description = models.TextField()
prod_attributes = models.TextField()
prod_ingredients = models.TextField()
設定.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'MyApp',
これはスローされるエラーです:
テーブルを作成しています... (*args, ** options.dict) ファイル "C:\Python27\Lib\site-packages\django\core\management\base.py"、232 行目、実行出力 = self.handle(*args, **options) ファイル "C:\Python27\ Lib\site-packages\django\core\management\base.py", line 371, in handle return self.handle_noargs(**options) File "C:\Python27\Lib\site-packages\django\core\management\ commands\syncdb.py"、91 行目、handle_noargs sql で、参照 = connection.creation.sql_create_model(model、self.style、seen_models) ファイル "C:\Python27\Lib\site-packages\django\db\backends\creation .py"、82 行目、sql_create_model style.SQL_TABLE(qn(opts.db_table)) + ' ('] File "C:\Python27\Lib\site-packages\django\db\backends\mysql\base.py" name.startswith(" ") の場合、quote_name の 244 行目
") and name.endswith("
:AttributeError: 'list' オブジェクトに属性 'startswith' がありません
したがって、重要な部分: AttributeError: 'list' object has no attribute 'startswith'
なぜこのエラーが発生するのか、誰にもアイデアがありますか? 私はさまざまなことを試しましたが、他のテーブルを正常に作成しても機能せず、モデルクラスが作成されません。私はmysqlデータベースを使用しています。