Answer the question
In order to leave comments, you need to log in
What is wrong in the code?
Hello! I'm writing a python site and I get an error:
SyntaxError: unexpected EOF while parsing
My code:
from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from news.models import Articles
urlpatterns = [
url (r'^$', ListView.as_view(queryset=Articles.objects.all().order_by("-date")[:20], template_name="news/posts.html")),
url(r'^ (?P\d+)$', DetailView.as_view(model = Articles, template_name = "news/post.html"))
What am I doing wrong? I can't understand everything :(
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question