From blog.views import (blog_post_detail_page), SyntaxError: invalid syntax

hi I was trying to use run server for my Django app that i have created in my directory that looks like this

I was getting this error during runserver from blog.views import (blog_post_detail_page), SyntaxError: invalid syntax


1-try_django *src *blog *tamplest about.html base.html blog_post_detail.html home.html title .txt *`

#my views looks like:
from django.shortcuts import render

from .models import BlogPost

def blog_post_detail_page(request):
    obj = BlogPost.objects.get(id=1)
    template_name = 'blog_post_detail.html'
    context = {"object": obj}
    return render(request, template_name, context)

#blog models:
from django.db import models

# Create your models here.
class BlogPost(models.Model):
    title = models.TextField()
    content = models.TextField(null=True, blank=True)

#urls :
from django.contrib import admin
from django.urls import path,re_path
from blog.views import (blog_post_detail_page),
from .views import (

urlpatterns = [
    path('', home_page),
    re_path(r'^about/$', about_page),
    path('example/', example_page),
    path('contact/', contact_page),

A Syntax Error usually means that you have a typo. Always firstfully check the line it points to.

from blog.views import (blog_post_detail_page),

In above line you have comma outside tuple. If this is the only thing you are importing from it, then do simple import:

from blog.views import blog_post_detail_page
Back to Top