just started using st2, switchingn from Eclipse pydev.
In Eclipse, I imported my Django project and could hit “Run” from any file and use the django framework.
for instance if I wanted to test something about my model class:
#models.py
from django.contrib.auth import logout, login as auth_login
if name == “main”:
auth_login(username, password)
This would run and validate.
However, in sublime text, I can’t get my python virtual_env to build the same way.
I keep getting the following error when I import anything django:
django.core.exceptions.ImproperlyConfigured: Requested settings CACHES, but settings are not configured.
One way to fix it is to ADD to EVERY FILE i want to test:
import os
os.environ.setdefault(“DJANGO_SETTINGS_MODULE”, “myapp.settings”)
I was wondering if there is an easier way to include this? My current build file is:
{
“working_dir”: “/home/username/virtualenvs/workspace/myproject”,
“env” : { “PYTHONPATH” : “/home/username/virtualenvs/workspace/myproject”},
“cmd” : “/home/username/virtualenvs/workspace/bin/python2.7”,
“selector” : “source.python”
}
I’ve been searching around for hours…any help is appreciated!