2

How can I integrate Askbot into own django app?

Hi!

I'm totally new to python and Django. I'm planning to restart a project currently in Drupal as a Django Project.

This project currently has a fotum. My question now is: What is the best way to integrate Askbot into my project at /forum?

Thanks.

Christopher

PS: Sorry if this is a stupid question....

fosstux's avatar
21
fosstux
asked 2012-06-08 18:39:27 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

3 Answers

1

Askbot is itself a Django app, but it does require quite a few config variables in the settings.py file, so the easiest path might be to install askbot as a standalone django project and then add other apps that you might need.

Second part is setting up askbot at sub-url - there is setting ASKBOT_URL - make it equal forum/.

Lastly - if you need to serve something other than django project at the root url / and still host Askbot at sub-url - then find instructions by looking for "hosting django at sub-url" there are good hits on google for this.

Evgeny's avatar
13.2k
Evgeny
answered 2013-08-01 16:59:08 -0500
edit flag offensive 0 remove flag delete link

Comments

Hi, Evgeny, Why there is not a github repo with this already ? I tried last night to do this merge myself, but I had some trouble ... (probably, cause I was trying to use Django 1.5) I believe it should be simple and will try again today. But why not offer a github repo with the askbot integrated as a pluggable app in a subdirectory like /forum as a startup project ? If you just have to merge settings.py and urls.py in a new django project, that shouldn't be hard to be done, right ? I believe you would get a lot more users if you would provide such a feature...

Raony Guimarães's avatar Raony Guimarães (2013-09-01 13:13:20 -0500) edit

There may be issues if you are using MySQL, but should just work with Postgres or Sqlite. In askbot/setup_templates there are sample settings and other project files. I have intstalled askbot into other django sites, but it takes some time building the settings.py file. Also askbot has a self-test which will suggest what changes to make when you try to run management commands.

Evgeny's avatar Evgeny (2013-09-01 13:19:54 -0500) edit
add a comment see more comments
1

first create a virtual environment

virtualenv askbotenv --no-site-packages
source askbotenv/bin/activate

install askbot

pip install askbot

now edit

you will need to merge settings.py(http://github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/settings.py) and urls.py(http://github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/urls.py) into your django project manually.

The templates to be used can be found in the askbot/setup_templates subdirectory.

visit for more info:

http://askbot.org/doc/initial-configuration.html#adding-askbot-to-an-existing-django-project
suhail's avatar
21
suhail
answered 2013-08-01 05:05:06 -0500, updated 2013-08-01 05:09:08 -0500
edit flag offensive 0 remove flag delete link

Comments

1

In Appendix A of the documentation (http://askbot.org/doc/askbot-as-reusable-django-application.html), it says that an extra management command is necessary. Is this still up to date? Also it says that there are still some issues to make it a truly reusable app. What issues are these?

Stevenvdr's avatar Stevenvdr (2013-08-05 03:04:16 -0500) edit
add a comment see more comments
0

All right, I hope this will help some people to get started using Askbot as a reusable(pluggable) app with Django.

I created a repo integrating Django 1.5 and Askbot. I've tested with sqlite3 and postgresql and I had no problems so far running it.

Here are the instructions:

git clone git@github.com:raonyguimaraes/askbot_reusable.git
cd askbot_reusable
pip install -r requirements.txt
python manage.py collectstatic
python manage.py syncdb --migrate --noinput
python manage.py runserver

I really think this should be provided or at least mentioned in http://askbot.org/doc/askbot-as-reusable-django-application.html

Any suggestions? Good Luck!

Raony Guimarães's avatar
1
Raony Guimarães
answered 2013-09-01 15:22:02 -0500, updated 2013-09-01 15:32:17 -0500
edit flag offensive 0 remove flag delete link

Comments

With the `syncdb` command you could use options `--migrate --noinput` to migrate the askbot databases

Evgeny's avatar Evgeny (2013-09-01 15:28:30 -0500) edit

Thanks :) !

Raony Guimarães's avatar Raony Guimarães (2013-09-01 15:32:41 -0500) edit
add a comment see more comments