Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django let's you go back after logout and see the previous pages
I just noticed that, in Firefox, if you go back to the previous pages after logging out, you are still able to see the pages you navigated. As soon as you click to another page you are asked to login, but if you don't click anything you are able to navigate the pages you used while logged in. Has anyone seen this behaviour and was able to solve it? -
Using environment variables for mysql database password and host throws errors
I'm trying to set up a mysql database and secure sensitive information in an .env file. I was able to successfully store the database NAME, but using environment variables for the PASSWORD and HOST throws two different errors: Error for PASSWORD: Exception Type: OperationalError at / Exception Value: (1045, "Access denied for user 'studio413'@'10.0.0.32' (using password: NO)") Error for HOST: AttributeError at / 'NoneType' object has no attribute 'startswith' Putting the actual PASSWORD and HOST directly into the settings.py works perfectly, and I believe I've properly set up the environment variables, as the database NAME works fine. Typing echo $DATABASE_PASSWORD and echo $DATABASE_HOST into my console yields the correct information from my .env file. I'm using PythonAnywhere and followed the instructions for setting up environment variables here: https://help.pythonanywhere.com/pages/environment-variables-for-web-apps/ If it helps, here is my settings.py file: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'studio413$default', 'USER': os.getenv("DATABASE_USER"), 'PASSWORD': os.getenv("DATABASE_PASSWORD"), 'HOST': os.getenv("DATABASE_HOST"), } } If anyone could help me solve this, I would greatly appreciate it! Note: I tried providing the full traceback for each error, but stackoverflow would not let me post them (it thought I was posting spam). -
Testing multiple viewport sizes with Django/Selenium
I'm trying to test characteristics of certain UI elements given different viewport sizes and media defined in CSS. I have a setup function to instantiate a headless Chrome browser with I believe a default viewport size of 800x600: class NewDesktopVisitorTest(StaticLiveServerTestCase): def setUp(self): self.chrome_options = Options() self.chrome_options.add_argument('--headless') self.browser = webdriver.Chrome(options=self.chrome_options) This works well for testing what I would consider the desktop version of a page, but I'd also like to make sure the mobile version renders as I'd expect. I can create a completely separate class with a different setup and specify the viewport size like so: class NewMobileVisitorTest(StaticLiveServerTestCase): def setUp(self): self.chrome_options = Options() self.chrome_options.add_argument('--headless') self.chrome_options.add_argument('--window-size=375,800') self.browser = webdriver.Chrome(options=self.chrome_options) This has the benefit of very cleanly showing where a given test is failing (i.e. desktop or mobile). The trouble is that I want the exact same tests to run against both (and potentially multiple) viewport sizes, and I don't want to have to maintain the exact same tests in multiple classes. Most of my searches for parameterized testing yield solutions for running the same tests against different data sets, but I've yet to find examples of solutions for setting up and running the same tests against multiple starting configurations. I'm hesitant … -
Have to use model name instead of field name when queriyng ManyToManyField from django model
I have the following model: class ShoppingList(models.Model): name = models.CharField(max_length=100, default='Main') owners = models.ManyToManyField(User, through='ListOwner') class ListOwner(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) shopping_list = models.ForeignKey(ShoppingList, on_delete=models.CASCADE) is_main_owner = models.BooleanField(default=False) Next, I'm trying to query ShoppingList for the current user. I used this https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships as an example. I expected that right way to do it is to use this construction: @login_required def index(request): shopping_list = ShoppingList.objects.filter(owners__user=request.user)\ .order_by('id').first() # something else but in this case, I get an error: Related Field got invalid lookup: user Everything works fine if use listowner instead of owner in filter() function like this: shopping_list = ShoppingList.objects.filter(listowner__user=request.user)\ .order_by('id').first() Can anybody please explain to me why the first one isn't working (while it is recommended to use it in Django documentation)? -
Integration with paypal redirect issue
I am integrating paypal with my openedx ironwood install. To implement ecommerce capabilities - openedx ironwood uses django oscar shopping cart. It works to the point where one can enter their credit card information and submit the form. However after submitting the form the following error occurs and this is the corresponding address in the address bar: https://http/payment/paypal/execute/?paymentId=PAYID-LZWTHVY60U970153W662623L&token=EC-45D081042G524235T&PayerID=UBRT2SFRKASXL Any idea on how I can fix this? -
Extending UserCreationForm new field doesn't appear in admin pannel
I am adding a new field to django UserCreationForm. Everything is working fine - I can see the new fields in the html form but when I open django admin panel the new field is not there. Any ideas what am I missing? forms.py from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm class UserSignupFrom(UserCreationForm): email = forms.EmailField() first_name = forms.CharField(max_length=200) last_name = forms.CharField(max_length=200) is_worker = forms.BooleanField(required=False) class Meta: model = User fields = ['username', 'email', 'first_name', 'last_name', 'is_worker', 'password1', 'password2'] views.py from django.shortcuts import render from django.http import HttpResponse from .forms import UserSignupFrom from django.contrib import messages def sign_up(request): if request.method == 'POST': form = UserSignupFrom(request.POST) if form.is_valid(): form.save() messages.success(request, 'account was created') else: form = UserSignupFrom() return render(request, 'login/sign_up.html', {'form': form})``` if you need to see some other files please let me know! -
Wagtail CMS not rendering navigation icons/images
I've recently taken over working on a Django/Wagtail app that has a few bug that needs fixing. One of which is the icons/images in the CMS are not displaying in the menus and throughout the entire CMS, which is making navigation confusing for the users. Anyone have insights as to why fonts etc are loading, but not the icons (see image below for one example) Wagtial CMS Rendering Issue -
How do I pass a boolean for each post in my function view?
My views.py def problems_list(request): queryset = Post.objects.filter(created__range=['2020-03-01', '2020-03-31']) def is_liked(self): is_liked = False if self.likes.filter(user=request.user.username).exists(): is_liked = True return is_liked context = { 'posts': queryset, 'is_liked': is_liked } return render(request, 'main/problem.html', context) I want each post to have a variable is_liked that is True or False so that I can pass it in my html. -
Is there are difference between working with Django vs Django on Anaconda
I am learning Django and I saw that you can install it regularly, according to the Django documentation. But I also saw that you can work with it in Anaconda. Is there a difference in developing? Or is it all just the same. Thanks -
how to customize django jwt graphql authentication
Hi I'm trying to customize jwt graphql Django default authentication I need to achieve log in with username or email normal Django we customized authentication backend. mutation{ tokenAuth(username:"myemail@email.com" password:"pass") { token } } Authenticate with username mutation{ tokenAuth(username:"myname" password:"pass") { token } } the normal username is working fine. how I can authenticate the user by username or email in jwt graphql I tried this link https://django-graphql-jwt.domake.io/en/latest/customizing.html I don't get any idea about that... Does anyone have any idea about that?? -
How to build Bootstrap collapse (dropdown) plugin in Django-CMS 3.x?
Building plugins in Django-CMS 3.x is wonderfully documented. It would be awesome if I was able to drag some of my custom plugins and nest them into a dropdown (Bootstrap 4 Collapse). Initially, I figured I could just have a placeholder in a custom model and drag other plugins into that placeholder. But that doesn't fly. Anyone have a suggestion on how to get this done? -
CORS fonts Issue Google Cloud Storage with Django application
I just deployed a Django app, using Django Storages which is connected to a Google Cloud bucket of mine. But I am getting these CORS errors in my console (** resembles my domain, just removed it for safety): Access to font at 'https://storage.googleapis.com/**_static/static/css/fontawesome/webfonts/fa-solid-900.woff2' from origin 'https://**.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. GET https://storage.googleapis.com/**_static/static/css/fontawesome/webfonts/fa-solid-900.woff2 net::ERR_FAILED Access to font at 'https://storage.googleapis.com/**_static/static/css/fontawesome/webfonts/fa-solid-900.woff' from origin 'https://**.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. GET https://storage.googleapis.com/**_static/static/css/fontawesome/webfonts/fa-solid-900.woff net::ERR_FAILED Access to font at 'https://storage.googleapis.com/**_static/static/css/fontawesome/webfonts/fa-solid-900.ttf' from origin 'https://**.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. GET https://storage.googleapis.com/**/static/css/fontawesome/webfonts/fa-solid-900.ttf net::ERR_FAILED I followed this SO post and answer: https://stackoverflow.com/a/39758208/10938976 Settings the CORS rules for my bucket like this: [ { "origin": ["*"], "responseHeader": ["Content-Type"], "method": ["GET"], "maxAgeSeconds": 3600 } ] But it does not fix my problem, even after recollecting all my static files, I still get the same error. What is going wrong? -
Django Choice Field initial value ignored when form is rendered
I'm running into an issue where I set the initial value on a Choice field for County but when I render the form, the corresponding option doesn't render as selected. I can't figure out why this isn't working. Does anyone have any ideas? Models.py class State(models.Model): name = models.CharField(max_length=30, db_index=True) abbreviation = models.CharField(max_length=2, unique=True, db_index=True) class County(models.Model): name = models.CharField(max_length=30, db_index=True) state = models.ForeignKey(State, on_delete=models.CASCADE) Forms.py class MyForm(forms.Form): state = forms.ChoiceField(choices=[], required=False) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) county = kwargs.get('county') state_qs = State.objects.all().values('id', 'name', 'abbreviation') state_choices = [ (choice['id'], f"{choice['name']} ({choice['abbreviation']})") for choice in state_qs] self.fields['state'].choices = [('', '---------')] + state_choices county_qs = County.objects.select_related('state').filter(state__id=state).order_by( 'name').values('id', 'name', 'state', 'state__abbreviation') county_choices = [ (choice['id'], f"{choice['name']}-{choice['state__abbreviation']}") for choice in county_qs] initial = None if county: initial = county.id self.fields['county'] = forms.ChoiceField(choices=county_choices, initial=initial) -
What is the propper way to handle certain CRUD exceptions in Django
I have these models. class Brand(models.Model): account = models.ForeignKey(Account, on_delete=models.CASCADE, null=False) name = models.CharField(max_length=100, null=False, blank=False) class Ingredient(models.Model): account = models.ForeignKey(Account, on_delete=models.CASCADE, null=False) brand = models.ForeignKey(Brand, on_delete=models.CASCADE, null=False) name = models.CharField(max_length=100, null=False, blank=False) cost = models.DecimalField(max_digits=14, decimal_places=2, null=False) class Meta: unique_together = ['account', 'brand', 'name'] So sometimes a name for the same brand and account might be repeaten. Should I handle these constraint exceptions in views, in forms? What is the more clean way to do it? Django is really versatile and you can do things in many different ways. -
Django - ModuleNotFoundError
I'm trying to import a python file from another python file in Django. There is a function I want to call from the other file, but every time I import the file I get an error. Traceback (most recent call last): File "ams/faces-train.py", line 6, in <module> from ams.conn import conn ModuleNotFoundError: No module named 'ams' Could someone kindly tell me what the problem is?? I have tried everything but I have not been able to fix it, does anyone know have a work around to this problem?? -
Python & Django tips
I am starting a new project, which would teach math online, I want to build a web based (probably django) app, which would include videos, interactive excersises and online store, where you can purchase the online course. I have experience with coding, just not in this field. I am hoping you could give me some tips on what resources should I use to learn, and if I can build this app purely in django, or if there is a better option, Sorry if this question is too broad, I honestly just don't know where to start. Thank you -
UNIQUE constraint failed: user_profile.StudentID error
I am getting this error(IntegrityError at /register/) every time I try to create a new user. In user creation form I am creating both User and profile. here is my models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) StudentID = models.CharField(max_length=8,unique=True) Branch = models.CharField(max_length=255,choices=Departments,default="CSE") YearOfStudy = models.IntegerField(default=1) ContactNumber = PhoneField(help_text='Contact phone number') image = models.ImageField(default='default.jpeg' , upload_to='profile_pics') parentsContactNumber = PhoneField(help_text="Parent's phone number") def __str__(self): return f'{self.user.username} Profile' here is forms.py class UserRegisterForm(UserCreationForm): email = forms.EmailField() first_name = forms.CharField() last_name = forms.CharField() class Meta: model = User fields = ['username','email','first_name','last_name','password1','password2'] class ProfileCreationForm(forms.ModelForm): class Meta: model = Profile fields = ['StudentID','Branch','YearOfStudy','ContactNumber'] here is views.py def register(request): if request.method == 'POST': form = UserRegisterForm(request.POST) form1 = ProfileCreationForm(request.POST) if form.is_valid() and form1.is_valid(): form.save() form1.save() username = form.cleaned_data.get('username') messages.success(request, f'Your account has been created! You are now able to log in') return redirect('login') else: form = UserRegisterForm() form1 = ProfileCreationForm() context = { 'form': form, 'form1': form1 } return render(request, 'user/register.html', context) here is register.html {% block content %} <div class="content-section"> <form method="POST"> {% csrf_token %} <fieldset class="form-group"> <legend class="border-bottom mb-4">JOIN TODAY</legend> {{ form|crispy }} {{ form1|crispy }} </fieldset> <div class="form-group"> <button class="btn btn-outline-info" type="submit">Sign Up</button> </div> </form> </div> {% endblock content %} please help me … -
i am trying to add functionality like/dislike without page refresh in django
i am trying to add functionality like/dislike without page refresh but i can not set the logic here is my models.py file code from django.db import models # Create your models here. class EmployeeDetail(models.Model): emp_fname = models.CharField(max_length=50, default="") emp_lname = models.CharField(max_length=50, default="") emp_uname = models.CharField(max_length=100, default="") emp_email = models.EmailField(max_length=254, default="") emp_password = models.CharField(max_length=100, default="") emp_dob = models.DateField(max_length=50, default="") emp_doj = models.DateField(max_length=50, default="") emp_designation = models.CharField(max_length=100, default="") emp_salary = models.IntegerField() emp_leaves = models.IntegerField() emp_contact = models.CharField(max_length=12, default="") emp_photo = models.ImageField(upload_to="employee/images", default="") def __str__(self): return self.emp_fname class Post(models.Model): emp_id = models.ForeignKey(EmployeeDetail, on_delete=models.CASCADE) title = models.CharField(max_length=255) slug = models.CharField(max_length=150) content = models.TextField() author = models.CharField(max_length=15) timeStamp = models.DateTimeField(auto_now_add=True) likes = models.IntegerField(default=0) dislikes = models.IntegerField(default=0) def __str__(self): return self.title + ' by ' + self.author class Preference(models.Model): user_id = models.ForeignKey(EmployeeDetail, on_delete=models.CASCADE) post_id = models.ForeignKey(Post, on_delete=models.CASCADE) value = models.IntegerField() date = models.DateTimeField(auto_now_add=True) def __str__(self): return str(self.user_id) + ':' + str(self.post_id) + ':' + str(self.value) and my urls.py code blow here from django.urls import path from .import views urlpatterns = [ path('', views.login, name='Login'), path('logout', views.logout, name='Logout'), path('employee/home/', views.home, name='Home'), path('employee/manageuser/', views.manageuser, name='manageuser'), path('employee/blank/', views.blank, name='blank'), path('employee/font_awesome/', views.font_awesome, name='fontawesome'), path('employee/map_google/', views.map_google, name='map google'), path('employee/not_found/', views.not_found, name='map google'), path('employee/register/', views.register, name='Registration'), path('employee/employee_profile/<int:id>', views.employee_profile, name='Employee Profile'), path('employee/delete_employee/<int:id>', views.delete_employee, … -
upload_to attribute is being overwritten by unknown source
upload_to attribute is being overwritten and I have no idea what's causing this, instead of uploading a file I'm getting a SuspiciousFileOperation exception. The base path component stated in the exception is correct but joined path is not correct as it should be just 'img/posts'. models.py thumbnail = models.FileField(upload_to='img/posts') Exception value The joined path (/media/tb1.jpg) is located outside of the base path component (/home/user/Documents/project/project/media) -
how can I host my django app on Godaddy dedicated server (delux)?
I Have no idea how to set things up on this fresh centOS 7 server, how to host my django app with postgre db in this server? -
Django REST Framework - Serializer don't see field
I want create User, which hold Foreign Key to his Country. Obviously I want to make it required field. But when I send POST request without 'country' field, DRF Serializer doesn't throw an error. Nowhere in the code have I allowed the field to be empty, it's the same as the rest. I took a step further, and in the create() method of my ModelViewSet I decided to print serializer.validated_data class UserViewSet(ModelViewSet): serializer_class = UserSerializer queryset = User.objects.all() permission_classes = [] def create(self, request, format=None): serializer = self.get_serializer(data=request.data) if serializer.is_valid(): print(serializer.data) I send following POST request: And my serializer.validated_data value was: OrderedDict([('password', 'test1231112'), ('first_name', 'Jarosław'), ('last_name', 'Psikuta'), ('phone', '2999111331'), ('email', 'rweww@gmail.css'), ('description', 'fajny uzytkownik'), ('address', 'Mieszka 3/4'), ('date_of_birth', datetime.date(1997, 10, 13))]) I realised that serializer just don't see my country field. I already write some code to check if my country field exist: country_code = request.data.get('country', None) if not country_code: return Response({'country': 'This field is required'}, status=status.HTTP_400_BAD_REQUEST) but I know that's wrong approach. It's additional code, and actually serializer should do that work for me. Here You have rest of my code: serializers.py class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = '__all__' read_only_fields = ('id', 'last_login', 'is_superuser', 'is_staff', 'is_active','date_joined', … -
view doesn't show list
separate index from list and create, but now When I create a product it doesn't list and doesn't show the edit and update buttons. the create extends view of index. this is index.html <!DOCTYPE html> <html><head> <title>Mis Productos</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> </head><body> <div class="container text-center pt-5"> <h1>Hola</h1> <p>Inventario de productos</p> <div class='jumbotron'> <center> <div class="text-left" style="max-width:500px"> <form action="{% url 'index' %}" method="post"> {% csrf_token %} {% for field in register_form %} <div class='form-group'> <label for="{{ field.name }}">{{ field.label }}</label> {{ field }} </div> {% endfor %} <br> <center><a href="{% url 'create' %}" class="btn btn-success btn-lg">Registrar producto</a></center> </form> </div> {% block content %} </center> <br> <table class="table table-striped table-bordered"> <thead class="thead-dark"> <tr> <th>#</th> <th>Nombre</th> <th>Telefono</th> <th>Fecha de nacimiento</th> <th>Email</th> </tr> </thead><tbody> {% for producto in productos %} <tr> <td>{{ producto.id }}</td> <td>{{ producto.nombre }}</td> <td>{{ producto.precio }}</td> <td>{{ producto.fecha_de_vencimiento }}</td> <td>{{ producto.codigo_barras }}</td> <td><a href="update/{{producto.id}}" class="btn btn-info" id = '{{producto.id}}'>edit</a></td> <td><a href="delete/{{producto.id}}" class="btn btn-danger" id = '{{producto.id}}'>delete</a</td> </tr> {% endfor %} </tbody> </table> </div> </div> </div><script src="https://code.jquery.com/jquery- 3.3.1.slim.min.js" integrity="sha384 -q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jiz o" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/um d/popper.min.js" integrity="sha384- ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"> </script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/boot strap.min.js" integrity="sha384- ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULT y" crossorigin="anonymous"></script> {% endblock %} </body> </html> this is create.html {% extends 'producto/inicio.html' %} {% … -
django - adding an if-statement to a method
I hope you are well! I am trying to create my first Django app, however, I am having issues. Please see my code below: from django.db import models # Create your models here. class Topic(models.Model): ###A topic the user is learning about### text = models.CharField(max_length=200) date_added = models.DateTimeField(auto_now_add=True) def __str__(self): ###Return a string representation of the model### return self.text class Entry(models.Model): ###Something specific learned about a topic### topic = models.ForeignKey(Topic, on_delete=models.CASCADE) text = models.TextField() date_added = models.DateTimeField(auto_now_add=True) class Meta: verbose_name_plural ='entries' def __str__(self): ###Return a string representation of the model.### return f"{self.text[:50]}..." The last method: 'def__str__(self):' adds an ellipsis to all entries. I am being asked to add an 'if-statement' which would only add an ellipsis to entries longer than 50 characters and all entries which are shorter than 50 characters should be without an ellipsis. Please help - thanks in advance! -
Django reverse db lookup for multiple objects
Let's say I have a model called TicketSection and TicketSubmission the models look like this: (simplified) class TicketSection(models.Model): title = models.CharField(max_length="35") weight = models.IntegerField() class TicketSubmission(models.Model): ticket_section = models.ForeignKey('myapp.TicketSection') cost = models.IntegerField() submiter = models.ForeignKey('myapp.User') submiting_account = models.ForeignKey('myapp.Account') Now I want to filter TicketSections with it's TicketSubmissions. So I do: ticket_sections = TicketSection.objects.filter(weight__gte=50).annotate(some_additional_logic) I know you can select reverse objects by ticket_sections[0].ticketsubmission_set.filter(again_some_logic).annotate(logic) But how do I do it for all ticket sections and how do I use it in template? Should I do: for ticket_sec in ticket_sections: ticket_sec.submissions = ticket_sec.ticketsubmission_set.filter(again_some_logic).annotate(logic) and then in template {% for ticket_sec in ticket_section %} {% for submission in ticket_sec.submissions %} {{ submission.cost }} ^ But that doesn't seem like the right way for me. So how should I reverse lookup for multiple objects to minimalize database hits? I'm using Django 2.2.5 with MySQL database. -
Django telling me template doesn´t exist
Can anybody tell me why django is telling me that template does not exist? I would like to go from the film_detail.html to film_report.html, when clicking on the "report"-button... views.py class FilmReport(LoginRequiredMixin, UpdateView): model = Report fields = ["comment", "reporter", "reports"] # def __str__(self): # return self.title def form_valid(self, form): form.instance.author = self.request.user return super().form_valid(form) urls.py app_name = 'watchlist' urlpatterns = [ path("", views.films_view, name="board-home"), path("film/add", FilmAddView.as_view(), name="film-add"), path("film/<int:pk>/", FilmDetailView.as_view(), name="film-detail"), path("film/<int:pk>/report", FilmReport.as_view(), name="film-report") ] film_detail.html {% extends "board/base.html" %} {% block content %} <article class="media content-section"> <img class="rounded-circle film-img" src="/media/{{object.poster}}"> <!-- Mulighet for å ha en "add review"-knapp på siden der hvor filmene vises. --> <a href=" {% url 'watchlist:film-add' %}" class="waves-effect waves-light green btn"><i class="material-icons right">rate_review</i>add review</a> <a href=" {% url 'watchlist:film-report' film.id%}" class="waves-effect waves-light red darken-4 btn"><i class="material-icons right">report</i>report</a> <div class="media-body"> <h2 class="film-title">{{ object.title }}</h2> <p class="film-plot">{{ object.plot }}</p> </div> </article> {% endblock content %} film_report.html {% extends "board/base.html" %} {% block content %} <h2>Film report</h2> <!-- <article class="media content-section"> <img class="rounded-circle film-img" src="/media/{{object.poster}}"> <div class="media-body"> <h2 class="film-title">{{ object.title }}</h2> </div> </article> --> {% endblock content %}