2

I'm working on my first Django app and I am getting a strange error. I looked looked it up and checked the Django docs for version 1.5.1 which I am using and it says nothing about this error.

pat.py:9: DeprecationWarning: django.utils.hashcompat is deprecated; use hashlib instead
DeprecationWarning)

TypeError: __init__() got an unexpected keyword argument 'verify_exists'

I am using a virtual environment where I have Django installed along with (pip freeze output):

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

Also, it is important to note that I tried running python manage.py syncdb when I deactivated me virtual environment - with no errors. This error only occurs when I am using my virtual env. Any ideas? Thanks in advance and I appologize if this is a nooby question, I am quite new to Django!

EDIT: I found this which seems promising but looking through my only model, I never use URLField()...

EDIT2: The only models.py I have:

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
Community
  • 1
  • 1
Joker
  • 2,119
  • 4
  • 27
  • 38
  • You are passing the `verify_exists` argument to a class constructor that does not accept it. Can you include some of the source code of your project? What is the code on pat.py around line 9? – Nathan Villaescusa Apr 06 '13 at 07:01
  • how about the third party apps that are installed, have you upgraded it to their latest version? – catherine Apr 06 '13 at 07:10
  • Catharine brings up a good point. I would guess that django-db-log is the culprit, as it does not look like it has been updated in 3 years. – Nathan Villaescusa Apr 06 '13 at 07:13

1 Answers1

3

I think I found out why, looking at your apps that are installed in your project. I found out that django-db-log use models.URLField(verify_exists=False, null=True, blank=True), which is deprecated in new version.

Their project is not upgraded yet, so maybe you can pull a request in their project or uninstalled that app

UPDATE: From @NathanVillaescusa

 from django.utils.hashcompat import md5_constructor //deprecated also
catherine
  • 22,492
  • 12
  • 61
  • 85
  • Currently, they have issues to fix so if you request for upgrade version, they can't make it right away. – catherine Apr 06 '13 at 07:18
  • `django-db-log` is also the cause of the deprecation warning: https://github.com/dcramer/django-db-log/blob/master/djangodblog/urls.py#L3 – Nathan Villaescusa Apr 06 '13 at 07:19
  • @NathanVillaescusa yes that's the first error. The next error is about verify_exist. Better way is to uninstalled that app and replace it – catherine Apr 06 '13 at 07:23
  • Thank you! I originally had thought that djangodblog was up to date (which it was because when I was updating it, no updates were found). Makes sense if it is 3 years since last commit. – Joker Apr 06 '13 at 07:23