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 8335237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:36:50+00:00 2026-06-09T03:36:50+00:00

After adding a user profile (called user info here) my models.py file wont syncdb.

  • 0

After adding a user profile (called user info here) my models.py file wont syncdb. I get:TypeError: __init__() takes at least 2 arguments (1 given) and all the errors above that mention the models.py file or some file relating to it.

Models.py file:

def create_user_info(sender, instance, created, **kwargs):
    if created:
        UserInfo.objects.create(user=instance)

post_save.connect(create_user_info, sender=User)

class Book(models.Model):
    title = models.CharField(max_length=50)
    author = models.CharField(max_length=50)
    def __unicode__(self):
        return self.title

class UserInfo(models.Model):
    user = models.OneToOneField(User)
    pen_name = models.CharField(max_length=30)
    activated = models.BooleanField()
    def __unicode__(self):
        return self.email + '-' + self.pen_name

Auth thing in settings.py:

AUTH_PROFILE_MODULE = 'Knights.UserInfo'

Traceback:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 231, in execute
    self.validate()
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/core/management/validation.py", line 30, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/loading.py", line 158, in get_app_errors
    self._populate()
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/loading.py", line 64, in _populate
    self.load_app(app_name, True)
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/db/models/loading.py", line 88, in load_app
    models = import_module('.models', app_name)
  File "/Library/Python/2.7/site-packages/Django-1.4-py2.7.egg/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Users/Mike/Desktop/Main/Django-Development/BBN/Knights/models.py", line 53, in <module>
    class Alert(models.Model):
  File "/Users/Mike/Desktop/Main/Django-Development/BBN/Knights/models.py", line 55, in Alert
    for_user = models.ForeignKey()
  • 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-06-09T03:36:53+00:00Added an answer on June 9, 2026 at 3:36 am

    Your error does not lie in your posted code. You’ve followed the docs to the letter, so I would’ve been surprised if it did.

    Instead, the error is found in your Alert class (models.py:55). for_user = models.ForeignKey() has to be for_user = models.ForeignKey(User) or for_user = models.ForeignKey(UserInfo), depending on which you prefer.

    Your faulty code was trying to instantiate an instance of the class ForeignKey, which calls it’s __init__() method. That method will have a declaration of something like

    def __init__(self, other_model):
    

    and thus the error message saying that you’re missing one parameter. self gets passed implicitly, read up on the Python classes docs if you’re interested.

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

Sidebar

Related Questions

I have a textarea, where the user can add their comments. Now after adding
I am getting this error after adding the libxml2.2.dylib file Linking /Users/Biranchi/Desktop/Funmovies TabBarController/build/Debug-iphonesimulator/funmovies.app/funmovies (1
Instead of dynamically altering a models file by adding fields, very bad i've been
After adding the following .htaccess file to my site I noticed that forms had
After adding records in the relative file , I am trying to update one
how can I redirect the user to a specific category after adding a product
After adding Restkit to the Podfile : platform :ios dependency 'Facebook-iOS-SDK', '1.2' dependency 'RestKit',
After adding a second persistence unit and changing my application's data sources to XADataSource
After adding the /TSAWARE linker flag to one of my projects (Visual Studio 6),
After adding the key value pairs in NSMutableDictionary, when i retrive the key/values from

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.