Could it be an improperly configured database ?
Also check installed apps.  
It is most likely a syntax error in settings like a comma, colon or apostrophe

Sent from my iPad

> On 13-Feb-2020, at 7:34 PM, onlinejudge95 <onlinejudg...@gmail.com> wrote:
> 
>> On Thu, Feb 13, 2020 at 6:34 PM Sourish Kundu <sourishkund...@gmail.com> 
>> wrote:
> 
>> So I am trying to access one of my models created in views.py in another 
>> script. This second script is the one I would like manually run. It imports 
>> the model without any errors; however, when I try to run it using PyCharm, I 
>> get this error:
> 
> Firstly, what are your models doing in views.py? I am assuming it was a typo.
>  
>> 
>> 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.
>> 
>> Any help on resolving this issue would be very much appreciated.
> 
> For scripts like these that are not part of your web server or that do not 
> take part in the request-response cycle, I like to implement them as custom 
> Django commands. You can read more about them here.
>  
>> 
>> 
>> Thanks,
>> Sourish
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/2c9b2d34-a9ab-4a2f-a1e4-e2694c265ea0%40googlegroups.com.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAD%3DM5eSBrbLvnFBzoGfOaJk3NnWG8t1N2aOQTmHR6TDsup3F%2BA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/824DE3AE-7DEE-4A00-8AF2-F709F371E06A%40gmail.com.

Reply via email to