Ask Your Question
0

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

asked 2012-12-17 14:25:31 -0600

mrB gravatar image

updated 2012-12-17 14:27:26 -0600

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-12-17 16:21:30 -0600

Evgeny gravatar image

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.

edit flag offensive delete link more

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 gravatar imagemrB ( 2012-12-18 10:24:06 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-12-17 14:25:31 -0600

Seen: 74 times

Last updated: Dec 17 '12