첫 번째 Django 앱에서 작업 중이며 이상한 오류가 발생합니다. 나는 looked it up을보고 Django 문서 버전 1.5.1을 확인했는데이 오류에 대해서는 아무 말도하지 않습니다. 내가 장고와 함께 설치 한 가상 환경을 사용하고'syncdb'를 호출 할 때 장고 depracation 오류가 발생합니다.
pat.py:9: DeprecationWarning: django.utils.hashcompat is deprecated; use hashlib instead
DeprecationWarning)
TypeError: __init__() got an unexpected keyword argument 'verify_exists'
(동결 출력 PIP) :
Django==1.5.1
argparse==1.2.1
django-db-log==2.2.1
psycopg2==2.4.6
wsgiref==0.1.2
yolk==0.4.3
또한, 내가 나를 가상 비활성화 할 때 내가 python manage.py syncdb
를 실행 시도하는 것이 중요하다 환경 - 오류없이. 이 오류는 내 가상 환경을 사용할 때만 발생합니다. 어떤 아이디어? 미리 감사드립니다. 그리고 이것이 멍청한 질문이라면 사과하겠습니다. 저는 장고를 아주 신작했습니다!
편집 : 나는 유망하지만 내 유일한 모델을 통해 보는 것 같다 this을 발견, 나는 URLField() ...
EDIT2를 사용하지 않을 : 유일한 models.py 내가 가진 :
from django.db import models
class Category(models.Model):
name = models.CharField(max_length=50)
slug = models.SlugField(max_length=50, unique=True, help_text='Unique value for product page URL, created from name.')
description = models.TextField()
is_active = models.BooleanField(default=True)
meta_keywords = models.CharField("Meta Keywords", max_length=255, help_text='Comma-delimited set of SEO keywords for meta tag')
meta_description = models.CharField("Meta description", max_length=255, help_text='Content for description meta tag')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
db_table = 'categories'
ordering = ['-created_at']
verbose_name_plural = 'Categories'
def __unicode__(self):
return self.name
@models.permalink
def get_absolute_url(self):
return ('catalog_category',(), {'category_slug': self.slug})
class Product(models.Model):
name = models.CharField(max_length=255, unique=True)
slug = models.SlugField(max_length=255, unique=True, help_text= 'Unique value for product page URL, create from name.')
brand = models.CharField(max_length=50)
sku = models.CharField(max_length=50)
price = models.DecimalField(max_digits=9, decimal_places=2)
old_price = models.DecimalField(max_digits=9, decimal_places=2, blank=True, default=0.00)
image = models.CharField(max_length=50)
is_active = models.BooleanField(default=True)
is_bestseller = models.BooleanField(default=False)
is_featured = models.BooleanField(default=False)
quantity = models.IntegerField()
description = models.TextField()
meta_keywords = models.CharField(max_length=255, help_text='Comma-delimited set of SEO keywords for meta tag')
meta_description = models.CharField(max_length=255, help_text='Content for description meta tag')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
categories = models.ManyToManyField(Category)
class Meta:
db_table = 'products'
ordering = ['-created_at']
def __unicode__(self):
return self.name
@models.permalink
def get_absolute_url(self):
return('catalog_product',(), {'product_slug': self.slug})
def sale_price(self):
if (self.old_price > self.price):
return self.price
else:
return None
'verify_exists' 인수를 받아들이지 않는 클래스 생성자에 전달 중입니다. 프로젝트의 소스 코드를 포함시킬 수 있습니까? 9 행에있는 pat.py의 코드는 무엇입니까? –
설치된 타사 앱은 어때요 최신 버전으로 업그레이드 했습니까? – catherine
캐서린이 좋은 지적입니다. 나는 django-db-log가 3 년 후에 업데이트 된 것처럼 보이지 않기 때문에 범인이라고 생각합니다. –