Heroku the cloud based platform as a service supports DJango. http://devcenter.heroku.com/articles/django

Is there any reason why OSQA couldn't be installed on Heroku ?

Has anyone tried to install it on Heroku ?

EDIT... I've got most of the way through an install.

Here's what I have so far assuming you already have the heroku command installed.

mkdir osqa
cd osqa
svn co http://svn.osqa.net/svnroot/osqa/trunk osqa
mv osqa/settings_local.py.dist osqa/settings_local.py

Create a requirements.txt file with the following contents

django>=1.1
mysql-python
python-openid
psycopg2
html5lib
markdown
git+git://github.com/robhudson/django-debug-toolbar.git
git+git://github.com/dcramer/django-sphinx.git
South

Your folder will now look something like

osqa
  osqa/
  requirements.txt

Edit the settings_local.py file and add the following to the very end

import os, sys, urlparse
urlparse.uses_netloc.append('postgres')
urlparse.uses_netloc.append('mysql')
try:
if os.environ.has_key('DATABASE_URL'):
  url = urlparse.urlparse(os.environ['DATABASE_URL'])
  DATABASES['default'] = {
  'NAME': url.path[1:],
  'USER': url.username,
  'PASSWORD': url.password,
  'HOST': url.hostname,
  'PORT': url.port,
}
if url.scheme == 'postgres':
  DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
if url.scheme == 'mysql':
  DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
except:
  print "Unexpected error:", sys.exc_info()

Also make sure the following modules are set to disabled in settings_local.py or you will get errors when doing searches.

DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'sphinxfulltext', 'pgfulltext']

This allows OSQA to pickup the database settings from Heroku. Next we add the code to a git repositiory

git init
git add .
git commit -m"Initial Commit"

Create an heroku application

heroku create --stack cedar
git push heroku master

I had to run the push twice as sometimes repositories don't get picked up due to timeout issues. Next we migrate the database.

heroku run python osqa/manage.py syncdb --all
heroku run python osqa/manage.py migrate forum --fake

I had to run the migrations twice but then it everything seems to work apart from open-id login.

asked 15 Dec '11, 10:16

ianpurton's gravatar image

ianpurton
2614
accept rate: 0%

edited 12 Jan, 05:47

I've updated this to reflect diabling some modules that don't work on heroku.

(12 Jan, 05:53) ianpurton

Just created this git repository that will hopefully get you up and running...

OSQA-Heroku

link

answered 25 Jan, 13:02

joshfinnie's gravatar image

joshfinnie
1114
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2

Asked: 15 Dec '11, 10:16

Seen: 324 times

Last updated: 25 Jan, 13:02

powered by OSQA