I have installed django-jenkins in following environment
coverage (4.0.1)
Django (1.8)
pep8 (1.6.2)
django-jenkins (0.17.0)
pyflakes (1.0.0)
and I when I try this
python manage.py jenkins --enable-coverage
I get this error
Destroying test database for alias 'default'...
Storing coverage info...
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 30, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 74, in execute
super(Command, self).execute(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django_jenkins/management/commands/jenkins.py", line 161, in handle
coverage.save(tested_locations, options)
File "/usr/local/lib/python2.7/dist-packages/django_jenkins/tasks/with_coverage.py", line 33, in save
self.coverage.stop()
AttributeError: 'Coverage' object has no attribute '_harvest_data'
Any ideas ? I followed this manual exactly.
I found out the django-jenkins uses Coverage and in newest version of coverage the method _harvest_data has changed to get_data but in the final official release of django-jenkins it has not been applied so I switched to their latest git version and it solved.
Related
For some reasons, I had to reinstall Python on my desktop. Since then, my django applications are not working. I can create one, but as soon as I import a package anywhere in the application, I can't run python manage.py runserver
I can run another python script, I can start Jupyter Notebooks (and import the exact same packages in them). I also tried to create new projects with the "new" python installed, as soon as I add import pandas (or any other packages except django), I have the error.
The error message is quite long :
Watching for file changes with StatReloader
Performing system checks...
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\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 585, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 570, in start_django
reloader.run(django_main_thread)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 288, in run
self.run_loop()
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 294, in run_loop
next(ticker)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 334, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 350, in snapshot_files
for file in self.watched_files():
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 249, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\djan
go\utils\autoreload.py", line 116, in iter_modules_and_files
if module.__name__ == '__main__':
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\py\_
apipkg.py", line 171, in __getattribute__
return getattr(getmod(), name)
File "C:\Users\MyName\AppData\Local\Continuum\anaconda3\lib\site-packages\py\_
error.py", line 44, in __getattr__
raise AttributeError(name)
AttributeError: __name__
Got this annoying error after aborting an IDE-refactoring.
I suggest the following to reproduce the problem:
Revert git changes.
Make sure there are no cyclic imports in your code.
Reinstall virtual environment.
Unfortunately the error was still there in my case. So I knew the problem must be with python. And indeed:
Reinstalling python 3.7 solved the problem.
Did you pip install django?
I think when you reinstalled Python you didn't installed packaged like Django
Uninstall the current Django package and install Django 2.1.5
Use this command on windows:
pip install --user django==2.1.5
I want to install djangocms_table plugin.My current Django cms version is 3.5.2
I followed the below steps to do the same.
1.pip install djangocms_table
2.Added 'djangocms_table' to INSTALLED_APPS
3.manage.py migrate djangocms_table
After I ran migrate command got the below exception.
System check identified some issues:
WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.
Traceback (most recent call last):
File "/host/lendingstream/src/web/ConsumerUI/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 25, in handle
call_command("migrate", **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 120, in call_command
return command.execute(*args, **defaults)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 182, in build_graph
self.load_disk()
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 123, in load_disk
"creating Django migrations." % app_config.label
django.db.migrations.loader.BadMigrationError: Migrated app 'djangocms_table' contains South migrations. Make sure all numbered South migrations are deleted prior to creating Django migrations.
I am getting the following error while runserver command in Django. I am using wagtail CMS. Could someone help me with this, please ?
C:\Users\MAFON\Desktop\mafonglobal>python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 12, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 62, in execute
super(Command, self).execute(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 101, in handle
self.run(**options)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 110, in run
autoreload.main(self.inner_run, None, options)
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 332, in main
reloader(wrapped_main_func, args, kwargs)
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 303, in python_reloader
exit_code = restart_with_reloader()
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 289, in restart_with_reloader
exit_code = subprocess.call(args, env=new_environ)
File "C:\Python27\lib\subprocess.py", line 168, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
TypeError: environment can only contain strings
This was a Django bug introduced in Django 1.11:
https://code.djangoproject.com/ticket/28174
This is now fixed in Django 1.11.4, so upgrading to the latest Django should solve this. However, I'd strongly recommend upgrading to Python 3 (which will also avoid this issue) - Python 2.7 is very much end-of-line now, and support for it will be dropped in Django 2.0 (due at the end of this year).
I get the following error as soon as I run django app along with the django-socketio app using python manage.py runserver_socketio
SocketIOServer running on 127.0.0.1:8001
KeyboardInterrupt
Thu Jul 6 22:04:52 2017
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django_socketio-0.3.9-py2.7.egg/django_socketio/management/commands/runserver_socketio.py", line 65, in handle
server.kill()
File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 43, in kill
self.policy_server.kill()
AttributeError: 'FlashPolicyServer' object has no attribute 'kill'
Am I missing something ?
Inspired by this issue, I tried downgrading gevent-socketio and gevent and it worked.
pip uninstall gevent-socketio gevent
pip install gevent-socketio==0.2.1 gevent==0.13.6
I´m having a issue when I ran "python manage.py rebuild_index" in my app supported by haystack and elasticsearch.
Python 2.7
Django version 1.6.2
Haystack 2.1.0
Elasticsearch 1.0
Please see the error that is appearing:
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 399, in > execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 392, in > execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 242, in >run_from_argv
self.execute(*args, **options.dict)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/site-packages/haystack/management/commands/rebuild_index.py", line 15, in handle
call_command('clear_index', **options)
File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 159, in call_command
return klass.execute(*args, **defaults)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/site-packages/haystack/management/commands/clear_index.py", line 48, in handle
backend = connections[backend_name].get_backend()
File "/usr/lib/python2.7/site-packages/haystack/utils/loading.py", line 98, in getitem
self._connections[key] = load_backend(self.connections_info[key]['ENGINE'])(using=key)
File "/usr/lib/python2.7/site-packages/haystack/utils/loading.py", line 51, in load_backend
return import_class(full_backend_path)
File "/usr/lib/python2.7/site-packages/haystack/utils/loading.py", line 18, in import_class
module_itself = importlib.import_module(module_path)
File "/usr/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
import(name)
File "/usr/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 21, in
raise MissingDependency("The 'elasticsearch' backend requires the installation of 'requests'.")
haystack.exceptions.MissingDependency: The 'elasticsearch' backend requires the installation of 'requests'.
I've installed all the packages needed to run those apps however is asking about requests, What is it about?
just do
pip install pyelasticsearch
If you just install requests module through pip this error should go away.