I dont know what is wrong, and I am desperates with no sleep int two days because of this error. I dont know where does it come from, and it wouldn let me know what did i do wrong. for your information I am learning using django with python, my version of django is 1.11 and my version of python is 2.7 . Please help me, this is what i got from my code
Traceback (most recent call last):
File "./manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/management/commands/check.py", line 68, in handle
fail_level=getattr(checks, options['fail_level']),
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/checks/urls.py", line 28, in check_resolver
warnings.extend(check_resolver(pattern))
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/checks/urls.py", line 30, in check_resolver
warnings.extend(check_pattern_name(pattern))
File "/home/juunnn/env/lib/python3.5/site-packages/django/core/checks/urls.py", line 120, in check_pattern_name
if pattern.name is not None and ":" in pattern.name:
TypeError: argument of type 'function' is not iterable
See? it would not let me know where is my fault is.
The error suggests that you have forgotten quotes when naming a URL pattern.
For example you have name=my_view,
url('^my-url/$', my_view, name=my_view)
when you should use a string name='my_view':
url('^my-url/$', my_view, name='my_view')
Related
How to further troubleshoot Django issue where only built-in package files are listed in traceback output, instead of those user-created files, which does not tell what is wrong in the *.py files I created.
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 393, in execute
self.check()
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 423, in check
databases=databases,
File "/usr/local/lib/python3.7/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/usr/local/lib/python3.7/site-packages/wagtail/admin/checks.py", line 83, in inline_panel_model_panels_check
errors.extend(check_panels_in_model(cls))
File "/usr/local/lib/python3.7/site-packages/wagtail/admin/checks.py", line 110, in check_panels_in_model
context='InlinePanel model',
File "/usr/local/lib/python3.7/site-packages/wagtail/admin/checks.py", line 110, in check_panels_in_model
context='InlinePanel model',
File "/usr/local/lib/python3.7/site-packages/wagtail/admin/checks.py", line 110, in check_panels_in_model
context='InlinePanel model',
[Previous line repeated 984 more times]
File "/usr/local/lib/python3.7/site-packages/wagtail/admin/checks.py", line 100, in check_panels_in_model
if hasattr(cls, 'get_edit_handler'):
File "/usr/local/lib/python3.7/site-packages/wagtail/utils/decorators.py", line 29, in __get__
return self[owner]
RecursionError: maximum recursion depth exceeded while calling a Python object
Any thoughts on how to further troubleshoot?
You have not added the code.
Also the code already explained what's happening there. You are using wagtail decorator, you have to check how the decorator method works.
The error starts from last one
File "/usr/local/lib/python3.7/site-packages/wagtail/utils/decorators.py", line 29, in __get__
return self[owner]
I notice your issue is with threading and I guess you handling with large dataset or file.
Here you can increase the rate
import sys, threading
sys.setrecursionlimit(10**7) # max depth of recursion
threading.stack_size(2**27) # new thread will get stack of such size
I'm new to the Django framework and just trying to create a basic website, but when I try to open the server with the python manage.py runserver I get this error:
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 369, in execute
output = self.handle(*args, **options)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 601, in run_with_reloader
exit_code = restart_with_reloader()
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 230, in restart_with_reloader
p = subprocess.run(args, env=new_environ, close_fds=False)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\run\__init__.py", line 145, in __new__
process = cls.create_process(command, stdin, cwd=cwd, env=env, shell=shell)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\site-packages\run\__init__.py", line 121, in create_process
shlex.split(command),
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\shlex.py", line 310, in split
return list(lex)
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\shlex.py", line 299, in __next__
token = self.get_token()
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\shlex.py", line 109, in get_token
raw = self.read_token()
File "C:\Users\siuba\AppData\Local\Programs\Python\Python37\lib\shlex.py", line 140, in read_token
nextchar = self.instream.read(1)
AttributeError: 'list' object has no attribute 'read'
Does anyone know the answer? If so please help!
Thanks
Are you following a tutorial? If so, please share it with us. There may be a problem with your python installation. Please delete all python installations on your computer and install the latest version. Then create django project again.
Error traceback for AttributeError:
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
utility.execute()
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py", line 327, in execute
self.check()
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\commands\migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\checks.py", line 25, in check_admin_app
errors.extend(site.check(app_configs))
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\sites.py", line 81, in check
errors.extend(modeladmin.check())
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\options.py", line 117, in check
return self.checks_class().check(self, **kwargs)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\checks.py", line 526, in check
errors.extend(self._check_list_filter(admin_obj))
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\checks.py", line 697, in _check_list_filter
for index, item in enumerate(obj.list_filter)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\checks.py", line 697, in <listcomp>
for index, item in enumerate(obj.list_filter)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\checks.py", line 740, in _check_list_filter_item
get_fields_from_path(model, field)
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\utils.py", line 500, in get_fields_from_path
parent = get_model_from_relation(fields[-1])
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\contrib\admin\utils.py", line 451, in get_model_from_relation
return field.get_path_info()[-1].to_opts.model
File "C:\Users\INUSCG\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\models\fields\related.py", line 723, in get_path_info
opts = self.remote_field.model._meta
AttributeError: 'str' object has no attribute '_meta'
I am facing this Error on python 3.6, I got this error when i migrate my django project
IT's Django version problem
I installed python 3.8with appropriate Django version
Its working for me
I'm getting this error
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 440, in execute
self.check()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 478, in check
include_deployment_checks=include_deployment_checks,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py", line 1183, in check
errors.extend(cls._check_long_column_names())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py", line 1588, in _check_long_column_names
connection = connections[db]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 240, in __getitem__
backend = load_backend(db['ENGINE'])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 24, in <module>
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Expected in: /Library/PostgreSQL/9.4/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Can you please tell me where I am going wrong?
BTW, my psycopg2 is working fine as a standalone module.
this statement solved everything: export DYLD_LIBRARY_PATH=''
You have to be more precisely with your Question.
First of all, your error is :
ImproperlyConfigured: Error loading psycopg2 module
When do you get this error? (what command you run?)
What is your settings.py looking like?
Also you should format your Question better, it's a pain to read this Traceback!
I know this is more a comment then an answer, but i don't had enough reputation for that.
This was the traceback, please help.
Traceback (most recent call last):
File "C:\Documents and Settings\EC.32-SAMUEL\workspace\ec\ec\manage.py", line 11, in <module>
execute_manager(settings)
File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 438, in execute_manager
utility.execute()
File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 219, in execute
self.validate()
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "C:\Python26\lib\site-packages\django\core\management\validation.py", line 36, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 146, in get_app_errors
self._populate()
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 61, in _populate
self.load_app(app_name, True)
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 83, in load_app
if not module_has_submodule(app_module, 'models'):
File "C:\Python26\lib\site-packages\django\utils\module_loading.py", line 17, in module_has_submodule
for entry in package.__path__: # No __path__, then not a package.
AttributeError: 'module' object has no attribute '
path'
BeautifulSoup is not a Django-app. Its a python package/module. You don't have to add to INSTALLED_APPS. It just need to be available in your PYTHONPATH to use it.
Your traceback doesn't give clue what is actually wrong with your Django project.
The only time you ever need to do a syncdb is when you have to do something to the db. BeautifulSoup does not need to use the db at any point and does not need to be an installed app