A
A
Alan Kertz2018-02-08 23:57:31
Django
Alan Kertz, 2018-02-08 23:57:31

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

1 answer(s)
A
Alexander, 2018-02-08
@HackerMaster05

urlpatterns = [

Let's open it, okay. Where do we close?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question