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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:43:23+00:00 2026-05-30T09:43:23+00:00

Disclaimer: I am new to python and django but have Drupal programming experience. I’m

  • 0

Disclaimer: I am new to python and django but have Drupal programming experience. I’m using Windows 7 (same issues on Windows XP)

On python 2.7 and Django-1.3.1, I successfully created a default project

django-admin.py startproject djsite

Now, I need to “bootstrap” djsite.manage as explained here (http://www.pyinstaller.org/wiki/Recipe/DjangoApplication) in a file called bootstrap.py located in djsite’s parent directory as follows:

import djsite.manage
djsite.manage.execute_manager(djsite.manage.settings,['manage.py', 'runserver'])

Yet, as soon as the compiler sees:

import djsite.manage

I get this:
“Error: Can’t find the file ‘settings.py’ in the directory containing ‘C:\Python27\Lib\site-packages\djsite\manage.pyc’. It appears you’ve customized things… You’ll have to run django-admin.py, passing it your settings module.” And, I don’t know how to follow the error’s advice in this situation.

However, if I instead issue the following in bootstrap.py:

import os, sys
sys.path.append(os.path.abspath('djsite'))
import djsite.manage
djsite.manage.execute_manager(djsite.manage.settings,['manage.py', 'runserver'])

the script works correctly, but it breaks Pyinstaller (I’ve already asked this question on that software’s mailing list (http://groups.google.com/group/pyinstaller/browse_thread/thread/174a72e26c26a44c). Even if I add the path to the djsite in my PATH variable, I get the same error.

So my question here is this: Why does importing the manage.py module fail with this approach and how can I proceed? Thanks!

  • 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-30T09:43:24+00:00Added an answer on May 30, 2026 at 9:43 am

    Try adding this to your bootstrap.py to inform it where your settings file lives:

    import os
    os.environ['DJANGO_SETTINGS_MODULE'] = 'djsite.settings'
    

    This will assume that djsite is in your pythonpath. That is, if its located here: /path/to/my/djsite, then this should be in your pythonpath: /path/to/my

    Actually the best way to be doing this from the start is to being using virtualenv which will ensure that your environment is correct. I feel like that had to have been part of your tutorial if I remember bootstrap at all. If you are using virtualenv, make sure you remembered to source bin/activate

    If that doesn’t work, you can try altering the runserver command:

    args = ['manage.py', 'runserver', '--settings=/path/to/my/djsite/settings.py']
    djsite.manage.execute_manager(djsite.manage.settings, args)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Disclaimer: I am new to python and Django, but have Drupal programming experience. I'm
Disclaimer: I am new to python and django but have experience programming in Drupal.
Disclaimer: i am new to python but have drupal programming experience I am reading
Disclaimer: I am new to python and django but have programmed in Drupal I
diclaimer: I am new to python but have experience programming in Drupal I'm following
Disclaimer: I am new to python but have coded in Drupal where I used
Disclaimer: completely new to Python from a PHP background Ok I'm using Python on
Newbie disclaimer: I am new to Python and just started using IDLE to play
Disclaimer: I'm fairly new to python! If I want all the lines of a
I have a WPF sorting/binding issue. (Disclaimer: I am very new to WPF and

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.