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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:43:57+00:00 2026-05-29T12:43:57+00:00

I have a Django project in Eclipse PyDev. I have a file views.py which

  • 0

I have a Django project in Eclipse PyDev.

I have a file views.py which has the line:

from models import ingredient2

In models.py I have:

from django.db import models
class ingredient2(models.Model):
     ingredient     = models.CharField(max_length=200)

When I try to run the app I get the following error:

File "C:\Python27\lib\site-packages\django\db\models\base.py", line 54, in __new__
kwargs = {"app_label": model_module.__name__.split('.')[-2]}
IndexError: list index out of range

I did sync the database and started the server running.

I went into base.py and added 2 print statements (yes, I probably should not edit Django’s files):

if getattr(meta, 'app_label', None) is None:
            # Figure out the app_label by looking one level up.
            # For 'django.contrib.sites.models', this would be 'sites'.
            model_module = sys.modules[new_class.__module__]
            print model_module #ADDED
            print model_module.__name__ #ADDED
            kwargs = {"app_label": model_module.__name__.split('.')[-2]}

They print out:

<module 'models' from 'C:\Users\Tine\workspace\slangen\slangen2\bolig\models.pyc'>

models

manage.py is contained within the bolig folder. I think the correct app label would be “bolig”. The app worked several months ago and now, when I come back to it, something is not right. I have been creating other projects in PyDev.

  • 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-29T12:44:02+00:00Added an answer on May 29, 2026 at 12:44 pm

    Well, not really an answer, but… I ended up creating a new django project and then copying in my code. That fixed the problem.

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

Sidebar

Related Questions

I have Django project on Dreamhost server which has several views that returns Json
I have a django project that uses views from an external app. The view
I have a Django project in which multiple processes are accessing the backend mysql
I have a django project which is laid out like this... myproject apps media
I have a Django project. Given a url, how can I know which view
I have a Django-project which was running fine, until I made some changes I
I have a django project which runs just fine with runserver located in: D:\EverTabs\work\evertabs-website\src\evertabs\
I have a django project in which a user will type in a url
I have a Django project set up with Jenkins. One of my apps has
I'm trying to create a Django project in Eclipse but it says I have

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.