jazzband / django-constance

Dynamic Django settings.
https://django-constance.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.66k stars 307 forks source link

exception in thread django-main-thread error #419

Closed narenpop closed 2 years ago

narenpop commented 3 years ago

Describe the problem

django_err

Tell us about the problem you're having.

I was trying to install djangorestframewok and i installed it then i had an issue running the server have attached the image file

(localdev-EUbEEbsi) C:\Users\ASUS\Desktop\localdev\ecom>python manage.py runserver Watching for file changes with StatReloader Performing system checks...

Exception in thread django-main-thread: Traceback (most recent call last): File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 932, in _bootstrap_inner self.run() File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(args, **kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\base.py", line 392, in check all_issues = checks.run_checks( File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\urls.py", line 101, in check_url_settings if value and not value.endswith('/'): AttributeError: 'tuple' object has no attribute 'endswith'

Steps to reproduce

Tell us how to reproduce it.

System configuration

Intergalaxen commented 3 years ago

Describe the problem

django_err

Tell us about the problem you're having.

I was trying to install djangorestframewok and i installed it then i had an issue running the server have attached the image file

(localdev-EUbEEbsi) C:\Users\ASUS\Desktop\localdev\ecom>python manage.py runserver Watching for file changes with StatReloader Performing system checks...

Exception in thread django-main-thread: Traceback (most recent call last): File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 932, in _bootstrap_inner self.run() File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(args, **kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\base.py", line 392, in check all_issues = checks.run_checks( File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\urls.py", line 101, in check_url_settings if value and not value.endswith('/'): AttributeError: 'tuple' object has no attribute 'endswith'

Steps to reproduce

Tell us how to reproduce it.

System configuration

  • Django version:
  • Python version:3.8.5
  • Django-Constance version:

I'm having the same issue, have u been able to fix it? If yes, how did you make it? /Int ^^

Chuckpy commented 3 years ago

Same as mine

uxrishu commented 3 years ago

getting same error but didn't get any solution yet. :-(

2019980006 commented 3 years ago

same as mine

naseeraslam commented 3 years ago

same as mine can anyone help please

Mogost commented 3 years ago

"same as mine"

Doesn't help to understand your issue at all. Why do you think that the problem is with this library? There is no one mention of django-constance in stacktrace.

vbonh commented 2 years ago

For those who are facing a similar problem and land on this page.

Go to your settings.py and make sure you have a coma at the end of each lines in your installed apps, Middleware etc...

Worked for me

Charlie5DH commented 2 years ago

If you have this problem, go to the settings.py file, and check for comas and if rest_framework is correctly spelled.

AkshatPatel07 commented 2 years ago

@vbonh can you please elaborate more. Facing same problem

Aastha-1008 commented 2 years ago

@AkshatPatel07 Are you able to solve this error?

kwonjaeyong1 commented 1 year ago

same as mine

AkshatPatel07 commented 1 year ago

@AkshatPatel07 Are you able to solve this error?

Yess

command09 commented 1 year ago

Python manage.py migrate

naseeraslam commented 1 year ago

I solved the problem by just installing required packages.

On Fri, 10 Jun 2022, 11:52 am Aj.weerachai, @.***> wrote:

same as mine can anyone help please

— Reply to this email directly, view it on GitHub https://github.com/jazzband/django-constance/issues/419#issuecomment-1152032195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQQUSWNMSGVQYXXWWBNJ43VOLQ4VANCNFSM4QO6HPRA . You are receiving this because you commented.Message ID: @.***>

JyotsanaMehra commented 1 year ago

I was also facing the same issue. Check for the database which you are using is installed or not and if you are not using any databases, then go to settings.py and comment out the Database section DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } }

This will resolve the issue

Zaza2215 commented 1 year ago

I ran cmd as administrator and everything worked.

2100031431 commented 1 year ago

same issue for me and i have checked the settings.py it was perfect

LnPaulin commented 1 year ago

Having working on windows and when i take my app to linux, I have that issue.. everything works file on windows but when I pull it from windows to linux and run any manage.py command I have the same issue you raised on this.. any ideas ?

Sushant0999 commented 1 year ago

I was having the same issue. I solved it by just changing the python interpreter. Worked for me ✔.

aomer24 commented 1 year ago

check the setting configration (stting.py) file

Statesonbrown commented 11 months ago

Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64qbz5n2kfra8p0\lib\threading.py", line 926, in _bootstrap_inner self.run() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64qbz5n2kfra8p0\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(args, **kwargs) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\base.py", line 396, in check databases=databases, File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\checks\registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\checks\urls.py", line 13, in check_url_config return check_resolver(resolver) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\checks\urls.py", line 23, in check_resolver return check_method() File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\urls\resolvers.py", line 408, in check for pattern in self.url_patterns: File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\functional.py", line 48, in get res = instance.dict[self.name] = self.func(instance) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\urls\resolvers.py", line 589, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\functional.py", line 48, in get res = instance.dict[self.name] = self.func(instance) File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\urls\resolvers.py", line 582, in urlconf_module return import_module(self.urlconf_name) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64qbz5n2kfra8p0\lib\importlib__init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "C:\Users\Z\Desktop\Attendance-System-Using-Face-Recognition\attendance_system_facial_recognition\urls.py", line 19, in from recognition import views as recog_views File "C:\Users\Z\Desktop\Attendance-System-Using-Face-Recognition\recognition\views.py", line 18, in from sklearn.preprocessing import LabelEncoder File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn__init.py", line 76, in from .base import clone File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn\base.py", line 16, in from .utils import _IS_32BIT File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn\utils\init__.py", line 13, in from scipy.sparse import issparse File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\init__.py", line 136, in from . import _distributor_init File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy_distributor_init.py", line 61, in WinDLL(os.path.abspath(filename)) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64qbz5n2kfra8p0\lib\ctypes__init.py", line 364, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found

Lizano16 commented 7 months ago

PS C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema> python manage.py runserver Watching for file changes with StatReloader Performing system checks...

Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner self.run() File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run self._target(*self._args, *self._kwargs) File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(
args, **kwargs) File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\commands\runserver.py", line 133, in inner_run self.check(display_num_errors=True) File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\base.py", line 485, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config return check_resolver(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver return check_method() ^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\resolvers.py", line 494, in check for pattern in self.url_patterns: ^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\utils\functional.py", line 57, in get
res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\utils\functional.py", line 57, in get
res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\importlib__init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema\sistema\urls.py", line 24, in path('', include('chatbot.urls')), ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\conf.py", line 38, in include urlconf_module = import_module(urlconf_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\importlib\init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema\chatbot\urls.py", line 2, in from . import views File "C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema\chatbot\views.py", line 5, in import openai ModuleNotFoundError: No module named 'openai' PS C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema>

Alguien sabe por que me aparece este error

mehdi8554 commented 3 months ago

For me solved as below: pip unistall djangorestframework pip install djangorestframework that's all

Himi-Deb commented 3 months ago

Describe the problem

django_err

Tell us about the problem you're having.

I was trying to install djangorestframewok and i installed it then i had an issue running the server have attached the image file

(localdev-EUbEEbsi) C:\Users\ASUS\Desktop\localdev\ecom>python manage.py runserver Watching for file changes with StatReloader Performing system checks...

Exception in thread django-main-thread: Traceback (most recent call last): File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 932, in _bootstrap_inner self.run() File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(args, **kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\base.py", line 392, in check all_issues = checks.run_checks( File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\urls.py", line 101, in check_url_settings if value and not value.endswith('/'): AttributeError: 'tuple' object has no attribute 'endswith'

Steps to reproduce

Tell us how to reproduce it.

System configuration

  • Django version:
  • Python version:3.8.5
  • Django-Constance version:

I went to an earlier local version in vscode (undo on the recently deleted file)... which I am guess threw off this

"Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Python312\Lib\threading.py", line 1073, in _bootstrap_inner self.run() File "C:\Python312\Lib\threading.py", line 1010, in run self._target(*self._args, **self._kwargs)"

Checked my settings.py but don't notice anything unusual

Bhaktims commented 2 months ago

i updated the pip using command "python.exe -m pip install --upgrade pip" and then reinstalled django

1Athar commented 1 month ago

Watching for file changes with StatReloader Performing system checks...

Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Python312\Lib\threading.py", line 1073, in _bootstrap_inner self.run() File "C:\Python312\Lib\threading.py", line 1010, in run self._target(*self._args, *self._kwargs) File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(args, **kwargs) File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\management\commands\runserver.py", line 133, in inner_run self.check(display_num_errors=True) File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\management\base.py", line 486, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config return check_resolver(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver return check_method() ^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\urls\resolvers.py", line 519, in check for pattern in self.url_patterns: ^^^^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\utils\functional.py", line 47, in get res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\urls\resolvers.py", line 738, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\utils\functional.py", line 47, in get res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\urls\resolvers.py", line 731, in urlconf_module return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\importlib__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed File "C:\Users\Atharva\Desktop\PBL-SE\captcha\captcha\urls.py", line 19, in from . import views ImportError: cannot import name 'views' from 'captcha' (C:\Users\Atharva\Desktop\PBL-SE\captcha\captcha__init__.py)

I am getting this error please someone help...

dorian-404 commented 2 weeks ago

hey i have the same issue , did you solve it?

Bhaktims commented 2 weeks ago

i updated the pip using command "python.exe -m pip install --upgrade pip" and then reinstalled Django.. and my Django is properly working.