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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:52:47+00:00 2026-06-12T18:52:47+00:00

when i try to create superuser from shell or via manage.py or from Django-Admin

  • 0

when i try to create superuser from shell or via manage.py or from Django-Admin page ; it throws error like :

IntegrityError at /admin/auth/user/add/
null value in column "link_karma" violates not-null constraint

Here is my models.py [User Part]:

class User_Profile(models.Model):

    user = models.OneToOneField(User)
    link_karma = models.IntegerField()
    comment_karma = models.IntegerField()
    avatar = models.CharField(max_length=100)

    def create_user_profile(sender,instance,created,**kwargs):
        if created:
            User_Profile.objects.create(user=instance)
    post_save.connect(create_user_profile, sender=User)

    def __unicode__(self):
        return self.user.username

i added fallowing line in to settings.py:

AUTH_PROFILE_MODULE = 'accounts.User_Profile'

before add this line ; it was the same.

Note : i tried to change type of link_karma field to CharField. it is same.

Note : If any additional data needed ; i can add it.

  • 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-12T18:52:49+00:00Added an answer on June 12, 2026 at 6:52 pm

    Try setting blank=True, null=True for both link_karma and comment_karma. You’re not passing any values to those fields so when your create statement tries to create the object, it doesn’t know what to give link_karm hence the error.

    As goliney correctly pointed out, you dont need email in your User_Profile model as User already has it.

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

Sidebar

Related Questions

I want to try create something like Zend's Server Pagecache. What I want to
I try to create donate via PayPal button and add custom select with amount.
I'm running Django and trying to create a superuser but I keep getting the
snippet from The Server code : public void run() { try { // Create
I try create two moving object from one class. I want to control they
I'll try create a controler in towerjs, but I have an error while updating
I have specific troubles when I try create node. From context menu everything gona
This is my api.py # myapp/api.py from django.contrib.auth.models import User from tastypie.authorization import Authorization
I try create new function in Excel, witch will counting given values (something like
I have recently set up Yii and when I try create an app via

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.