Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Display user`s protrait from model in template in django
I want to display the the user protrait of the user in the templates. models.py class Profile(models.Model): user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) date_of_birth = models.DateField(blank=True, null=True) photo = models.ImageField(upload_to='user/%Y/%m/%d/', blank=True) views.py @login_required def dashboard(request): # Display all actions by default actions = Action.objects.exclude(user=request.user) following_ids = request.user.following.values_list('id', flat=True) if following_ids: # If user is following others, retrieve only their actions actions = actions.filter(user_id__in=following_ids) actions = actions.select_related('user', 'user__profile')\ .prefetch_related('target')[:10] return render(request, 'account/dashboard.html', {'section': 'dashboard', 'actions': actions}) tempate: <img src="{{ Profile.photo.url }} " height="40" width="40"/> -
How to resolve django admin error with 302 problems?
I am continuously getting error while trying to log in to django admin page. Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). December 07, 2019 - 13:53:40 Django version 3.0, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. Not Found: / [07/Dec/2019 13:53:42] "GET / HTTP/1.1" 404 2027 [07/Dec/2019 13:53:47] "GET /admin HTTP/1.1" 301 0 [07/Dec/2019 13:53:47] "GET /admin/ HTTP/1.1" 302 0 [07/Dec/2019 13:53:47] "GET /admin/login/?next=/admin/ HTTP/1.1" 200 1913 [07/Dec/2019 13:53:47] "GET /static/admin/css/login.css HTTP/1.1" 200 1233 [07/Dec/2019 13:53:47] "GET /static/admin/css/base.css HTTP/1.1" 200 16378 [07/Dec/2019 13:53:47] "GET /static/admin/css/responsive.css HTTP/1.1" 200 18052 [07/Dec/2019 13:53:47] "GET /static/admin/css/fonts.css HTTP/1.1" 200 423 [07/Dec/2019 13:53:47] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 85692 [07/Dec/2019 13:53:47] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 85876 [07/Dec/2019 13:53:59] "POST /admin/login/?next=/admin/ HTTP/1.1" 302 0 And after this it is automatically closing. -
Django template object not showing
So I've come across this weird thing. I can't pass data within the template unless it's within the forloop. for example.. I can pretty much print a variable just within a for loop but something outside a forloop is not showing up. {{listings.make}} <<<< This isn't printing {% for listing in listings %} <p>{{listing.make}}</p> <<<< This is printing {% endfor%} def search(request): queryset_list = Vehicle.objects.all() context = { 'listings': queryset_list } return render (request, 'mainapp/new_listing.html', context) class Vehicle(models.Model): year = models.CharField(max_length=4, choices=YEAR) make = models.CharField(max_length=50, default="") model = models.CharField(max_length=50, default="") version = models.CharField(max_length=50, default="") description = models.TextField(max_length=50, default="") def __str__(self): return self.make Any idea what is going on actually. As you can see I m using a function-based view. Thank you -
Comparing value from html to context
I need to compare a value (variable) extracted from a page to context. For example: Color is a dropdown selection. $(document).ready(function(){ $("#color").change(function() { var selected_color = $(this).val() ; {% if context_value == selected_color %} .. do something {% endif %} }); Is this possible ? If not, is there some solution for such case ? -
How can update many_to_many relational fields with bulk_update() method in Django?
How can I update many_to_many fields with the bulk_update method in Django? Code: get_user_model().objects.using('default').bulk_update( User.objects.using('default').all(), ('password','groups') ) Error: {ValueError}bulk_update() can only be used with concrete fields. -
How to display Django BooleanFields selected true in template?
everyone! I created a model object. This object has several boolean fields. # models.py class TeamCharacteristic(models.Model): team = models.ForeignKey('Teams',on_delete=models.CASCADE) power1 = models.BooleanField(null=True, blank=True) power2 = models.BooleanField(null=True, blank=True) power3 = models.BooleanField(null=True, blank=True) power4 = models.BooleanField(null=True, blank=True) power5 = models.BooleanField(null=True, blank=True) class Meta: verbose_name = 'Team style' verbose_name_plural = 'Teams style' def __str__(self): return "{} 's style".format( self.team, ) Some of them are right and others are wrong. I want to show only the fields that have the correct value in the template. How can I do this in a shorter way instead of checking each field individually? # views.py from django.shortcuts import render, get_object_or_404 from .models import Matches from denemee.apps.home.models import TeamCharacteristic def matches_details(request, page_id=None, team=None, **kwargs): m_detail = get_object_or_404(Matches, id=page_id) home_team_chr = get_object_or_404(TeamCharacteristic, team=m_detail.h_team) away_team_chr = get_object_or_404(TeamCharacteristic, team=m_detail.a_team) payload = { 'm_detail': m_detail, 'home_team_chr': home_team_chr, 'away_team_chr': away_team_chr } return render(request, 'match_detail.html', payload) -
Working with autofield and unique_constraint Django
My models.py of class app: Teacher and StudentInfo will store their respective details. from form.models import StudentInfo from teacherform.models import Teacher class ClassRoom(models.Model): standard = models.CharField(max_length=50) section = models.CharField(max_length=50) teacher = models.OneToOneField(Teacher, on_delete = models.CASCADE) class ClassRoomStudent(models.Model): classRoom = models.ForeignKey(ClassRoom, on_delete=models.CASCADE) rollNumber = models.AutoField() student = models.OneToOneField(StudentInfo, on_delete=models.CASCADE) I want to auto increment 'rollNumber' when I add new row to my ClassRoomStudents, but if the student is from different class then rollNumber count should reset it should start again. As different students can have the same roll number if they are from different classrooms. I am aware of unique constraint. But even after unique_constraint I am still not sure how my rollNumber will increment of different classrooms. Like won't it be continuosly incrementing the rollNumber number which will obviously be unique for different or same class ? -
Is there any way to filtering the queryset dynamicaly in django forms for a foreignkey correct?
I am creating a form for this model class SemAssign(models.Model): staff = models.ForeignKey(User, on_delete=models.CASCADE) semester = models.ForeignKey(Subject, on_delete=models.CASCADE, default=1) def __str__(self): return f'{self.staff.username}' and my forms.py looks like class SemAssignForm(forms.ModelForm): class Meta: model = SemAssign fields = ['staff','semester'] And i made a queryset based on a user-defined filter as in my views.py def assign_sem(request): if request.user.is_staff: dept = request.GET.get('department') sem = request.GET.get('semester') form=SemAssignForm(request.POST) #form.fields['staff'].queryset = User.objects.filter(is_staff=True, profile__Department=dept) #form.fields['semester'].queryset = Subject.objects.filter(sem=sem) if form.is_valid(): SemAssign=form.save() return redirect('dashboard') When the query works perfectly the form is validated as wrong. And if i don't make query the form is validated successfully. I'm sure i missing somewhere in querying the foreignkey set. Can anyone sought me that? My friend suggested me with modelformset, but that is not my scope. I just want to filter the fields of SemAssign models based on a GET request filter. -
How can add multiple database for tests in Django tests
Question: How can I add multiple databases for testing in Django? When I ran my test suits I got this Error: AssertionError: Database queries to 'mig' are not allowed in this test. Add 'mig' to path_to_test_suit.MigrationServiceTest.databases to ensure proper test isolation and silence this failure. Here are my PostgreSQL settings: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'db_1_name', 'USER': 'db_1_user', 'PASSWORD': 'db_1_passwd', 'HOST': 'db_1_host', 'PORT': 'db_1_port', }, 'mig': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': db_2_name, 'USER': db_2_user, 'PASSWORD': 'db_2_passwd', 'HOST': 'db_2_host', 'PORT': 'db_2_port', }, } I use Django-nose for running test suits and use Django 2.2 -
Why password is not hashed when create user?
I've created a custom user model and in the register page if I set password on submit the browser do not let me to save because password is empty even if it is filled. In admin panel If I want to create a user on submit the password box remain in plain text. How can I fix that? # My user model class Crescatori(AbstractBaseUser, PermissionsMixin): """ Model Crescatori, folosit la inregistrarea utilizatorilor""" email = models.EmailField(unique=True, null=True, db_index=True) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=False) date_joined = models.DateTimeField(default=timezone.now) nume = models.CharField(max_length=40) prenume = models.CharField(max_length=50) telefon = models.CharField(max_length=25, blank=True, null=True) strada = models.CharField(max_length=254, blank=True, null=True) numarul = models.CharField(max_length=5, blank=True, null=True) judet = models.CharField(_('Judet/Sector'), max_length=128, blank=True, null=True) tara = models.CharField(max_length=150, blank=True, null=True) REQUIRED_FIELDS = ['nume', 'prenume', 'judet', 'tara'] USERNAME_FIELD = 'email' objects = UserManager() class Meta: verbose_name = "Crescator" verbose_name_plural = "Crescatori" def get_short_name(self): """ Returneaza numele mic al crescatorului""" return self.nume def get_full_name(self): """ Returneaza numele complet al crescatorului""" return '%s %s' % (self.nume, self.prenume) def __str__(self): return self.email # User Manager class UserManager(BaseUserManager): """ Manager crescatori/useri inregistrati""" def create_user(self, email, password, **extra_fields): """ Functie pentru crearea utilizatorilor""" if not email: raise ValueError(_('Adresa de email nu poate fi necompletata')) email = self.normalize_email(email) user … -
Django: Getting NoReverseMatch While Submitting the Form, URL has Slug
I am learning Django by building an application, called TravelBuddies. It will allow travelers to plan their trip and keep associated travel items (such as bookings, tickets, copy of passport, insurance information, etc), as well as create alerts for daily activities. The application will also able to update local information such as weather or daily news to the traveler. Travelers can also share the travel information with someone or have someone to collaborate with them to plan for the trip. I am facing a problem. I have a form like this: When I click on the Submit button, I am supposed to be redirected to http://127.0.0.1:8000/triplist/johor-bahru/. Instead, I get this error: NoReverseMatch at /addactivity/ Reverse for 'activity' with no arguments not found. 1 pattern(s) tried: ['triplist/(?P<slug>[-a-zA-Z0-9_]+)/$'] Request Method: POST Request URL: http://127.0.0.1:8000/addactivity/ Django Version: 3.0 Exception Type: NoReverseMatch Exception Value: Reverse for 'activity' with no arguments not found. 1 pattern(s) tried: ['triplist/(?P<slug>[-a-zA-Z0-9_]+)/$'] Here are my codes in models.py inside Trips folder: from django.contrib.auth.models import User from django.db import models from django.template.defaultfilters import slugify # Create your models here. class Trip(models.Model): trip_name = models.CharField(max_length=100) date = models.DateField() planner_name = models.CharField(max_length=100) add_coplanner = models.ManyToManyField(User) trip_description = models.CharField(max_length=1000, default='null') slug = models.SlugField(max_length=150, default='null') … -
Reverse for 'editPost' with arguments '('',)' not found. 1 pattern(s) tried: ['editPost/(?P<postslug>[^/]+)/$']
I am getting this error inside below template {% for post in post_queryset %} <div class="card-body"> <div class="date">{{ post.created_date }}</div> <div class="title"> {{ post.text }} {{ post.slug }} <a href="{% url 'editPost' post.slug %}" ><i class="fa fa-edit"></i></a> <a onClick="delete_post('{{post.slug}}','{{post_id}}')"><i class="fa fa-trash-o"></i></a> </div> </div> {% endfor %} I am getting the error in this line <a href="{% url 'editPost' post.slug %}" ><i class="fa fa-edit"></i></a> I displayed {{post.slug}} just before this line and commenting the link line just to make sure post.slug has some content. It looks post.slug has valid slug information. I also tried passing just some string instead of post.slug like below then it was working <a href="{% url 'editPost' 'some_string' %}" ><i class="fa fa-edit"></i></a> my urls.py is like below path('editPost/<postslug>/',views.editPost, name='editPost') Can someone help me to find the error? -
Cannot add path to package
I have download django-todo for my website, I am writting some function on the view but i am not able to add path to the urls.py even if it is correct. For example : from django.conf import settings from django.urls import path from todo import views from todo.features import HAS_TASK_MERGE app_name = "todo" path("add_list/", views.add_list, name="add_list"), path("add_listreccurence/", views.add_listreccurence, name="add_listreccurence"), The first one come with the package, the second is mine. It is exactly on the same file, with the same path but I cannot import it, it says : AttributeError: module 'todo.views' has no attribute 'add_listreccurence' Could you help me ? Thanks -
Where we should change initial data in the serializer?
Questions: Where I should change initial_data in the serializers? Is it a recommended way to change initial_data in the validate_field_name() methods? should validate_field_name methods return something? Code: from django.contrib.auth import get_user_model from rest_framework import serializers class MySerializer(serializers.ModelSerializer): def validate_owner(self, owner_id): try: return get_user_model().objects.get(owner_id=owner_id) except get_user_model().DoesNotExist or get_user_model().MultipleObjectsReturned: return owner_id If I don't change initial_data in validate_field_name methods, I'll fetch the data twice. For example: from django.contrib.auth import get_user_model from rest_framework import serializers from rest_framework.exceptions import ValidationError class MySerializer(serializers.ModelSerializer): def validate_owner(self, owner_id): try: get_user_model().objects.get(owner_id=owner_id) except get_user_model().DoesNotExist or get_user_model().MultipleObjectsReturned: raise ValidationError('User does not exists.') def create(self, validated_data): validated_data['owner'] = get_user_model().objects.get(owner_id=validated_data['owner_id']) # create instance -
How to make python in template to enter if condition only once
I have a some products and some pictures of in different models. While displaying all products I need to display 1 image in the table. I tried this: template : <tr class="check_items_row"> <td style="width:20px;"> <div class="checkbox lgi-checkbox m-t-5"> <label> <input class="check check_item" type="checkbox" value="{{instance.pk}}" name="delete_item"> <i class="input-helper"></i> </label> </div> </td> <td><a href="{% url 'products:product' pk=instance.pk %}">{{instance.auto_id}}</a></td> <td>{{instance.category}}</td> <td>{{instance.subcategory}}</td> <td>{{instance.name}}</td> {% for item in product_gallery %} {% if item.product == instance and test == 0 %} <td><img src="{{item.image.url}}" alt="Image" style="width:100px;"/></td> {% endif %} {% endfor %} </tr> {% endfor %} views.py def products(request): instances = Product.objects.filter(is_deleted=False).order_by('auto_id') product_gallery = ProductGallery.objects.all() context = { 'title': "Product ", 'instances' : instances, "product_gallery": product_gallery, "test": 0, } return render(request,'products/products.html',context) in my thoughts I just need to change the value of test in template if it enters the if condition once . This code is displaying all images of a product. I just need one image of every product. Here i will need to change the value inside if condition and reset to 0 after the for loop -
Django Signal that provides access to response of a request?
So far in our code we have implemented Django built-in signals for handling user login, logout, and failed login as well as db actions with pre-save, post_save and post_delete signals. I am looking to maintain consistency by performing some operations on the http response after a request has been made using signals. However, I do not see any built-in signal that grants access to the response object. I am aware of the request_finished signal but this does not seem to provide access to the response object. I have successfully achieved what I need using Django's process_response function in middleware but was wondering if there was a way I could maintain consistency and use a signal here as well. We are using Django 2.2 and DRF 3.8.2 -
AttributeError: '_shims' object has no attribute 'InstallRequirement'
I'm sorry if I didn't speak well in English because I'm not good at English. Specifically, the environment was being constructed with reference to this article. The error occurred when 「pipenv install gunicorn」 command was executed to introduce “gunicorn”. The execution result of 「pipenv install gunicorn」 is as follows. /home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/attr/_make.py:618: RuntimeWarning: Missing ctypes. Some features like bare super() or accessing __class__ will not work with slots classes. set_closure_cell(cell, cls) Installing gunicorn… Traceback (most recent call last): File "/home/app-user/.local/python/bin/pipenv", line 10, in <module> sys.exit(cli()) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install editable_packages=state.installstate.editables, File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/core.py", line 1909, in do_install pkg_requirement = Requirement.from_line(pkg_line) File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1068, in from_line if isinstance(line, pip_shims.shims.InstallRequirement): File "/home/app-user/.local/python/lib/python3.7/site-packages/pipenv/vendor/pip_shims/shims.py", line 254, in __getattr__ return super(_shims, self).__getattribute__(*args, **kwargs) AttributeError: '_shims' object has no attribute 'InstallRequirement' We … -
Sass_Processor and Compressor Are Not Creating .css File with Django 2.2, No Errors
I recently decided to switch my project over to sass as I like the DRY-ness of it. To get set up, I followed these two sites: https://www.accordbox.com/blog/how-use-scss-sass-your-django-project-python-way/ and https://terencelucasyap.com/using-sass-django/ It seemed to be working the first time around, but then I made more changes to the .scss file and tried to recompile, but no changes were made. I found the generated .css file and deleted it, thinking it might regenerate it, but not it doesn't seem to be doing anything when I compile. I have tried moving around where the sass_processor is looking, and where to save it to, but now I'm not sure what the problem is. I am completely new to sass, and fairly familiar with Django so I'm sure this is a simple problem I am missing. I have been unable to find any questions related, as mine does not throw any errors.. there just isn't a file? When I run ./manage.py compilescss I get Successfully compiled 1 referred SASS/SCSS files. then I collect the static files and runserver but inside of the chrome inspector, I do not see a css file where I normally would and none in my directory either. setting.py """ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) … -
Render date for yesterday with a link
I have a workspace where users can add note, they can pick a date I am trying to create 2 links, one for yesterday, one for tomorrow. Right now I am using a calendar and it is fine, but I would like to create 2 quick links that send them to the note for yesterday. So i have a code like that : def WorkspaceYesterday(request): yesterday = datetime.now() - timedelta(days=1) yesterday.strftime('%m%d%y') But i dont know how to render it in my template with a link. Thank you -
Django app on GKE (Kubernetes): Click on external IP of load balancer and gives "Bad Request (400)"
Probem: I have 2 replicas for my app, library. I have configured a service to talk to my two replicas. I have a dockerfile that starts my app at port # 8080. The load balancer and the app containers all seem to be running. However, I am not able to connect to them. Every time I click on the external IP shown I get "Bad Request (400)" > $ kubectl get services NAME TYPE CLUSTER-IP > EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP > 10.19.240.1 <none> 443/TCP 61m library-svc LoadBalancer 10.19.254.164 34.93.141.11 80:30227/TCP 50m > > > $ kubectl get pods NAME READY STATUS > RESTARTS AGE libary-6f9b45fcdb-g5xfv 1/1 Running 0 > 54m library-745d6798d8-m45gq 3/3 Running 0 12m Here is the library.yaml file I have to go with it. # [START kubernetes_deployment] apiVersion: extensions/v1beta1 kind: Deployment metadata: name: library labels: app: library spec: replicas: 2 template: metadata: labels: app: library spec: containers: - name: library-app # Replace with your project ID or use `make template` image: gcr.io/library-259506/library # This setting makes nodes pull the docker image every time before # starting the pod. This is useful when debugging, but should be turned # off in production. imagePullPolicy: Always env: # [START cloudsql_secrets] … -
Data From Database Not Loading into HTML table Django
I would like to create a table that lists the rows from a small database (7 rows including header, 3 columns) to an HTML table. I am working in Django and have checked "myapp"views.py, "myapp".urls, and the base.html. I also checked myprojects url settings and did not see anything. Any help would be great. Windows 10 Django 2.2.7 Python 3.8 My code is below: my\app view.py def repList(request): all_objects_Rep=Rep.objects.all() context={'all_objects_Rep': all_objects} return render (request, 'base.html', context) myproject\urls.py urlpatterns = [ path('', include('page.urls')), path('rep/', include('page.urls', namespace='reps')), path('home/', include('page.urls', namespace='home')), path('results/', include('page.urls', namespace='results')), path('admin/', admin.site.urls), myapp\urls.py app_name = 'page' urlpatterns = [ path('', views.homepage_view, name='homepage_view'), path('Rep/', views.repList, name='repList'), path('userInput/', views.userInput, name ='User Input'), path('results/', views.results_view, name='results_view'), myapp\base.html <div class ="RepList"> {% block repList %} <table> <tr> <th>District</th> <th>First Name</th> <th>Last Name</th> </tr> {% for x in all_objects_Rep %} <tr> <td>{{ x.District }}</td> <td>{{ x.f_name }}</td> <td>{{ x.l_name }}</td> </tr> {% endfor %} {% endblock %} </table> </div>``` -
How to stop Django from serving files locally?
I need to prevent local Django/runserver from serving my static files (I want to test whitenoise locally). The --nostatic flag is supposed to do just that. python manage.py runserver --nostatic But I still get 200s (successful) for my static files. So then I set debug = False but still get 200s! I even commented out 'django.contrib.staticfiles' from INSTALLED_APPS. But this did not work either. How could my static files still be served successfully - it's usually not this hard to break things. Perhaps I am misunderstanding what nostatic actually does; I was expecting to get 404s. -
Is there a way not to overwrite heroku database?
I have deployed django-telegram-bot on heroku and i'm changing codes with pycharm(offline) So every time that i push my codes to heroku, data in database is lost Is there a way not to overwrite heroku database? Maybe there is a way to connect heroku and pycharm so i am able to code remotely -
Set user to group when created
I have created a form where user can create their own group, everything work except that the group is not set to the user, so it is worthless. This is my views.py : @login_required def creategroup(request): if request.method == 'POST': groupcreate = Group() groupcreate.user = request.user groupcreate.name = request.POST['name'] groupcreate.save() I have set user, but it does not take the value -
Form Validation Not Displaying on Form
I have a custom form validation that runs on my popup window form. If the form validation occurs i get a bad request error which is what i have programmed in my views.py . How do i render it so the user stays on the form and the validation message displays. Thanks for the help. Here is my code. @login_required def K8_Points_Classroom(request): #context_from_k8_points = request.session['k8_points_context'] if request.method == 'POST': form = K8Points_ClassroomForm(request.POST) if form.is_valid(): form.save(commit=False) form.save() class_name = form.cleaned_data.get('class_name') getstudents = Student.objects.filter(class_name = class_name) students = getstudents.all() form = K8Points_ClassroomForm() context = {'form': form ,'students' : students, 'class_name': class_name,} return render(request,'points/k8_points_classroom.html', context) else: return HttpResponseBadRequest("Bad Request") else: return render(request, 'points/k8_points_classroom.html', {'form': form} )