Answer the question
In order to leave comments, you need to log in
DJANGO ValueError: invalid literal for int() with base 10: 'admin'?
I'm learning Django with a video tutorial. But I ran into an error, over which I have been suffering for 4 hours, continuously googling and correcting. But to no avail.
I have DJango 1.9
In the blog application, the following is written in the models:
class Article(models.Model):
title = models.CharField(max_length=200)
text = models.TextField()
user = models.ForeignKey(User)
Answer the question
In order to leave comments, you need to log in
You are trying to convert 'admin' to a number somewhere.
Would you like your code to be more complete.
You probably already have entries in this model. Check if there are records in the database. If there is, delete it. This is just a guess, more code needed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question