Skip to content

Commit

Permalink
Fix #91: Set CQLENG_ALLOW_SCHEMA_MANAGEMENT variable if was not present
Browse files Browse the repository at this point in the history
  • Loading branch information
r4fek committed May 15, 2017
1 parent 9089d85 commit 0d66248
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django_cassandra_engine/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import absolute_import, unicode_literals
import os

from django.apps import AppConfig as DjangoAppConfig
import cassandra.cqlengine.columns
Expand Down Expand Up @@ -43,6 +44,9 @@ def has_default(self):
# monkey patch Column.has_default to be able to use function call too
cassandra.cqlengine.columns.Column.has_default = property(has_default)

if os.getenv('CQLENG_ALLOW_SCHEMA_MANAGEMENT') is None:
os.environ['CQLENG_ALLOW_SCHEMA_MANAGEMENT'] = '1'


class AppConfig(DjangoAppConfig):
name = 'django_cassandra_engine'
Expand Down

0 comments on commit 0d66248

Please sign in to comment.