You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We also need to wire up the root urlconf, in the `tutorial/urls.py` file, to include our snippet app's URLs.
287
287
288
-
from django.conf.urls import url, include
288
+
from django.urls import path, include
289
289
290
290
urlpatterns = [
291
-
url(r'^', include('snippets.urls')),
291
+
path('', include('snippets.urls')),
292
292
]
293
293
294
294
It's worth noting that there are a couple of edge cases we're not dealing with properly at the moment. If we send malformed `json`, or if a request is made with a method that the view doesn't handle, then we'll end up with a 500 "server error" response. Still, this'll do for now.
The `r'^api-auth/'` part of pattern can actually be whatever URL you want to use.
148
+
The `'api-auth/'` part of pattern can actually be whatever URL you want to use.
149
149
150
150
Now if you open up the browser again and refresh the page you'll see a 'Login' link in the top right of the page. If you log in as one of the users you created earlier, you'll be able to create code snippets again.
0 commit comments