Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Rest Framework retrieve nested JSONField with filters
I'm working on a Project using Python(3.7), Django(1.11) and DRF(3.6) in which I have to retrieve the data filtered by the JSONField from a nested object. Note: I have searched a lot and find some relative questions, but my question is a bit different, so that's don't mark it duplicated, please! Here's what I have tried so far: From models.py: class MyModel(models.Model): id = models.CharField(primary_key=True, max_length=255) type = models.CharField(max_length=255) obj1 = models.TextField() obj2 = models.TextField() created_at = models.DateTimeField() From serializers.py: class MyModelSerializer(serializers.ModelSerializer): obj1 = serializers.JSONField() obj2 = serializers.JSONField() class Meta: model = MyModel fields = "__all__" From urls.py: url(r'^mymodel/obj1s/(?P<pk>[0-9]+)/$', views.ActorEvents.as_view(), name='get-actor') ** From views.py: class Obj1Obj2(generics.RetrieveAPIView): serializer_class = MyModelSerializer def get_object(self): queryset = MyModel.objects.filter(obj1__id=self.request.data.get('obj1', dict()).get('id'),) obj = get_object_or_404(queryset) return obj and here's the input JSON object: { "id":4055191679, "type":"PushEvent", "obj1":{ "id":2790311, "login":"daniel33", "avatar_url":"a_url" }, "obj2":{ "id":352806, "name":"NAME", "url":"a_url" }, "created_at":"2015-10-03 06:13:31" } and What I want to achieve: It should return the MyModel records by obj1 ID and should be able to return the JSON array of all the MyModel objects where the obj1 ID by the GET request at /mymodel/obj1s/<ID>. If the requested obj1 does not exist then HTTP response code should be 404, otherwise, the response code should … -
Django Postgres Connection Fails with Kubernetes and Docker
I connot connect to my postgres database even though the pod is running succesfully inside my cluster.When I look into the logs of my pod I get a error saying django.db.utils.OperationalError: could not connect to server: Connection timed out Is the server running on host "db" (10.245.61.245) and accepting TCP/IP connections on port 5432? Take a look into my YAML files postgres-service.yaml apiVersion: v1 kind: Service metadata: name: db labels: name: db spec: type : ClusterIP ports: - name: db port: 5432 targetPort : 5432 selector: app: db-deployment postgres-deployement.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: name: db-deployment labels: app: db-deployment spec: replicas: 1 template: metadata: labels: app: db spec: containers: - image: postgres:9.4 name: db ports: - containerPort: 5432 volumeMounts: - name: postgres-db-data mountPath: /var/lib/postgresql volumes: - name: postgres-db-data persistentVolumeClaim: claimName: db-data postgres-volume.yaml kind: PersistentVolume apiVersion: v1 metadata: name: postgres-pv-volume labels: type: local app: postgres spec: storageClassName: manual capacity: storage: 5Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" --- apiVersion: "v1" kind: "PersistentVolumeClaim" metadata: name: "db-data" spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi storageClassName: manual I will add any other file if you want me to -
how to filter objects on the basis of expression
I have a model in which there is a filed result which is dictfield, result has a field name. now my question is how can i use Model.objects.filter(result['name']='somename')? i want all objects in queryset which has result['name'] = 'somename'. models.py class IdleResourcesPerHour(Document): filed1= fields.StringField(max_length=70) filed2= fields.StringField(max_length=70) date_time = fields.DateTimeField(default=datetime.now()) result = fields.DictField() -
Django + Nginx + UWSGi: Upstream timed out 110
I'm deploying a Django App in production using Nginx and uwsgi in CentOS. Things I correctly configured like the testing environment but now I get a 504 Gateway Time-out from my browser Here is my configs: cat /etc/nginx/nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/*.conf; server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:3031; proxy_send_timeout 1200s; proxy_read_timeout 1200s; fastcgi_send_timeout 1200s; fastcgi_read_timeout 1200s; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } } cat /etc/nginx/conf.d/myapp.conf # configuration of the server upstream django { server 192.168.56.100:3031; # for a web port socket (we'll use this first) } server { listen 80; server_name 192.168.56.100; # substitute your machine's IP address or FQDN charset utf-8; access_log /var/log/nginx/access_myapp.log ; error_log /var/log/nginx/error_myapp.log ; # max upload size client_max_body_size 75M; # adjust … -
Process HEAD request in django
I am calling an API.Below is the code. import requests s = requests.session() s.headers.update({ "Authorization": "Bearer %s" % "my-access-token", "Content-Type": "application/json" }) payload = { "name": "My Webhook", "event_type": "response_completed", "object_type": "survey", "object_ids": ["166967900"], "subscription_url": "http://my-ip-address" } url = "https://api.surveymonkey.com/v3/webhooks" s.post(url, json=payload) As soon as i run the above code a HTTP HEAD request hits on my server.Below is the request that i can see on my server. [2019/02/18 14:25:15] HTTP HEAD / 200 [0.04, 64.191.16.134:61913] How should i respond to it? -
Django forms.ModelMultipleChoiceField not saving anything
I have had so many problems with forms.ModelMultipleChoiceField and widget = forms.SelectMultiple I'm hoping someone can put me out of my misery. I'm using the JQuery Chosen multiple select box (similar to Select2) to render out the interest field in the ProfileUpdateForm on the font-end. At first the request.POST was not executing at all, the submit button wasn't clickable and I got the error An invalid form control with name='interest' is not focusable which I have now patched by adding def __init__(self, *args, **kwargs): super(ProfileUpdateForm, self,).__init__(*args, **kwargs) self.fields['interest'].required = False to my ProfileUpdateForm. Although I can now click the submit button and see [2019/02/18 08:26:53] HTTP POST /profile 302 and all other form information updates ...nothing happens to the forms.ModelMultipleChoiceField interest field. If you select an interest then press submit, the SelectMultiple field is empty on page refresh and nothing is stored / saved. I've checked the admin and nothing has updated in that section. What is the best way to proceed to diagnose the problem? forms.py class ProfileUpdateForm(forms.ModelForm): interest = forms.ModelMultipleChoiceField( queryset=Interest.objects.all(), widget = forms.SelectMultiple(attrs={ 'name': "interest", 'data-placeholder': "Choose your interests", 'class': 'chosen-select', 'multiple tabindex': '4', })) def __init__(self, *args, **kwargs): super(ProfileUpdateForm, self,).__init__(*args, **kwargs) self.fields['interest'].required = False class Meta: … -
Django reporting and document creating tool
In summary, problem is in creating some app for my project. This app must have some interface for dealing with reporting from my DB data, by using django<=1.10, Python3.5. Furthermore there must be some interface for working with ODT file format like Appy.POD, Secretary. Can you advice some api for django which provides this features? I checked django-packages already. There are few useful apps: django-report-builder, django-report-tool, but problem is in constraints on my project with django<=1.10 and restframework<=3.4. -
executing python script in django with arguments from the frontend
I want to manipulate the values associated with the entries of a database using a django webapp. I've created the app and I'm currently displaying all the entries and their associated value in a simple table. My idea is simply to create a button, that calls a python script with an argument (the id of that entry) and then changes it from false to true. The problem is, this seems like rocket-science, I've been at this for days now and I just can't get it to work as I have little to no proficiency when it comes to Ajax or Jquery, and all relevant examples I can find don't simply seem to pertain very well to my situation despite how basic it would appear, nor fit with Django 2.0+. I'm using Django 2.1.5 def change_value(idnumber): db_value = get_db_status_value(idnumber) if db_value is True: change_db_entry_status(idnumber, False) else: change_db_entry_status(idnumber, True) my_template.html <table> <thead> <tr> <th> Status </th> <th> Button </th> </tr> </thead> <tbody> { % for entry in entry_data % } <tr> <td> {{ entry.status }} </td> <td> <button type="button">{{ entry.idnumber }}</button> </td> </tr> </tbody> {% endfor %} </table> I simply can't figure out how I can get the change_value function in there … -
No static files on static page in django
I have a static website in django at: domain.com/press/. The page at this address is visible, but there is a problem with static files - they don't appear. Error in console (F12): domain.com/press/%7B%%20static%20'images/presslogo.png'%20%%7D Failed to load resource: the server responded with a status of 400 (Bad Request) My settings in nginx: location /press/ { alias /path_to_templates/; index press.html; } Part of my html code: {% load static %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Press</title> </head> <body> <img src="{% static 'images/presslogo.png' %}"> </body> </html> setting.py STATIC_ROOT = os.path.join(BASE_DIR, 'static') How can I display an image on a static page? -
Django:Pass extra_context to reset_password view and receive the extra_context in given template
I am trying to redirect the password reset view to another template from the url directly as: url(r'^accounts/password/reset/', password_reset, {'template_name':'users/login.html', 'extra_context':{'reset':'1'}, 'post_reset_redirect':'/users/accounts/login'}, name='password_reset'), I have passed a context I need to use in my template. In my 'users/login.html' template, I tried using: console.log('{{reset}}'); But the console does not display anything. Is something missing? Or I am accessing the context in a wrong way? -
JWT authentication in django rest framework
I'm new to django_rest_framework and trying to implement JWT authentication . But there is a problem however I send the token that created by username and password that has been sent but this error fires out. {"detail":"Authentication credentials were not provided."} Generating Token: TOKEN_ENDPOINT = 'http://127.0.0.1:8000/api/auth/token/' user_data = { 'username': 'admin', 'password': 1234 } json_user_data = json.dumps(user_data) user_headers = { 'content-type': 'application/json' } token_response = requests.request('post', TOKEN_ENDPOINT, data=json_user_data, headers=user_headers) token = token_response.json()['token'] Sending new post request with generated token: headers = { 'Content-Type': 'application/json', "Authorization": "JWT" + token, } data = json.dumps({"content": "Hellllllllloooo"}) new_content_req = requests.post(ENDPOINT, data=data, headers=headers) print(new_content_req.text) // {"detail":"Authentication credentials were not provided."} REST_FRAMEWORK Default authentication and permissions: REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.SessionAuthentication', 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', ), 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ) } JWT_AUTH = { 'JWT_ENCODE_HANDLER': 'rest_framework_jwt.utils.jwt_encode_handler', 'JWT_DECODE_HANDLER': 'rest_framework_jwt.utils.jwt_decode_handler', 'JWT_PAYLOAD_HANDLER': 'rest_framework_jwt.utils.jwt_payload_handler', 'JWT_PAYLOAD_GET_USER_ID_HANDLER': 'rest_framework_jwt.utils.jwt_get_user_id_from_payload_handler', 'JWT_RESPONSE_PAYLOAD_HANDLER': 'rest_framework_jwt.utils.jwt_response_payload_handler', 'JWT_ALLOW_REFRESH': True, 'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7), 'JWT_AUTH_HEADER_PREFIX': 'JWT', 'JWT_AUTH_COOKIE': None, } Prefix: 'JWT_AUTH_HEADER_PREFIX': 'JWT', 'JWT_AUTH_COOKIE': None, View: class StatusAPIView(mixins.CreateModelMixin, generics.ListAPIView): permission_classes = [permissions.IsAuthenticatedOrReadOnly] # authentication_classes = [SessionAuthentication] queryset = Status.objects.all() serializer_class = StatusSerializer def post(self, request, *args, **kwargs): return self.create(request, *args, **kwargs) def perform_create(self, serializer): serializer.save(user=self.request.user) -
Can't able to remove fields(but can add new field and save it ) in django formset in updation
I can add new field and update it, but can't able to delete existing and save. I tried but nothing is working. Can anyone please point out the mistake which i had done in my code. views.py instance = Course.objects.get(id=courseid) course = instance instructorled_formset = inlineformset_factory( Course, Instructorled, form=InstructorledForm, extra=0, max_num=1, fields=('field1',) ) scheduleformset = inlineformset_factory( Course, InstructorledSchedule, form=InstructorledScheduleForm, extra=0, fields=('start_date','end_date','hours','time','day',) ) if request.method == 'POST': instructor_form = InstructorledForm(request.POST,instance=instance) schedule_form = InstructorledScheduleForm(request.POST,instance=instance) instructor_formset = instructorled_formset(request.POST,prefix='instructor_formset',instance=instance) schedule_formset = scheduleformset(request.POST,prefix='schedule_formset',instance=instance) if instructor_form.is_valid() and schedule_form.is_valid() and instructor_formset.is_valid() and schedule_formset.is_valid(): item_form = instructor_formset.save( commit=False) for e in item_form: course = course field1 = e.field1 e.save() schedule_form = schedule_formset.save( commit=False) for e in schedule_form: course = course start_date = e.start_date end_date = e.end_date hours = e.hours time = e.time day = e.day e.save() instructor = Course.objects.filter(Q(course_type='Instructor-Led Online Training') | Q(course_type = 'Both')) context = { 'dash_title': 'Instructoe Led course', 'heading' : 'schedule', 'instructor' : instructor, } return render(request, 'lmsadmin/view_instructor_led.html', context) how my form looks like, i want to delete value from model when i click remove and save it -
How can I get the data of the modelform?
I am building a user model and wanna attach it to a modelform as below shown. How can I get the email of each user by shell accessing the mysql database? I have tried these to get the data by shell, but the previous one said the object has no email attribute and the latter one said the forms.py has no object. from Project.User.models import UserProfile as p p.objects.filter(is_active=True).first().email // from Project.User.forms import UserProfile as p p.objects.filter(is_active=True).first().email Code: models.py class UserProfile(BaseModel): user = models.OneToOneField(User, primary_key=True, on_delete=models.CASCADE, verbose_name='client') name = models.CharField('name',max_length=30, null=False, help_text="Name") gender = models.CharField('sex',max_length=1, help_text="Sex") class Meta: verbose_name = 'Client' verbose_name_plural = 'Client' def __str__(self): return 'client:%s' % self.user forms.py class ClientProfileForm(forms.ModelForm): email = forms.EmailField() class Meta: model = UserProfile fields = ("user", "name", "gender") -
Page not found 404 No Blog matches the given query
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/like/?csrfmiddlewaretoken=UJ6I7mm2cjjSXK0MeuOLqm4E7OfMKTKtO461mCAsnTPdXT0UVw1z3JfMqijyIJAM&blog_id= Raised by: blog.views.like_post No Blog matches the given query. I was making a like section for my blog app and this error is displayed below are my views, models and urls files views.py from django.shortcuts import render,get_object_or_404 from django.views.generic import ListView from .models import Blog class BlogsList(ListView): model=Blog template_name='blog/home.html' context_object_name='blogs' ordering=['-date_posted'] def like_post(request): post= get_object_or_404(Blog, id=request.POST.get('blog_id')) post.likes.add(request.user) return HttpResponseRedirect(Blog.get_absolute_url()) models.py from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.urls import reverse class Blog(models.Model): title=models.CharField(max_length=100) content=models.TextField() date_posted=models.DateTimeField(default=timezone.now) author=models.ForeignKey(User, on_delete=models.CASCADE) likes=models.ManyToManyField(User,related_name='likes',blank=True) def __str__(self): return self.title urls.py from django.urls import path from . import views from django.conf.urls import url urlpatterns=[ path('',views.BlogsList.as_view(),name='blog-home'), url(r'^like/$', views.like_post, name='like_post') ] -
How to get submit dropped down value in React and Django?
I am creating an app using Django, React and Redux. I currently have two models and a form component that has two fields. When I look at the state, I get the following error Incorrect type. Expected pk value, received str. The Timesheet model has a foreign key pointing to the JobManagement table. In the form, I am looping through an array of jobs which are created somewhere else in the application. The issue that I want to solve is how to save that JobManagement ID in the Timesheet model when the button is submitted. Django Models class JobManagement(models.Model): name = models.CharField(max_length=100) class Timesheet(models.Model): name = models.ForeignKey( JobManagement, on_delete=models.CASCADE, null=True) totalHours = models.IntegerField() React Component export class TimesheetForm extends Component { state = { name: '', totalHours: '' } static propTypes = { jobManagement: PropTypes.array.isRequired, addTimesheet: PropTypes.func.isRequired } onSubmit = e => { e.preventDefault() const { name, totalHours } = this.state const timesheet = { name, totalHours } this.props.addTimesheet(timesheet) this.setState({ name: '', totalHours: '' }) } onChange = e => this.setState({ [e.target.name]: e.target.value }) render() { const { name, totalHours } = this.state return ( <form onSubmit={this.onSubmit}> <div className="form-group"> <label>Job Management Name</label> <select className="form-control" name="name" onChange={this.onChange} value={name}> {this.props.jobManagement.map(job => ( … -
How to view sqlite database table in Django
There is an embedded database provided by Django for small project purpose. How can I view the table created in that database? This command "python manage.py dbshell" isn't working. PS C:\mysite> python manage.py dbshell CommandError: You appear not to have the 'sqlite3' program installed or on your path. PS C:\mysite> -
Django integration with PHP and Xampp
I want to run one php site and one Django site with the Xampp server. Please let me know how we can run both the site's on Xampp. -
Creating a Post but got an IntegrityError
I'm trying to create a post and update my list of posts. I currently get this error IntegrityError at /posts/create/ NOT NULL constraint failed: posts_post.publish Not sure what the error means and how to fix it. The files below are my posts/views.py. Not sure if I need to add anymore. def posts_create(request): # return HttpResponse("<h1> Create a posts. </h1>") form = PostForm(request.POST or None) if form.is_valid(): instance = form.save(commit=False) instance.user = request.user instance.save() context = { "form": form } # if request.method == "POST": # print("This is the content: ", request.POST.get("content")) return render(request, "post_form.html", context) def posts_detail(request, id): instance = get_object_or_404(Post, id=id) context = { "user": instance.user, "instance": instance } return render(request, "posts_detail.html", context) def posts_list(request): # return HttpResponse("<h1> List a posts. </h1>") # TODO: Privacy stuff queryset = Post.objects.all() context = { "object_list": queryset, "user": "username" } return render(request, "post.html", context) Models for post: user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) status = models.CharField(max_length=6, choices=Status, default=POST) content = models.TextField() publish = models.DateField(auto_now=False, auto_now_add=False) updated = models.DateTimeField(auto_now=True, auto_now_add=False) timestamp = models.DateTimeField(auto_now=False, auto_now_add=True) privacy = models.IntegerField(choices=Privacy, default=PUBLIC) unlisted = models.BooleanField(default=False) This is the post_form.html <html> <body> <h3>Create Post</h3> <form method="POST" action=""> {% csrf_token %} {{ form.as_p }} <input type="submit" value="Share" /> </form> </body> </html> -
Rename Fields of Model in Serializer and Form - Django
I want to change field names. In my model field name start with prefix timesheet. And when i am using api i have to use that timesheet prefix. I want to remove that prefix instead keep jobs, clock_in_date, clock_out_date.... How can i rename field names so that when i am send data from api body should contain names without timesheet prefix class TimesheetSerializer(serializers.ModelSerializer): timesheet_hours = TimesheetHourSerializer(many=True, read_only=True) class Meta: model = TimesheetEntry fields = [ 'id', 'timesheet_jobs', 'timesheet_clock_in_date', 'timesheet_clock_in_time', 'timesheet_clock_out_date', 'timesheet_clock_out_time', 'timesheet_note', 'timesheet_hours', ] -
How to connect a checkbox in my HTML with my model User?
When user is being registered I want him to check a checkbox if he is from an access challenge area. If user checks 'access challenge area' checkbox I want to show only his email address and hide his city name and address. I added a field access_challenge = BooleanField(default = False) in my User model. I created a checkbox in my registration html template. And in my other html where the list of the posts I did: {% if user.access_challenge %} <p> {{ post.email }} </p> {% else %} <p> {{ post.country }} </p> <p> {{ post.city }} </p> <p> {{ post.address }} </p> <p> {{ post.email }} </p> my models.py from PIL import Image from django.db import models from django.urls import reverse from django.utils import timezone from django.db.models.signals import post_save from django.contrib.auth.models import AbstractUser class User(AbstractUser): first_name = models.CharField(verbose_name="First name", max_length=255) last_name = models.CharField(verbose_name="First name", max_length=255) country = models.CharField(verbose_name="Country name", max_length=255) city = models.CharField(verbose_name="City name", max_length=255) email = models.EmailField(verbose_name="Email", max_length=255) access_challenge = models.BooleanField(default=False) def __str__(self): return self.username class Post(models.Model): title = models.CharField(max_length=255) country = models.CharField(max_length=255) city = models.CharField(max_length=255) address = models.CharField(max_length=255) email = models.EmailField(max_length=255) phone = models.CharField(max_length=255) website = models.URLField(max_length=255) date_posted = models.DateTimeField(default=timezone.now) author = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): … -
Optimization of repeated process in django rest framework and pandas
Scenario: I am working on django and django rest framework, handling data in pandas dataframe. on front end, there are functions, which can be applied on same data. User can apply first function, then dataset will change according to function applied and then user can apply another function and so on.. on back end. I keep all functions in order. loop over it and give response. My issue is, I am doing whole process from first to last function every time, which is making my process slow. Is there a good way to keep state and process only last function. ?? -
Searching and filtering on elasticsearch vs searching on elasticsearch and filtering on postgres
We use both elasticsearch and postgres in our stack. My lead believes that it is better to perform the text search on elasticsearch and get ids of the hits. Then, fire an "IN" query and filter on postgres. Eg:- a = es.search({params})//returns a list of ids(pks) b = Dummy.objects.filter(id__in=a).filter({params}) I believe that it is unnecessary when we can do everything on elasticsearch. Which approach would be faster? -
How to change default 'username' in django-graphql-jwt
query tokenAuth in django-graphql-jwt requires two fields: username and password, but I want to use phone or email instead of username. Do I have to change source code of library? -
Setup an existing django docker project in my locale machine
I have a django project in github from my client. That project developed by using below technologys: AWS EC2 Docker Drone And inside the poject i have a docker-compose file and a .drone.yml file. But the prolem is how can i start developing the project in my locale machine. I have downloaded the project, and i can run it but i cann't manage the docker and drone. So can you please help me to setup my project with docker and drone. I'm spending a lot's of time. -
Creating a social media feed
Currently trying to make a social application. I created two apps home and posts. My post app will handle all functionality for creating, deleting a post, list of posts. My home app is my homepage which would display all posts, for example similar to a facebook's homepage. Home app currently authenticates users and what not. I created a templates folder that in my root directory to make it easier to separate front-end from back-end. I want to use the templates from the post.html and include them on host.html page. Not sure how to go out about doing this. I'm not sure if template inheritance is the right way to go about doing this. Or if my problem is because of multiple renders to the same template. Hope this isn't too overwhelming with information Summarize Problem: home.html does not display the objects from the post/views.py specifically posts_list(request). This is the basic structure of my app. --Home_app --_views.py --posts_app --_views.py --templates --home.html --posts.html This is my templates/home.html I want to put the posts_list(request) from posts/views.py on here. I tried using includes but that did not work. <html> <body> <h1>Homepage</h1> {% if user.is_authenticated %} <h1>What's on your mind, {{ user }}</h1> #{% include …