Model in Django 1.9. TypeError: __init__() got multiple values for argument 'verbose_name'
<p>I have Python 3.5 and Django 1.9
try to do the next</p>

<pre><code>class Question(models.Model):
def __init__(self, *args, question_text=None, pub_date=None, **kwargs):
    self.question_text = question_text
    self.pub_date = pub_date
question_text = models.CharField(max_length=200, verbose_name="Question")
pub_date = models.DateTimeField('date_published', verbose_name="Date")

def __str__(self):
    return self.question_text

def __unicode__(self):
    return self.question_text

class Meta:
    verbose_name = "Question"
</code></pre>

<p>But got an error</p>

<blockquote>
  <p>File "/home/donotyou/PycharmProjects/djangobook/polls/models.py",
  line 15, in Question
      pub_date = models.DateTimeField('date_published', verbose_name="Date") TypeError: <strong>init</strong>() got multiple values for
  argument 'verbose_name'</p>
</blockquote>

<p>Please help</p>

<p>You don't need to override <code>__init__</code> in Django. Django is doing everything for you, you just need to define your models and you are fine.</p>

<p>But the error you are getting because <code>pub_date = models.DateTimeField('date_published', verbose_name="Date")</code> here you are setting <code>verbose_name</code> twice, because the first argument of django <code>Field</code> is <code>verbose_name</code> and after that you setting the same <code>verbose_name</code> making two same arguments passing to class.</p>

<p>So basically you need to do is:</p>

<pre><code>class Question(models.Model):
    question_text = models.CharField(max_length=200, verbose_name="Question")
    pub_date = models.DateTimeField('date_published')  # or pub_date = models.DateTimeField("Date")

    def __str__(self):
        return self.question_text

    def __unicode__(self):
        return self.question_text

    class Meta:
        verbose_name = "Question"
</code></pre>

<p><strong>NOTE</strong>: In most cases it's more readable to passing <code>verbose_name</code> as a first argument without any <code>verbose_name=</code> except relational fields.
From <a href="https://docs.djangoproject.com/en/1.10/topics/db/models/#verbose-field-names" rel="nofollow">docs</a>:</p>

<blockquote>
  <p>Each field type, except for <code>ForeignKey</code>, <code>ManyToManyField</code> and <code>OneToOneField</code>, takes an optional first positional argument â a verbose name. If the verbose name isnât given, Django will automatically create it using the fieldâs attribute name, converting underscores to spaces.</p>
</blockquote>

python django