How to set environment variable DJANGO_SETTINGS_MODULE

when i debug i get this error

raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

anyone has any idea how to resolve this