Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
context must be a dict rather than set
I have started learning Django and I have got stuck on this point. I am facing this problem and I am at loss at what is the issue. Even though the view on which this issue occurs(which is UserFormView) is returning a dictionary. Error Log: TypeError at /music/register/ context must be a dict rather than set. Request Method: POST Request URL: http://127.0.0.1:8000/music/register/ Django Version: 2.1.5 Exception Type: TypeError Exception Value: context must be a dict rather than set. Exception Location: E:\Python Projects\Django_Enviroment\lib\site-packages\django\template\context.py in make_context, line 270 Python Executable: E:\Python Projects\Django_Enviroment\Scripts\python.exe Python Version: 3.6.3 Python Path: ['E:\\Python ' 'Projects\\Django_Enviroment\\Django_Projects\\Test_Projects\\ist_site', 'E:\\Python Projects\\Django_Enviroment\\Scripts\\python36.zip', 'E:\\Python 3.6.3\\DLLs', 'E:\\Python 3.6.3\\lib', 'E:\\Python 3.6.3', 'E:\\Python Projects\\Django_Enviroment', 'E:\\Python Projects\\Django_Enviroment\\lib\\site-packages'] Server time: Thu, 7 Feb 2019 13:20:49 +0000 Here is my views code: from django.views import generic from .models import Album from django.shortcuts import render,redirect from django.contrib.auth import authenticate,login from django.views import generic from django.views.generic import View from django.views.generic.edit import CreateView,UpdateView,DeleteView from django.urls import reverse_lazy from .forms import UserForm class IndexView(generic.ListView): template_name = "music/index.html" context_object_name='all_albums' def get_queryset(self): return Album.objects.all() class DetailView(generic.DetailView): model=Album template_name='music/detail.html' class AlbumCreate(CreateView): model=Album fields=['artist','album_title','genre','album_logo'] class AlbumUpdate(UpdateView): model=Album fields=['artist','album_title','genre','album_logo'] class AlbumDelete(DeleteView): model=Album success_url=reverse_lazy('music:index') class UserFormView(View): form_class=UserForm template_name='music/registration_form.html' def get(self,request): form=self.form_class(None) return render(request,self.template_name,{'form':form}) def post(self,request): form=self.form_class(request.POST) if form.is_valid(): #clean … -
Color CSV Column in Django Python
I want to color a row with i am outputting. How can i add properties to that row. Like i want to color that row. How can i add color to that row in csv file. import csv from django.http import HttpResponse def GenerateCompanyCSV(request): # Create the HttpResponse object with the appropriate CSV header. response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="Company_Report-%s.csv"' % datetime.date.today() query_set = Company.objects.exclude(id=1).exclude( company_is_deleted=True ).annotate( number_of_company_users=Count('userprofile') ) output = [] for query in query_set: output.append([ query.company_name, query.company_email, query.number_of_company_users, query.company_created, query.company_monthly_payment, query.company_tab_opts, query.company_status, ]) writer = csv.writer(response) # Output Color for this row writer.writerow(['Company Name', 'Company Email', 'Count Of Total Users', 'Created Date', 'Current Monthly Payment', 'Is TABopts Customer', 'Status']) #CSV Data writer.writerows(output) return response -
Django staic and admin static css files loaded but not applied to page
Django static css file of admin panel is loaded but css is not applied on my pc, I also tried answers available on stackoverflow but it's not working for my pc...,I also tried running same project on another pc then it is working correctly,and url routing is also not working on my pc while it works just fine in someone else's pc so what can be the issue on my pc? Note: When i open localhost:8000 it shows django is installed successfully i am also able to access admin page but without any css aplied. All of the above issues are occuring only on my machine/pc for any project that is working fine. Snippets: https://imgur.com/a/tnVmc6O -
how to check repeat row of for loop in django
hellow i am new in django and i am create 3 tables for save a data class student_admission(models.Model): Student = models.CharField(max_length= 50) Father = models.CharField(max_length= 50) Date = models.CharField(max_length= 50) Gender = models.CharField(max_length= 50) Address = models.CharField(max_length= 250) City = models.CharField(max_length= 50) College = models.CharField(max_length= 250) Branch = models.CharField(max_length= 50) Semester = models.CharField(max_length= 100) Occupation = models.CharField(max_length= 50) Pin = models.IntegerField(default=10) Phone = models.IntegerField(default=20) FatherPhone = models.IntegerField(default=20) Email = models.EmailField(max_length= 100) class course_content(models.Model): course = models.CharField(max_length= 100) Code = models.CharField(max_length=50) class student_course(models.Model): Student_id= models.ForeignKey(student_admission,on_delete=None) Course_id = models.ForeignKey(course_content,on_delete=None) in the student_admission table i am save the student informations and in the course_content table course list is saved if student submit this form then he select course in my course_content list the are also select multipul course this course i have save in student_course table and i am show this data on my website i have use this viiew function def table(request): data = student_course.objects.all().prefetch_related("Student_id","Course_id") d = {"data":data} return render(request,"html/tables.html",d) and i print data on html page <tbody> {% for item in data2 %} <tr> <td>{{item.Student_id.id}}</td> <td>{{item.Student_id.Student}}</td> <td>{{item.Student_id.Father}}</td> <td>{{item.Student_id.Date}}</td> <td>{{ item.Course_id.course}}</td> <td>{{item.Student_id.Gender}}</td> </tr> {% endfor %} </tbody> all is work proparly i got my result like this but i want if student … -
how to link Django model with mongoDB db of name: <app_name>_<model_name>?
views.py def get(self, request, account_id=None, *args, **kwargs): try: to_date = datetime.datetime.strptime(request.data['to_date'], "%Y-%m-%d") response_list = [] from_date = datetime.datetime.strptime(request.data['from_date'], "%Y-%m-%d") response_list = Abc.objects.all()#(account_id=account_id, date__gte=from_date, date__lte=to_date) print("***********response_list DailyCost**********") print(response_list) print("**********************") return Response(response_list, status=HTTP_200_OK) models.py class Abc(Document): date = fields.DateTimeField(required=True) month = fields.StringField(max_length=5, blank=False) link_id = fields.StringField(max_length=36, blank=False) account_id = fields.StringField(max_length=70, unique=True, blank=False) total_cost = fields.FloatField() last_updated = fields.DateTimeField() bill = fields.DictField() data is being stored in the db: '[app_name]_abc' by connecting to mongoclient and using db.collection.insert() When I print response_list (in views.py) i get empty list. Why? How to link a Django model with mongoDB db of name: [app_name]_[model_name]? -
How To Output CSV File Using QuerySet
I was Output CSV File but it is comming blank. I am using template. Do any have good idea for outputing csv for queryset from django.http import HttpResponse from django.template import Context, loader def GenerateCSV(request): # Create the HttpResponse object with the appropriate CSV header. response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="somefilename.csv"' t = loader.get_template('company/company_csv.txt') data = { 'companies':Company.objects.exclude(id=1).exclude( company_is_deleted=True ).annotate( number_of_company_users=Count('userprofile') ) } response.write(t.render(data)) return response file.txt Sr. No, Company Name, Company Email, Count Of Total Users, Created Date, Current Monthly Payment, Is TABopts Customer, Status {% for row in data %}" {{ row.0|addslashes }}", "{{ row.1|addslashes }}", "{{ row.2|addslashes }}", "{{ row.3|addslashes }}", "{{ row.4|addslashes }}" {% endfor %} -
ModuleNotFoundError: No module named 'src'
I'm changing view of homepage with app names pages. I've added pages to settings. this is how directory look like: trydjango src pages init views products trydjango init settings urls manage views' code: from django.shortcuts import render from django.http import HttpResponse # Create your views here. def home_view(*args, **kwargs): return HttpResponse("<h1>Hello Again</h1>") urls' code from django.contrib import admin from django.urls import path from src.pages.views import home_view urlpatterns = [ path('admin/', admin.site.urls), path('', home_view, name='home'), ] and I see this error when I run server ModuleNotFoundError: No module named 'src' -
'WSGIRequest' object has no attribute 'thema'
I have figured out a lot today and got my class views run. But I want to change my DetailViews to ListViews what works well. But I can't set a queryset to filter the ListViews properly like how I filtered them in the DetailsViews. I always get that error: "'WSGIRequest' object has no attribute 'thema'" I will post the code so you can see what I am trying to do :-) models.py class Thema(models.Model): themengebiet = models.CharField(max_length=350) beschreibung = models.TextField() themen_logo = models.FileField(max_length=350, upload_to="logos", default='default.jpg') erstellt_am = models.DateTimeField(default=timezone.now) def __str__(self): return self.themengebiet def save(self, *args, **kwargs): super().save(*args, **kwargs) img = Image.open(self.themen_logo.path) if img.height > 300 or img.width > 300: output_size = (300, 300) img.thumbnail(output_size) img.save(self.themen_logo.path) class Thread(models.Model): thema = models.ForeignKey(Thema, on_delete=models.CASCADE) titel = models.CharField(max_length=350) author = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) erstellt_am = models.DateTimeField(default=timezone.now) thread_logo = models.ImageField(upload_to="logos", default='default.jpg') #def get_absolute_url(self): #return reverse('forum:thread-page', kwargs={'pk': self.thema.id}) def __str__(self): return self.titel class Posting(models.Model): thread = models.ForeignKey(Thread, on_delete=models.CASCADE) titel = models.CharField(max_length=350) erstellt_am = models.DateTimeField(default=timezone.now) author = models.ForeignKey(User, on_delete=models.CASCADE) inhalt = models.TextField() def __str__(self): return self.titel views.py class ThemenView(ListView): template_name = 'forum/posts_original.html' context_object_name = 'all_themen' ordering = ['-erstellt_am'] paginate_by = 5 def get_queryset(self): return Thema.objects.all() class ThreadView(ListView): model = Thread context_object_name = 'all_threads' template_name = 'forum/thread.html' … -
Deploy AWS Lambda function code which is part of Django web app
I have a Django app which serves multiple api calls. It is deployed on Amazon ECS. I now have a requirement to create a Lambda function which can be used as cron job via Cloudwatch event. This Lambda function code will be part of the existing Django app as it has a dependency on the codebase. What's the best way to deploy Lambda code along with the Django app running on ECS? -
django pycharm error : Process finished with exit code 1
I'm new to web programming. I'm sorry if the question is ridiculous. A few days ago I put my code in the git branch, today I downloaded it from the directory I received using the git clone <git repo url> on my laptop. I've built ENV and installed this requirement. But whenever I run python manage.py runserver, I saw the error below: Process finished with exit code 1 for more information : makemigrations and migrate works correctly. How can I fix the problem? Thanks in advance for your guidance -
How to get my Django app in a real server?
I'm starting with web development, the last week I just write an HMTL, JavaScript and PHP scripts and get some very basic working properly in my web page, I used Cyberduck to get my files working in my web page. This week I want to use Django to develop faster, I have got my web page working locally but I have not been able to find a tutorial to get my Django app working in my server, I have a hosting service. -
Django channels group_send not working properly
I was trying to implement a bidding module with django-channels. Basically I broadcast any message I received from clients, and my consumer part goes as the following code snippet: class BidderConsumer(AsyncJsonWebsocketConsumer): async def connect(self): print("Connected") await self.accept() # Add to group self.channel_layer.group_add("bidding", self.channel_name) # Add channel to group await self.send_json({"msg_type": "connected"}) async def receive_json(self, content, **kwargs): price = int(content.get("price")) item_id = int(content.get("item_id")) print("receive price ", price) print("receive item_id ", item_id) if not price or not item_id: await self.send_json({"error": "invalid argument"}) item = await get_item(item_id) # Update bidding price if price > item.price: item.price = price await save_item(item) # Broadcast new bidding price print("performing group send") await self.channel_layer.group_send( "bidding", { "type": "update.price" "price": price, "item_id": item_id } ) async def update_price(self, event): print("sending new price") await self.send_json({ "msg_type": "update", "item_id": event["item_id"], "price": event["price"], }) But when I attempted to update the price from browser, the consumer could received the message from it however it could not successfully call the update_price function. (sending new price was never printed). -
How to compare dates with django
I have a Post model which has vip membership end time. I want to count active memberships. My model: class Post(models.Model): title = models.CharField(max_length=250,verbose_name ='Başlık') image = models.ImageField(upload_to=upload_location, null=True, blank=True,verbose_name ='Vitrin Fotoğrafı') vip = models.BooleanField(default=False,verbose_name ='Vip') phone = models.CharField(max_length=11,verbose_name ='Telefon') vipend = models.DateTimeField(auto_now=False,auto_now_add=False,null=True,blank=True,verbose_name ='Vip Bitiş') My view: def yonetim(request): endvipcount = Post.objects.fiter(vip=True,vipend<datetime.now()).count() # This part is obviously wrong # context = { "endvipcount": endvipcount , } return render(request, "yonetici.html", context) Error: endvipcount = Post.objects.fiter(vip=True, vipend =< datetime.now()).count() ^ SyntaxError: invalid syntax I want active and passive vip member counts. What is the ideal way of doing it? -
Select a valid choice. 41549530053 is not one of the available choices in dependent dropdown in django
when i am trying use dependent drop-down i got Select a valid choice error.The form is becoming invalid.when i print the form my selected value in the dropdown is not present in the form forms.py @parsleyfy class ScrubberForm(forms.Form): Headerchoice=[("","Select Header")] Templatechoice=[("","Select Template")] Header=forms.ChoiceField(label="Select Header",choices=Headerchoice+[ (o.iHeaderID, str(o.vcHeader)) for o in HEADERS_MASTER.objects.filter(~Q(iStatus = 2),iApprovedStatus=settings.STATUS_FLAGS['Active'])],error_messages={'required': 'Select Header' }) Template=forms.ChoiceField(label="Select Template",choices=Templatechoice+[ ( str(o.iTemplateID), str(o.vcTemplateName)) for o in ENTITY_TEMPLATES.objects.all()],error_messages={'required': 'Select Template' }) file_upload=forms.FileField(label="Select File",error_messages={'required': 'Please Select a File' }) def __init__(self,request,*args,**kwargs): kwargs.setdefault('label_suffix', '') super (ScrubberForm,self).__init__(*args,**kwargs) for field in iter(self.fields): self.fields[field].widget.attrs.update({'class': 'form-control'}) self.fields['file_upload'].widget.attrs.update({'class':'file-upload-input','onchange': "readCSV(this);","accept":".csv"}) self.fields['Header'].widget.attrs.update({'class':'mdb-select md-form'}) self.fields['Template'].widget.attrs.update({'class':'mdb-select md-form'}) iEntityID=get_entity_id(request) Headerchoice=[("","Select Header")] self.fields['Header'].choices = Headerchoice+[ (o.iHeaderID, str(o.vcHeader)) for o in HEADERS_MASTER.objects.filter(~Q(iStatus = 2),iApprovedStatus=settings.STATUS_FLAGS['Active'],iEntityID=iEntityID)] models.py class SCRUBBER_MASTER(models.Model): iScrubberID = models.BigIntegerField(primary_key=True) iHeaderID = models.BigIntegerField(blank=True, null=True,default=0) iTemplateID = models.CharField(blank=True, null=True,default='',max_length=30) vcUploadPath = models.CharField(default='',max_length=150,blank=True, null=True) -
zappa not connecting with rds
i have created rds instance and connect with pgadmin4 and created database singup also added thse setting to django setting.py file name: singup user: rds username pass: rds pass host: rds host and updated with zapp deploy dev but when i try to create superuser with: zappa invoke --raw dev "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'passwordhere')" i get this errror: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? -
How transform a many to many relationship into a queryset?
I have a model in Django related to another model with a ManyToManyField. I'd like to retrieve all elements of ManyToManyField. Here are the models : class Personnel(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) adresse = models.CharField(max_length=150, verbose_name=_("Adresse")) telephone = models.CharField(max_length=15, verbose_name=_("Téléphone")) dossiermedical = models.ManyToManyField("DossierMedical", related_name=_("travaille_sur")) class DossierMedical(models.Model): patient = models.OneToOneField("Patient", on_delete=models.CASCADE) In the Django shell, I did the following: p = Personnel.objects.get(pk=User.objects.get(pk=1)) d = p.dossiermedical.all() <QuerySet []> However, when I'm Django admin for this Personnel, you have : -
Send json response along with context in class based view
I want to send a value as json response along with context. How can i achieve that? e.g Following is django-view. class SessionTemplateView(LoginRequiredMixin,TemplateView): template_name = "dashboard/map.html" def get_context_data(self,**kwargs): # Call the base implementation first to get a context context = super(SessionTemplateView, self).get_context_data(**kwargs) #----------existing lines of code--------------- x=[('Blog', 1), ('Contact', 1), ('Map', 1)] #I know the following return method is completely wrong.I am just trying to give you gist what i want to do. return (context,HttpResponse(json.dumps({"data": x}), content_type="application/json") -
How to load folder in django view file
I stored whoosh indexed data in "test" folder which is in static folder.I want to load "test" folder in django view file. How I can do it. I use following method but it does not work. from projectdir.settings import STATIC_DIR index = os.path.join(STATIC_DIR, 'textdata') -
django+uwsgi+docker while connecting to upstream
I made infrastructure via docker. To deploy django, used uwsgi and nginx. Here is my configuration file. [docker-compose.yml] version: '3.7' services: nginx: build: context: . dockerfile: docker/nginx/Dockerfile container_name: nginx hostname: nginx ports: - '80:80' networks: - backend restart: on-failure links: - web_service depends_on: - web_service web_service: build: context: . dockerfile: docker/web-dev/Dockerfile container_name: web_service hostname: web_service ports: - '8000:8000' networks: - backend tty: true volumes: - $PWD:/home networks: backend: driver: 'bridge' [docker/web-dev/Dockerfile] FROM python:3.6.5 COPY Pipfile ./home COPY Pipfile.lock ./home WORKDIR /home RUN pip3 install pipenv RUN pipenv install --system RUN apt-get update && apt-get install -y vim && apt-get install -y git RUN pip3 install uwsgi && pip3 install git+https://github.com/Supervisor/supervisor CMD ["uwsgi", "--ini", "docker/config/uwsgi.ini"] [docker/nginx/Dockerfile] FROM nginx:latest COPY . ./home WORKDIR home RUN rm /etc/nginx/conf.d/default.conf COPY ./docker/config/nginx.conf /etc/nginx/conf.d/default.conf [nginx.conf] upstream django { server web_service:8001; } server { listen 80; server_name 127.0.0.1; charset utf-8; location / { uwsgi_pass django; include /etc/nginx/uwsgi_params; } location /media { alias /home/example/media; } location /static { alias /home/example/static; } } [uwsgi.ini] [uwsgi] chdir = /home module = example.wsgi:application master = true process = %(%k * 3) socket = 127.0.0.1:8001 vaccum = true chmod-socket=664 I set nginx '/' to django and django is listening via port 8000. … -
Automatically run django-admin migrate on startup
I'm trying to make the installation procedure of a Django application easier. One of the steps is to run django-admin.py migrate, is there any way this can be automated on the startup of the application? -
How can I fix this Error: UnboundLocalError at /templateName/ local variable 'Name' referenced before assignment?
I have gotten this Error: UnboundLocalError at /home/ local variable 'topic_name' referenced before assignment I have tried to move things around in my views.py but it is not working out. And I have tried to change the url into home/results but it didn't work out as well. This is my views.py from django.shortcuts import render, render_to_response, redirect from django.views.generic import TemplateView, CreateView from home.models import Topic, Image, Question, Answer from home.forms import QuizMultiForm class QuizView(TemplateView): template_name = 'index.html' def get(self, request): form = QuizMultiForm() return render (request, self.template_name, {'form': form}) def post(self, request): if request.method == 'POST': form = QuizMultiForm(request.POST) if form.is_valid(): topic_name = form.cleaned_data['topics']['topic_name'] question_type = form.cleaned_data['questions']['question_type'] args = {'form': form, 'topic_name': topic_name, 'question_type': question_type} return render (request, 'results.html', args) And this is my forms.py from django import forms from betterforms.multiform import MultiModelForm from .models import Topic, Image, Question, Answer from .choices import questions_type_choices, question_topic_name_choices class TopicForm(forms.ModelForm): topic_name = forms.ChoiceField( choices=question_topic_name_choices, widget = forms.Select( attrs = {'class': 'home-select-one'} )) class Meta: model = Topic fields = ['topic_name',] def __str__(self): return self.fields class QuestionForm(forms.ModelForm): question_type = forms.ChoiceField( choices= questions_type_choices, widget = forms.Select( attrs = {'class': 'home-select-two'}, )) question_answer = forms.CharField( max_length=50, widget = forms.HiddenInput() ) question_image = forms.CharField( max_length=50, widget … -
Django Filter by Distance using only Sqlite (No GeoDjango, PostGres, MySQL, GIS)
I have a Django application that needs to filter users by location (show users who are within a given distance of the logged in user). Right now I am able to capture the logged in users latitude and longitude coordinates using HTML5 and save them into the Location table in my SQLite backend. I have the GeoIP2 lists with city and country in a folder in my project, I'm not sure how I can use them but they seem to be a good option as they take in lat and lon coordinates and generate out a location. I know there are a few options here, for example making a point value from the lat lon coordinates, which would then perhaps be able to filter by radius? Etc, 5km, 10km, 15km? I'm relatively new to all of this which is why I am asking for a clean minimal solution. I do not want to use PostGres, GIS, GeoDjango. If someone has a simple solution for doing this using Sqlite and possibly the geoip2 lists, I would very much appreciate you sharing it! models.py class Location(models.Model): latitude = models.DecimalField(max_digits=19, decimal_places=16) longitude = models.DecimalField(max_digits=19, decimal_places=16) user = models.ForeignKey(User, on_delete=models.CASCADE, null=False) def __str__(self): return … -
cannot acces foreign keys in django
I have the following template: {% extends "artdb/base.html" %} {% block content1 %} <h4>Persons:</h4> <ul> {% for p in ans %} <h5>First name: {{p.firstName}}</h5> <h5>Last name: {{p.lastName}}</h5> <h5>Phone: {{p.phoneNumber}}</h5> <h5>Adress: {{p.streetAdress}}</h5> <h5>Zip Code: {{p.zipcode}}</h5> <h5>City: {{p.city}}</h5> <hr> {% endfor %} </ul> {% endblock content1 %} {% block content2 %} <h4>Roles:</h4> <ul> {% for p in ans %} <h5>Role:{{p.persons.role}}</h5> <hr> {% endfor %} </ul> {% endblock content2 %} and the model: class Person(models.Model): mail=models.EmailField() firstName=models.CharField(max_length=200) lastName=models.CharField(max_length=200) phoneNumber=PhoneNumberField() streetAdress=models.CharField(max_length=200) zipcode=models.CharField(max_length=200) city=models.CharField(max_length=200,default="Göteborg") country=models.CharField(max_length=200,default="Sweden") def __str__(self): return "%s %s" % (self.firstName,self.lastName) class Meta: ordering = ('firstName','lastName') class Role(models.Model): role=models.CharField(max_length=200) person=models.ManyToManyField(Person) def __str__(self): return self.role class Meta: ordering = ('role',) But when I run the above code the only output that I get is from the block content1, i.e I cannot access the role content. I thought that role.persons.role would do it but apperantley not. There is a many-to-many relationship between perssons and roles. Any ideas? -
Unable to upload media files to S3 using Django
I have been trying to upload my media files to my Amazon S3 bucket for my Django project, but I am unable to do so, only the static files get uploaded on the S3 bucket. Not sure what I am doing wrong here, my settings file is as belowsettings.py -
Django console message: GET /%7B HTTP/1.1
Between once a second and 10 times a second I get the following message displayed on the console: "GET /%7B HTTP/1.1" 404 26453 After running python manage.py runserver I believe it has some relation to my carousel image strip because it stops the timer animation from scrolling across the top of the image to indicate how long left the image will be shown for until it moves on to the next one: {% for image in images %} <img src="/static/images/background-carousel.png" style="z-index: -1"> <li data-masterspeed="1500" data-slotamount="7" data-transition="zoomout"> <div class="tp-caption customin customout" data-captionhidden="on" data-customin="x:0; y:100; z:0; rotationX:0; rotationY:0; rotationZ:0; scaleX:1; scaleY:3; skewX:0; skewY:0; opacity:0; transformPerspective:600; transformOrigin:0% 0%;" data-customout="x:0; y:0; z:0; rotationX:0; rotationY:0; rotationZ:0; scaleX:0.75; scaleY:0.75; skewX:0; skewY:0; opacity:0; transformPerspective:600;" data-easing="Power4.easeOut" data-endeasing="Power1.easeIn" data-endspeed="300" data-speed="750" style="z-index: 9; text-align:center;"> <img alt="{{ image.title }}" class="boff_white" data-bgfit="cover" data-bgposition="center center" data-bgrepeat="no-repeat" src="{{ MEDIA_URL }}{{ image.image }}" style="width: {{ image.width }}; height: {{ image.height }}"/></center> </div> </li> {% endfor %} After the above code there are some more images hard-coded. I am wondering what it means and how it can be fixed? I am currently taking over development on the website from someone else (the for loop scope of code is the only bit that is mine). Using Django …