0

I would like to use Django classes outside of Django framework, like in Jupyter or in any module. From this using django model outside of the django framework, I have seen this

import django
import sys
import os

sys.path.append(os.path.abspath("/home/pi/garageMonitor/django/garageMonitor"))
os.environ['DJANGO_SETTINGS_MODULE'] = 'garageMonitor.settings'
django.setup()

django.contrib.gis.geos 

It seems there are issues with GAL and geos packages....

Community
  • 1
  • 1
tensor
  • 3,088
  • 8
  • 37
  • 71
  • Have you read the part of the documentation that talks about using Django in standalone mode? https://docs.djangoproject.com/en/1.10/topics/settings/#calling-django-setup-is-required-for-standalone-django-usage . – voodoo-burger Feb 19 '17 at 15:34
  • Is geos/GDAL working properly with manage.py (runserver/test/migrate)? See also django-extensions's [`shell_plus --notebook`](https://www.facebook.com/permalink.php?story_fbid=117542061954187&id=100010951810125) command. – Udi Feb 20 '17 at 00:22

0 Answers0