I want to use re_path from django.urls, django doc says I can use this from django version 2,
From the error I came to know that I am using django version 2.0.6.
But I am not able to re_path
ImportError at /
cannot import name 're_path'
Request Method: GET Request URL: http://djangosite.com/ Django Version: 2.0.6 Exception Type: ImportError Exception Value:
cannot import name 're_path'
Exception Location: /home/sugushiva/myproject/filope/blogs/urls.py in , line 1 Python Executable: /usr/bin/python3
In main urls.py
from django.contrib import admin
from django.urls import path, re_path,include
urlpatterns= [
path('admin/',admin.site.urls),
re_path('^$', include('blogs.urls'))
]
in blogs.urls
from django.db import re_path
from .models import blogindex
urlpatterns = [
re_path('^$',blogindex)
]