graphql-python / swapi-graphene

GraphQL Starwars API using Graphene and Django

Home Page:http://swapi.graphene-python.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

running python manage migrate fails with 'reload' is not defined

benblippar opened this issue · comments

Followed the Readme and had an issue

python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/management/base.py", line 398, in execute
    self.check()
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/management/base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/checks/registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    for pattern in resolver.url_patterns:
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/site-packages/django/core/urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "/Users/ben/.virtualenvs/swapi/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Users/ben/src/gowork/src/github.com/swapi-graphene/swapi_graphene/urls.py", line 25, in <module>
    from starwars.schema import schema
  File "/Users/ben/src/gowork/src/github.com/swapi-graphene/starwars/schema.py", line 2, in <module>
    reload(sys)
NameError: name 'reload' is not defined

The author is using (unfortunately) python2.

https://github.com/graphql-python/swapi-graphene/blob/master/starwars/schema.py#L1-L3
those 3 lines are a hack to use utf-8 in python2.

http://stackoverflow.com/a/3828742/2317085

Will fix that soon! Thanks for the report :)

Fixed now in master. Closing issue