Skip to content

Commit ce9d989

Browse files
committed
Update install docs for Django 2.x
This uses the new URL routing syntax introduced in Django 2.0 (https://docs.djangoproject.com/en/2.2/releases/2.0/#simplified-url-routing-syntax). The older `url()` syntax will deprecated at some point in future https://docs.djangoproject.com/en/2.2/ref/urls/#url
1 parent 865c953 commit ce9d989

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ Add ``graphene_django`` to the ``INSTALLED_APPS`` in the ``settings.py`` file of
3030
]
3131
3232
33-
We need to add a graphql URL to the ``urls.py`` of your Django project:
33+
We need to add a ``graphql`` URL to the ``urls.py`` of your Django project:
3434

3535
.. code:: python
3636
37-
from django.conf.urls import url
37+
from django.urls import path
3838
from graphene_django.views import GraphQLView
3939
4040
urlpatterns = [
4141
# ...
42-
url(r'^graphql$', GraphQLView.as_view(graphiql=True)),
42+
path("graphql", GraphQLView.as_view(graphiql=True)),
4343
]
4444
4545
(Change ``graphiql=True`` to ``graphiql=False`` if you do not want to use the GraphiQL API browser.)

0 commit comments

Comments
 (0)