asked 2011-05-27 01:09:29 -0500Gabriel
I have seen mentioned in a few places that it shouldn't be too much work to integrate askbot into an existing django-based project (e.g., see here), however I haven't been able to find a comprehensive answer to how feasible that is. Has anyone actually done this? What needs to happen to make it work?
There are three ways to do integration: either as a pluggable app as part of the main site, as a separate site backed by the same DB using the django sites framework, or as "multiple Django instances hosting different parts of your URL space, allowing them to have multiple settings files." (That last option came from here, though I'll admit I'm not exactly sure how this would work in practice)
All thses options have a few obvious issues:
Hmmm...that ended up being pretty long. And I'm sure there are a few other gotchas that I'm missing :P
Anyways, we've been pretty impressed after playing a bit with our standalone test deployment of Askbot, so I'm excited to get it integrated with the rest of our project. I do have some django development experience, so if there is a bit of work to do on askbot's core in order to make it more easily pluggable, I'm certainly willing to contribute, but before I sink too much time going down that path, I'd like to get some idea of the scope of the problems to be overcome.
If I wanted to integrate some other django app with askbot, I would first try to put both in the same project.
For example, make a copy of your project including the database, then add
askbot directory to the project and splice files
settings.py. Backing up the database will be very important here.
Askbot's sample project files are in the directory
Finally, run migrations (there are two apps to migrate for askbot - just run
python manage.py migrate. All the extra fields on the user model will be added by askbot's migrations.
On the migrations - PostgresQL will help here. If a migration fails - a transaction will roll back to the previous successful migration and you will not end up in the middle of a failed one. With MySQL you might, then you'd have to clean the database manually or start over.
add_missing_subscriptions command will fill the holes in the data of pre-existing users.
There is also a management command
add_askbot_user which might help creating new user accounts in the case you prefer to stick to your existing user registration system. The management command can be called programmatically via
Where you might have difficulties - askbot uses internal login app and registration app (will be decoupled soon), and there are some middlewares that may get in the way of other apps. Please let us know of such issues.
Reusable app is the goal with an option to use askbot as a whole package.
Changed June 5 2011 Starting version 0.6.93 (available on github and pypi) askbot fully supports external authentication/user registration apps, all documentation on the subject will be here:
The remaining gotcha at the moment is that
auth.models.User model, it is monkeypatched with
add_to_class (in models/__init__.py) calls and migrations. As long as your other apps do not use the same extra fields, there should'n be problems. It is not very nice, but I have not yet heard from anyone that it prevented askbot from working with other apps.
Probably the right way is to have a separate model for askbot user profile data, something like AskbotUser linked with the auth.models.User.
patches contains monkeypatches that "upgrade" some parts of Django to the level of 1.3. Askbot will (at least was tested at one point not too long ago) work with Django 1.1 to 1.3 without changes. For example - csrf protection will work on 1.1 even though it is not present in django 1.1.
Jinja2 templates are used for speed and more flexibility in programming.
I'll come back to your question tomorrow.
answered 2011-05-28 09:47:24 -0500Andrew Swihart
I agree working away from the forced bundled authentication / User model stuff should be prioritized. Having a truly pluggable Q&A app would be a real differentiator from OSQA. It would also be nice if you could supply your own Tag model and be able to use the same Tag model across other Django apps, along with django-taggit/tagging.
Hi managed to install askbot as a pluggable django app, but I have some two probles:
I had to create, under my project directory, a virtual link to skins folder
despite I tell askbot to put the uploaded file into the directory /myproject/upfile, askbot continue to put the uploaded file into directory /myproject/askbot/upfile.
Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.create your Q&A site
Asked: 2011-05-27 01:09:29 -0500
Seen: 987 times
Last updated: Mar 15