First time here? Check out the FAQ!
0

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:
/Users/Bryan/work/askbot-discussion

The original instance was at:
/Users/Bryan/work/askbot-discussion/askbotBeast

The instance I'm trying to work revert back to the earlier with is:
/Users/Bryan/work/delete_askbot/askbotBeast

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

In [8]: sys.path
Out[8]:
['/Users/Bryan/work/delete_askbot/askbotBeast',
'/Users/Bryan/work/askbot-discussion',
'/Users/Bryan/work/delete_askbot/askbotBeast',
'/Users/Bryan/work/askbot-discussion/askbot/deps',]

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

mrB's avatar
51
mrB
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

Comments

add a comment see more comments

1 Answer

0

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 settings.py file and store that file name in an additional setting.

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

Comments

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