Ask Your Question

How to upgrade askbot without crashing the existing instance?

asked 2012-01-17 06:35:41 -0500

catdrich's avatar

updated 2012-01-17 08:00:39 -0500

Evgeny's avatar

I tried to upgrade to the version that fixes the Facebook error. From my askbot directory is did pip install -U askbot. There were a lot of warnings like "warning: no previously-included files mathing "*" found under directory docs/_build", etc.

When I try to go to our askbot, the error is:
TemplateAssertionError at /questions/

no filter named 'clean_login_url'

Request Method: GET Request URL: Django Version: 1.3.1 Exception Type: TemplateAssertionError Exception Value:

no filter named 'clean_login_url'

Exception Location: /usr/local/lib/python2.6/dist-packages/askbot/skins/default/templates/widgets/user_navigation.html in template, line 12 Python Executable: /usr/bin/python Python Version: 2.6.5 Python Path:

['/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/local/lib/python2.6/dist-packages', '/', '/forum', '/usr/local/lib/python2.6/dist-packages/askbot/deps']

What else do I need to do to update Askbot? There are no concise directions anywhere that I could find.

edit retag flag offensive close merge delete


I can't seem to edit this question without getting an "Internal Service" error. I wanted to add: I then did python migrate askbot and it said there was nothing to migrate.

catdrich's avatar catdrich  ( 2012-01-17 06:41:51 -0500 )edit

Yes, I have damaged a template when hotfixing the xss issue discovered a few days ago.

Evgeny's avatar Evgeny  ( 2012-01-17 07:54:32 -0500 )edit

Your site appears to be down btw. Also I recommend you to always use staging environment to test new software, don't just write over your existing setup. Sounds easy, but you are potentially might be getting into much harder to solve problems - e.g. repair a damaged database.

Evgeny's avatar Evgeny  ( 2012-01-17 07:57:52 -0500 )edit

Edited the title to make it a little more informative.

Evgeny's avatar Evgeny  ( 2012-01-17 08:01:20 -0500 )edit

It's not down, just not publicly available. And we don't really have a staging environment right now, as this is still being evaluated by our staff to see if it fits their needs.

catdrich's avatar catdrich  ( 2012-01-17 08:09:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-01-17 07:57:18 -0500

Evgeny's avatar

updated 2012-01-17 08:17:46 -0500

possible explanation What seems to me your system python paths might be inconsistent. Be careful with that. It is better to use virtual environment for the app, so it's completely isolated from the rest.

Look up "configuring mod_wsgi" with python virtual environment.

If you type some commands as root and then restart the webserver you can accidentally add your own environment variables to the root's and subsequently - the webserver.

how to upgrade:

  • set up a second fully functioning environment in a separate blank database (no tables), with new software (but do not run syncdb or migrate yet).
  • take your existing site down (possibly show some maintenance page)
  • dump your current database
  • load the database dump into the new (completely blank) database
  • migrate the new database with command python migrate

It might be tempting to just write over the old files with the new, but this might lead to harder problems to solve - trying to remember what edits you made in the files or fix the broken database.

With the "live" and "staging" deployments you can quickly revert if something goes wrong.

edit flag offensive delete link more


I'm not sure what you mean by using a virtual environment for the app. This server exists on it's own virtual server and there is nothing else on this server except for the applications required by this application (such as django, python, apache).

catdrich's avatar catdrich  ( 2012-01-17 08:11:09 -0500 )edit

And, I already looked up configuring mod_wsgi with python when I first put up the site.

catdrich's avatar catdrich  ( 2012-01-17 08:12:23 -0500 )edit

Ok, just giving the heads up, it is always very disappointing to put the live site down when upgrading. Re: virtual environment - there is a python tool called virtualenv that you can install with pip and use to create isolated python environments. It's super easy to use.

Evgeny's avatar Evgeny  ( 2012-01-17 08:15:38 -0500 )edit

Is your suggestion to set it up on a separate server or just using a different database, different path, etc.? We use Ubuntu, btw. I just want to make sure of the steps so if we do go to more of a production setting, I can upgrade without issues.. Update -- I posted this before the information you gave me about virtualenv.

catdrich's avatar catdrich  ( 2012-01-17 08:18:00 -0500 )edit

It can be set up on the same server, no need for a separate machine. Cheers!

Evgeny's avatar Evgeny  ( 2012-01-17 08:23:25 -0500 )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


Asked: 2012-01-17 06:35:41 -0500

Seen: 423 times

Last updated: Jan 17 '12