Django-Tutorials
Django-Tutorials copied to clipboard
Hello max,I get TypeError when running the server. Am new in django and python please don't mind me.
trafficstars
This is my urls.py-
`from django.contrib import admin
from django.urls import include, path
from graphene_django.views import GraphQLView
from blog.schema import schema
urlpatterns = [
path('graphql/', GraphQLView.as_view(graphicql=True, schema=schema)),
]
`
this is my urls.py_chatter
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
```
`
and lastly my error
`Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f28f4559ae8>
Traceback (most recent call last):
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run
self.check(display_num_errors=True)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/core/management/base.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/core/management/base.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/core/checks/registry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/urls/resolvers.py", line 397, in check
for pattern in self.url_patterns:
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/utils/functional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/urls/resolvers.py", line 536, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/utils/functional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/urls/resolvers.py", line 529, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/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 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/kevinm/djangogirls/chatter/chatter/urls.py", line 6, in <module>
path('', include('blog.urls')),
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/usr/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 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/kevinm/djangogirls/chatter/blog/urls.py", line 9, in <module>
path('graphql/', GraphQLView.as_view(graphicql=True, schema=schema)),
File "/home/kevinm/djangogirls/myvenv/lib/python3.5/site-packages/django/views/generic/base.py", line 60, in as_view
"attributes of the class." % (cls.__name__, key))
TypeError: GraphQLView() received an invalid keyword 'graphicql'. as_view only accepts arguments that are already attributes of the class.
`
Thanks for taking your time max.