Discussion:
django.core.exceptions.ImproperlyConfigured: Requested setting AUTH_USER_MODEL, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
(too old to reply)
Tushar Khairnar
2018-12-05 12:21:06 UTC
Permalink
C:\Python\python.exe "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py"
Traceback (most recent call last):
File "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py", line 2, in <module>
from rest_framework.authtoken.models import Token
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 11, in <module>
class Token(models.Model):
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 17, in Token
settings.AUTH_USER_MODEL, related_name='auth_token',
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 57, in
__getattr__
self._setup(name)
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 42, in
_setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
AUTH_USER_MODEL, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.
--
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+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/36636e92-854d-4a77-9493-b60836799509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ryan Nowakowski
2018-12-05 13:26:43 UTC
Permalink
I'm not quite sure what you're trying to do. Are you trying to run views.py?
Post by Tushar Khairnar
C:\Python\python.exe "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py"
File "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py", line 2, in <module>
from rest_framework.authtoken.models import Token
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 11, in <module>
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 17, in Token
settings.AUTH_USER_MODEL, related_name='auth_token',
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 57, in
__getattr__
self._setup(name)
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 42, in
_setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
AUTH_USER_MODEL, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/36636e92-854d-4a77-9493-b60836799509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/28D4A2BE-35AC-45F0-8A28-B3AA46495AC4%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.
Sidnei Pereira
2018-12-06 15:30:58 UTC
Permalink
It seems you are trying to execute de `views.py` module directly. As you
are running Django you should run it's webserver through `manage.py` so
Django you setup everything it is expected and the process starts to listen
to port: So:

python manage.py runserver

It will run the server by default in the localhost and port 8000. To test
your `view` open the browser and type the correspondent URL
(http://localhost:8000/this_view_url/) for that view.

Actually I strongly recommend you to go through the "Getting started with
Django" (https://www.djangoproject.com/start/)

*P.S.: Looks like you are using PyCham IDE and there you hit play/run
button to start the application but before it needs to be correctly setup.
It may vary from professional to community version, but you Basically have
to add a run configuration (next to the play button on the top right). In
pro version just choose "Django server" on the template's list, usually the
default values are good to go. The community one does not have the "Django
Server" on the list so choose "Python" and type the runserver command as
explained before.

Em quarta-feira, 5 de dezembro de 2018 10:28:01 UTC-2, Tushar Khairnar
Post by Tushar Khairnar
C:\Python\python.exe "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py"
File "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py", line 2, in <module>
from rest_framework.authtoken.models import Token
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 11, in <module>
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 17, in Token
settings.AUTH_USER_MODEL, related_name='auth_token',
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 57, in
__getattr__
self._setup(name)
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 42, in
_setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
AUTH_USER_MODEL, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.
--
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+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f0597428-5b2b-41a3-93cc-1fd326b1f828%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Parker Bernard
2018-12-06 17:16:09 UTC
Permalink
how do i open my django in my pycharm or python
Post by Sidnei Pereira
It seems you are trying to execute de `views.py` module directly. As you
are running Django you should run it's webserver through `manage.py` so
Django you setup everything it is expected and the process starts to listen
python manage.py runserver
It will run the server by default in the localhost and port 8000. To test
your `view` open the browser and type the correspondent URL (
http://localhost:8000/this_view_url/) for that view.
Actually I strongly recommend you to go through the "Getting started with
Django" (https://www.djangoproject.com/start/)
*P.S.: Looks like you are using PyCham IDE and there you hit play/run
button to start the application but before it needs to be correctly setup.
It may vary from professional to community version, but you Basically have
to add a run configuration (next to the play button on the top right). In
pro version just choose "Django server" on the template's list, usually the
default values are good to go. The community one does not have the "Django
Server" on the list so choose "Python" and type the runserver command as
explained before.
Em quarta-feira, 5 de dezembro de 2018 10:28:01 UTC-2, Tushar Khairnar
Post by Tushar Khairnar
C:\Python\python.exe "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py"
File "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py", line 2, in <module>
from rest_framework.authtoken.models import Token
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 11, in <module>
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 17, in Token
settings.AUTH_USER_MODEL, related_name='auth_token',
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 57, in
__getattr__
self._setup(name)
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 42, in
_setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
AUTH_USER_MODEL, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/f0597428-5b2b-41a3-93cc-1fd326b1f828%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/f0597428-5b2b-41a3-93cc-1fd326b1f828%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFDnJVVwvt1y6NTvoVccWD8B59JHjLFt0%3Dy8b0tAYbhBGa517w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Sidnei Pereira
2018-12-07 13:57:49 UTC
Permalink
Take a look on this article.

https://automationpanda.com/2017/09/14/django-projects-in-pycharm-community-edition/

Em quinta-feira, 6 de dezembro de 2018 15:18:22 UTC-2, Parker Bernard
Post by Parker Bernard
how do i open my django in my pycharm or python
Post by Sidnei Pereira
It seems you are trying to execute de `views.py` module directly. As you
are running Django you should run it's webserver through `manage.py` so
Django you setup everything it is expected and the process starts to listen
python manage.py runserver
It will run the server by default in the localhost and port 8000. To test
your `view` open the browser and type the correspondent URL (
http://localhost:8000/this_view_url/) for that view.
Actually I strongly recommend you to go through the "Getting started with
Django" (https://www.djangoproject.com/start/)
*P.S.: Looks like you are using PyCham IDE and there you hit play/run
button to start the application but before it needs to be correctly setup.
It may vary from professional to community version, but you Basically have
to add a run configuration (next to the play button on the top right). In
pro version just choose "Django server" on the template's list, usually the
default values are good to go. The community one does not have the "Django
Server" on the list so choose "Python" and type the runserver command as
explained before.
Em quarta-feira, 5 de dezembro de 2018 10:28:01 UTC-2, Tushar Khairnar
Post by Tushar Khairnar
C:\Python\python.exe "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py"
File "D:/Python/django reset
framework/secondtestdjrstapi/users/views.py", line 2, in <module>
from rest_framework.authtoken.models import Token
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 11, in <module>
File "C:\Python\lib\site-packages\rest_framework\authtoken\models.py",
line 17, in Token
settings.AUTH_USER_MODEL, related_name='auth_token',
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 57,
in __getattr__
self._setup(name)
File "C:\Python\lib\site-packages\django\conf\__init__.py", line 42,
in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting
AUTH_USER_MODEL, but settings are not configured. You must either define
the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.
--
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
<javascript:>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/f0597428-5b2b-41a3-93cc-1fd326b1f828%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/f0597428-5b2b-41a3-93cc-1fd326b1f828%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7630b8e9-cc99-492f-b5b0-ce2631a71a59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...