Search code examples
pythondjangowebdjango-modelsweb-frameworks

invalid syntax in views.py in Django


The code was working. However, I got this error suddenly :

enter image description here

Even though the name of view and the name of function are same(in this case "addArticle"), I got this error. How can I fix that issue?

Here is what my urls.py contains :

from django.contrib import admin
from django.urls import path
from . import views



app_name = "article"

urlpatterns = [
     path('dashboard/',views.dashboard,name = "dashboard"),
     path('addarticle/',views.addArticle,name = "addarticle"),]

Solution

  • You forgot a close bracket on line 22