0👍
I was experiencing the same problem. I found that I was running the wrong type of test.
import unittest
class MySampleTest(unittest.TestCase):
Cause the error
django.core.exceptions.ImproperlyConfigured: Requested setting API_BASE_URL, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Changing to the import to
from django.test import SimpleTestCase
Class MySampleTest(SimpleTestCase):
allowed my test to run from within pycharm
.
- [Django]-Auto-truncating fields at max_length in Django CharFields
- [Django]-Whats the simplest and safest method to generate a API KEY and SECRET in Python
- [Django]-How do I separate my models out in django?
Source:stackexchange.com