jeff
jeff

Reputation: 1020

Environment can only contain strings- wagtail CMS, Django

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

Upvotes: 1

Views: 558

Answers (1)

gasman
gasman

Reputation: 25237

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).

Upvotes: 2

Related Questions