Skip to content

Commit

Permalink
Merge pull request #15 from jamesturk/no-debug-explosion
Browse files Browse the repository at this point in the history
avoid blowing up when DEBUG is true
  • Loading branch information
James McKinney committed Mar 25, 2014
2 parents b5276f9 + 27d3aca commit 2c4527b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boundaries/management/commands/loadshapefiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from django.core.management.base import BaseCommand
from django.db import connections, DEFAULT_DB_ALIAS, transaction
from django.template.defaultfilters import slugify
from django.utils import six

import boundaries
from boundaries.models import BoundarySet, Boundary, app_settings
Expand Down Expand Up @@ -48,6 +49,11 @@ def get_version(self):
return '0.1'

def handle(self, *args, **options):
if settings.DEBUG:
print('DEBUG is True - this can cause memory usage to balloon. continue? [y/n]')
if six.moves.input().lower() != 'y':
return

# Load configuration
boundaries.autodiscover(options['data_dir'])

Expand Down

0 comments on commit 2c4527b

Please sign in to comment.