2013-04-06 3 views
2

첫 번째 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 
+0

'verify_exists' 인수를 받아들이지 않는 클래스 생성자에 전달 중입니다. 프로젝트의 소스 코드를 포함시킬 수 있습니까? 9 행에있는 pat.py의 코드는 무엇입니까? –

+0

설치된 타사 앱은 어때요 최신 버전으로 업그레이드 했습니까? – catherine

+0

캐서린이 좋은 지적입니다. 나는 django-db-log가 3 년 후에 업데이트 된 것처럼 보이지 않기 때문에 범인이라고 생각합니다. –

답변

3

I을 내가 왜 당신의 프로젝트에 설치되어있는 앱을 보았는지 알았다고 생각합니다. 나는 django-db-logmodels.URLField(verify_exists=False, null=True, blank=True)으로 사용하며, 새로운 버전에서는 더 이상 사용되지 않습니다.

그들의 프로젝트는 어쩌면 당신이 그들의 프로젝트에 요청을 뽑을 수, 아직 업그레이드 또는 응용 프로그램

UPDATE를 제거되지 않습니다

: @NathanVillaescusa

에서
from django.utils.hashcompat import md5_constructor //deprecated also 
+0

현재 수정해야 할 문제가 있으므로 업그레이드 버전을 요청하면 즉시 업그레이드 할 수 없습니다. – catherine

+0

'django-db-log' 또한 deprecation 경고의 원인입니다 : https://github.com/dcramer/django-db-log/blob/master/djangodblog/urls.py#L3 –

+0

@NathanVillaescusa 예 첫 번째 오류. 다음 오류는 verify_exist에 관한 것입니다. 더 나은 방법은 그 응용 프로그램을 제거하고 그것을 대체하는 것입니다 – catherine

1

나는 로거하고 있기 때문에 동일한 문제가 있었다 더 이상 업데이트되고있어, 나는 REPO를 포크없고, 여기에 몇 가지 조정을 자신을 만든 :

https://github.com/alvinkatojr/django-db-log

시간이 지남에 따라 나는 최신 django 버전으로 최신 버전을 유지하도록 노력할 것입니다. 그러나 지금은 미래의 사용자에게 도움이되기를 바랍니다.

관련 문제