summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-11-10 19:46:25 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-11-10 19:46:25 -0300
commit6139e3ef8ed2601e6c2b7b63a865b74d4f11a114 (patch)
tree946a46db056c3f0cd5c73e17ae5422c03bf433fe
parent4ce19e152c1244a6acf74c9ce3622493adc49947 (diff)
downloadaskbot-6139e3ef8ed2601e6c2b7b63a865b74d4f11a114.tar.gz
askbot-6139e3ef8ed2601e6c2b7b63a865b74d4f11a114.tar.bz2
askbot-6139e3ef8ed2601e6c2b7b63a865b74d4f11a114.zip
removed table deletion in backwards migration 156 and fixed up the askbot-setup command to hopefully work with django 1.3 and 1.4 simultaneously
-rw-r--r--askbot/deployment/__init__.py13
-rw-r--r--askbot/migrations/0156_add_message_model_in_new_django.py3
-rw-r--r--askbot/setup_templates/settings.py.mustache2
3 files changed, 14 insertions, 4 deletions
diff --git a/askbot/deployment/__init__.py b/askbot/deployment/__init__.py
index 8832cd01..59926cf4 100644
--- a/askbot/deployment/__init__.py
+++ b/askbot/deployment/__init__.py
@@ -127,12 +127,23 @@ def deploy_askbot(directory, options):
path_utils.create_path(directory)
- if django.VERSION[0] == 1 and django.VERSION[1] < 3:
+ if django.VERSION[0] > 1:
+ raise Exception(
+ 'Django framework with major version > 1 is not supported'
+ )
+
+ if django.VERSION[1] < 3:
#force people install the django-staticfiles app
context['staticfiles_app'] = ''
else:
context['staticfiles_app'] = "'django.contrib.staticfiles',"
+ if django.VERSION[1] <=3:
+ auth_context_processor = 'django.core.context_processors.auth'
+ else:
+ auth_context_processor = 'django.contrib.auth.context_processors.auth'
+ context['auth_context_processor'] = auth_context_processor
+
path_utils.deploy_into(
directory,
new_project = create_new_project,
diff --git a/askbot/migrations/0156_add_message_model_in_new_django.py b/askbot/migrations/0156_add_message_model_in_new_django.py
index e3fc1df1..2f86daaf 100644
--- a/askbot/migrations/0156_add_message_model_in_new_django.py
+++ b/askbot/migrations/0156_add_message_model_in_new_django.py
@@ -19,8 +19,7 @@ class Migration(SchemaMigration):
db.send_create_signal('askbot', ['Message'])
def backwards(self, orm):
- if django.get_version() > '1.3.1' and db_table_exists('auth_message'):
- db.delete_table('auth_message')
+ pass
models = {
'askbot.activity': {
diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache
index d3910252..333df331 100644
--- a/askbot/setup_templates/settings.py.mustache
+++ b/askbot/setup_templates/settings.py.mustache
@@ -147,7 +147,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'askbot.context.application_settings',
#'django.core.context_processors.i18n',
'askbot.user_messages.context_processors.user_messages',#must be before auth
- 'django.contrib.auth.context_processors.auth', #this is required for admin
+ '{{ auth_context_processor }}', #this is required for the admin app
'django.core.context_processors.csrf', #necessary for csrf protection
)