enter image description here

want to build blog application following by the tutorials but urls show some import error as cannot import name URLs

from django.contrib import admin
from django.conf.urls import include,url

app_name='blog'
namespace='blog'

urlpatterns = [
    url('admin/', admin.site.urls),
    url(r'^blog/',include('blog.urls',)),

]

1 Answers

0
Willem Van Onsem On

In your comment you wrote:

File "/home/shakil/Downloads/django_project/mysite/blog/urls.py", line 1, in <module>
    from django.conf.urls import urls
ImportError: cannot import name 'urls'

You thus have written a line where you import urls from django.conf.urls, but that module does not export an identifier urls, it however exports url. You thus should import it as:

# /home/shakil/Downloads/django_project/mysite/blog/urls.py

from django.conf.urls import url