• Jobs
  • About Us
  • Jobs
    • Home
    • Jobs
    • Courses and challenges
  • Businesses
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

408
Views
ValueError: invalid literal for int() with base 10(Django)

error in cmd
Code

I tried to create a project where to manage a garage, but when I create the model in application"utiliser", I got this problem. Thanks!

almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In your code, you are trying to assign string client as the default value for your ForeignKey. ForeignKeys are represented as integers and that is why you get this error. You can assign id value of the foreign object (if exists), or use null=True which will make default NULL. If there is no data at all in this object, then remove default value, migrations and flush database, then you will get not-nullable ForeignKey field.

almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.

Andres GPT

Show me some job opportunities
There's an error!