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

  • Home
  • SEARCH
  • 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 3799002
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:39:51+00:00 2026-05-19T13:39:51+00:00

import os import sys os.environ[‘DJANGO_SETTINGS_MODULE’] = trade.settings from trade.turkey.models import * d = DemoRecs.objects.all()

  • 0
import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = "trade.settings"
from trade.turkey.models import *


d = DemoRecs.objects.all()
d.delete()

When I run this, it imports fine if I leave out the d.delete() line. It’s erroring on that line. Why? If I comment that out, everything is cool. I can insert. I can update. But when I have that line everything screws up.

The traceback is:

 d.delete()
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 447, in delete
    obj._collect_sub_objects(seen_objs)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/base.py", line 585, in _collect_sub_objects
    for related in self._meta.get_all_related_objects():
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/options.py", line 347, in get_all_related_objects
    self._fill_related_objects_cache()
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/options.py", line 374, in _fill_related_objects_cache
    for klass in get_models():
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 167, in get_models
    self._populate()
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
ImportError: No module named turkey
  • 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-19T13:39:52+00:00Added an answer on May 19, 2026 at 1:39 pm

    The directory for the trade project is missing from sys.path.

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

Sidebar

Related Questions

import sys words = { 1 : 'one', 2 : 'two', 3 : 'three',
The only nice way I've found is: import sys import os try: os.kill(int(sys.argv[1]), 0)
i have the following script import getopt, sys opts, args = getopt.getopt(sys.argv[1:], h:s) for
If this is my subprocess: import time, sys for i in range(200): sys.stdout.write( 'reading
import sys print sys.path ['D:\\zjm_code\\register2', 'C:\\WINDOWS\\system32\\python25.zip', 'D:\\Python25\\DLLs', 'D:\\Python25\\lib', 'D:\\Python25\\lib\\plat-win', 'D:\\Python25\\lib\\lib-tk', 'D:\\Python25', 'D:\\Python25\\lib\\site-packages'] and #from
Firstly, here's my script: #!/usr/bin/python import sys, os sys.path.append('/home/username/python') sys.path.append(/home/username/python/flup) sys.path.append(/home/username/python/django) # more path
I need to import a csv file into Firebird and I've spent a couple
How can you import a foxpro DBF file in SQL Server?
I want to import an oracle dump into a different tablespace. I have a
How can you automatically import the latest build/revision number in subversion? The goal would

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.