Reputation: 2239
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
Upvotes: 2
Views: 1292
Reputation: 22808
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
Upvotes: 3