K
K
kelevra14932016-05-16 16:02:47
Django
kelevra1493, 2016-05-16 16:02:47

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)

When trying to migrate the base (migrate), it gives the following code:
ValueError: invalid literal for int() with base 10: 'admin'
In the video, everything works for him, but for me it doesn't. Already rewatched it a few times.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2016-05-16
@fox_12

You are trying to convert 'admin' to a number somewhere.
Would you like your code to be more complete.

V
Vladislav Sklyar, 2016-05-17
@VladSkliar

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 question

Ask a Question

731 491 924 answers to any question