Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 751033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:37:11+00:00 2026-05-14T14:37:11+00:00

When I run: django-admin.py loaddata ../data/library_authors.json the error is: … ValidationError: [u’Enter a valid

  • 0

When I run:

   django-admin.py loaddata ../data/library_authors.json 

the error is:

   ...
   ValidationError: [u'Enter a valid date in YYYY-MM-DD format.']

The model:

   class Writer(models.Model):
     first = models.CharField(u'First Name', max_length=30)
     other = models.CharField(u'Other Names', max_length=30, blank=True)
     last = models.CharField(u'Last Name', max_length=30)
     dob = models.DateField(u'Date of Birth', blank=True, null=True)

     class Meta:
       abstract = True
       ordering = ['last']
       unique_together = ("first", "last")

   class Author(Writer):
     language = models.CharField(max_length=20, choices=LANGUAGES, blank=True)

     class Meta:
       verbose_name = 'Author'
       verbose_name_plural = 'Authors'

Note that the dob DateField has blank=True, null=True

The json file has structure:

[
    {
        "pk": 1, 
        "model": "books.author", 
        "fields": {
            "dob": "", 
            "other": "", 
            "last": "Carey", 
            "language": "", 
            "first": "Peter"
        }
    }, 
    {
        "pk": 3, 
        "model": "books.author", 
        "fields": {
            "dob": "", 
            "other": "", 
            "last": "Brown", 
            "language": "", 
            "first": "Carter"
        }
    }
]

The backing mysql database has the relevent date field in the relevant table set to NULL as default and Null? = YES.

Any ideas on what I’m doing wrong or how I can get loaddata to accept null date values?

=====
EDIT:

Daniel’s answer worked, I’m redfaced.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:37:12+00:00Added an answer on May 14, 2026 at 2:37 pm

    Simply change the "" for dob to null and it will work, the empty string isn’t the same as null. Even though you have blank=True in there, that’s really only for form validation and not input validation through fixtures.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 498k
  • Answers 498k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One possibility using linq is: string justDigits = new string(s.Where(c… May 16, 2026 at 12:12 pm
  • Editorial Team
    Editorial Team added an answer A simply <div> that's the max size of the screen… May 16, 2026 at 12:12 pm
  • Editorial Team
    Editorial Team added an answer My problem is that my xslt is looped through and… May 16, 2026 at 12:12 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Each time I added some strings to a Django project, I run django-admin.py makemessages
In my urls file I have configured the Django admin application to run off
it's fairly easy to set up Eclipse to run a django project's tests created
I want to run a django app on a hand-held device. It'll need to
Here are some models I am trying to load data for: class School(models.Model): name
I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But
Django's internationalization is very nice (gettext based, LocaleMiddleware), but what is the proper way
I guess this is a PATH/PYTHONPATH error, but my attempts failed so far to
I intend to localise my Django application and began reading up on localisation on
I have a Django application being served of (say) example.com . It contains a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.