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?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
mrB's avatar
51
mrB
asked 12 years ago, updated 12 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 12 years ago
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 (12 years ago)
see more comments