First time here? Check out the FAQ!

How does an instance of Askbot know where its core files are?

I made the mistake of assuming that I would be able to migrate up to the newest version of Askbot. I ran into issues. I cloned the Git repository into /Users/Bryan/work/delete_askbot and checked out the the Revision that was working and trying to use the fixtures I had created before I migrated so I can test the migration.

My askbot instance keeps trying to use the original path:

The original instance was at:

The instance I'm trying to work revert back to the earlier with is:

Here's the Python Path for the temporary instance of Askbot:

In [8]: sys.path

Where is '/Users/Bryan/work/askbot-discussion' added to the Python path?

mrB's avatar
asked 2012-12-17 14:25:31 -0500, updated 2012-12-17 14:27:26 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


You can figure this out by

import askbot
import os.path
ASKBOT_DIR = os.path.dirname(askbot.__file__)

If you want to find where the settings file is, then use the same trick in the file and store that file name in an additional setting.

Evgeny's avatar
answered 2012-12-17 16:21:30 -0500
edit flag offensive 0 remove flag delete link


I know the path for the askbot module that is being imported. I'm trying to figure out how to import an askbot module with a different path. The current import of askbot is /Users/Bryan/work/askbot-discussion/askbot I want to import the askbot module at /Users/Bryan/work/delete_askbot/askbot

mrB's avatar mrB (2012-12-18 10:24:06 -0500) edit
add a comment see more comments