Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Read scale weight connected via rs232 cable in django
I have a system developed in Django. One of the applications has to work with a scale connected to the server via a RS232 cable. What I want to achieve is to read the weight (when an object is placed on the scale weighing platform) on the scale terminal and store it in the system database. Any pointers will be greatly appreciated. -
TypeError at /project/create 'Account' object is not iterable
I am facing a problem. I can not assign user with project using many to many field here is the details here is my model.py from django.conf import settings from django.db import models from workingSkills.models import Domain,Environment,ToolsAndTechnology class Project(models.Model): profile_of = models.ManyToManyField(settings.AUTH_USER_MODEL, null=False) project_title = models.CharField(max_length=100) domain = models.ManyToManyField(Domain) environment = models.ManyToManyField(Environment) tools_and_technology = models.ManyToManyField(ToolsAndTechnology) here is views.py @login_required(login_url= 'login') def createProject(request): form = createProjectForm() print(request.user) if request.method == 'POST': form = createProjectForm(data=request.POST) if form.is_valid(): user = Account.objects.filter(request.user) instance = form.save(commit=False) #instance.save() instance.profile_of.set(user) instance.save() return HttpResponseRedirect('createprofile') form = createProjectForm context = {'form': form} return render(request, 'project/create_project.html', context) here is error image -
Python selenium keep browser open for the next http request
I have the following view in django where I am using selenium to check the visibility of element in a webpage and return it in a http response. def check_visibility(request): element_css_selector = request.GET.get("element_css_selector") url = request.GET.get("url") chrome_options = Options() chrome_options.add_argument('--headless') chrome_options.add_argument('--no-sandbox') chrome_options.add_argument('--disable-dev-shm-usage') chrome_options.add_argument('--privileged') chrome_options.add_argument('--start-maximized') chrome_options.add_argument('--js-flags=--expose-gc') chrome_options.add_argument('--enable-precise-memory-info') chrome_options.add_argument('--disable-popup-blocking') chrome_options.add_argument('--disable-default-apps') chrome_options.add_argument('--disable-infobars') chrome_options.add_argument('--disable-gpu') chrome_options.add_argument('--enable-logging=stderr') fox = selenium.webdriver.Chrome(os.path.dirname(os.path.abspath(__file__)) + '/chromedriver', chrome_options=chrome_options) fox.set_page_load_timeout(30) try: fox.get(url) # 'http://stackoverflow.com/') required_width = fox.execute_script('return document.body.parentNode.scrollWidth') required_height = fox.execute_script('return document.body.parentNode.scrollHeight') required_width = 1440 # laptop size fox.set_window_size(required_width, required_height) time.sleep(10) except TimeoutException as ex: fox.quit() return HttpResponseBadRequest("Failed at getting page") display = False try: element = fox.find_element_by_css_selector(element_css_selector) if element.is_displayed(): display = True except NoSuchElementException: pass fox.quit() response = { "display": display } return HttpResponse(json.dumps(response), content_type="application/json") But I am checking the visibility of hundreds of elements by making the http calls to this endpoint with the same url and different element_css_selector parameter Opening and closing selenium browser hundreds of times within a few seconds causes RAM overload and makes my system crash. I want that for each new url that this endpoint gets, it should keep the selenium browser open for any of the incoming http requests that pass the same url but different css selector, so that it can check the … -
Django Static - Google Cloud Storage - CDN
I am still new with serving my Django static/media files to Google cloud storage. It's working now but I am not sure if this is right or is this enough already, do I still need to use CDN like Cloudfront or other similar services? I am really confused and any recommendation would be much appreciated. Below is my configuration. Thanks you so much! -
How to import modules in a Django project in pydriod 3
I'm trying to import a module in one of my apps to another file in that same app directory. The app 'blog' under my Django project 'django_project' where I wanted to import views.py to urls.py,from the tutorial the import was simply done by this 'from . import views' but I guess it didn't work because I was using an pydriod 3 on my phone. I tried this 'from views import *' which works perfectly in other python codes I have written but doesn't work on Django when I run the server on terminal,I still don't get what's the right way to import those files -
Djagno queryset field lookup list of objects
I'm trying to create a query of field lookup (part of a longer query). The field is a JsonField that contains a list of objects with attributes "id" and "type". This is the model (partial): class MyModel(models.Model): id = models.CharField(max_length=200) my_list = JSONField(default=dict) Let's say I have this value in my_list: my_list = [{"id": "12345", "type": "2"}, {"id": "23456", "type": "3"} ] and I want to check if any of the 'id's contains any of list of 'id's for example: ids = ['12345', '45678'] I can do something like this: MyModel.objects.filter(Q(my_list__contains=[{'id': '12345'}]) | Q(my_list__contains=[{'id':'45678'}])) In that case I will need to take that list of ids and somehow create this query out of it. Is there a better way to do it? -
Docker connection error for PostGIS and Django
I am getting an error when I run PostGIS and Django in Docker. I am trying to set up a Django project to use PostGIS database. docker-compose.yml version: '3' services: db: image: postgis/postgis environment: - POSTGRES_DB=postgres - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres ports: - 5432:5432 web: build: . command: bash -c " python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000 " volumes: - .:/code ports: - "8000:8000" depends_on: - db Dockerfile FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code COPY requirements.txt /code/ RUN pip install -r requirements.txt COPY . /code/ error message: web_1 | File "/usr/local/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect web_1 | conn = _connect(dsn, connection_factory=connection_factory, **kwasync) web_1 | django.db.utils.OperationalError: could not connect to server: Connection refused web_1 | Is the server running on host "db" (192.168.192.2) and accepting web_1 | TCP/IP connections on port 5432? web_1 | ht_djangoapp_web_1 exited with code 1 -
JWT authentication for django rest framework
I have a very interesting issue. We have built couple of apis using django rest framework . These apis are consumed by frontend designed using React. We use SAML withe sessions to manage the authentication process.This SAML authentication is handled by a django middleware. Now I have a requirement to make some of these apis accessible to a different domain, where their backend would call our apis programmatically . So I need to give auth details to them for them to able to access it. Since SAML is enabled here, how do I able to set the authentication using JWT and give them the tokens. The saml middleware code looks like this, def __init__(self, get_response): self.get_response = get_response def __call__(self, request): if hasattr(request, 'user') and request.user.is_anonymous and 'samlUserdata' in request.session: data = request.session['samlUserdata']['mail'][0] if data is not None: try: email=data user = User.objects.get(email=email) except ObjectDoesNotExist: user = User.objects.create_user(username=data.split("@")[0], email=data) login(request,user) request.session.set_expiry(settings.SESSION_EXPIRY) elif not settings.DEBUG and 'samlUserdata' not in request.session \ and not request.get_full_path().startswith('/admin'): if not request.path == settings.REDIRECT_LOGIN_URL and not request.path == REDIRECT_LOGOUT_URL and \ not request.path == '/saml': return redirect(settings.REDIRECT_LOGIN_URL) response = self.get_response(request) request.session.set_expiry(settings.SESSION_EXPIRY) return response Now for this I am trying to use djangorestframework-simplejwt. But since SAML is … -
How to run Python functions in frontend
I know front-end developement with React.js. I want to make a basic web-app where I use some python functions (for example on onClick of buttons etc). These functions would mainly revolve around machine learning algorithms where I will be using pre-built libraries (won't be too complex). Is there any way to run python functions from React.js apart from ajax queries? If not, which Python framework should I use to do web development in Python such that I can directly run Python functions as well? I have come across names like Django, Tinkter and Flask but couldn't figure out what exactly would suit my requirement. -
Create new item and select the item like Django admin
I have an model that has a one-to-one relationship with another mode. Model Code has relationship with Language. What I can do: User can select the Language while then write new code from the list. But I want to add a system like the Django Admin panel where user can also add new Language and select while adding new code. I am new to Django, can anyone help? -
Running Face Recognition when new user is added Django
I have this ViewSet which returns my Student model and should run the Facial Recognition, however when I start my Django server, the Facial Recognition runs without being POSTed to and the server never starts because it started the facial rec class StudentView(viewsets.ModelViewSet): queryset = Student.objects.all() serializer_class = StudentSerializer recognize.break_run() recognize.train("media", model_save_path="trained_knn_model.clf") recognize.run_recognition(0, faceFound) Output: I:\Programs\Jetbrains\Toolbox\apps\PyCharm-P\ch-0\202.6948.78\bin\runnerw64.exe I:\Programs\anaconda3\envs\AutoSecurityBackend\python.exe I:/Projects/AutoSecurityBackend/manage.py runserver 8000 Watching for file changes with StatReloader Performing system checks... Setting cameras up... Any ideas as to what is causing this, I'm pretty new to Django -
signature = signature.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 1: invalid start byte (django)
my serializer: class LicenseSerializer(serializers.ModelSerializer): validate_util = serializers.SerializerMethodField() class Meta: model = LicenseModel fields = ['license', 'Expiration_date', 'company', "validate_util"] def create(self, validated_data): password = LicenseModel.objects.create(creator=self.context['view'].request.user, **validated_data) return password def get_validate_util(self, obj): keyPair = RSA.generate(bits=1024) pubKey = keyPair.publickey() date = timezone.now() + timedelta(days=4) date_to_byte = date.isoformat().encode('utf-8') hash: SHA256Hash = SHA256.new(date_to_byte) signer = PKCS115_SigScheme(keyPair) signature = signer.sign(hash) signature = signature.decode() date = date_to_byte.decode('utf-8') return {'signature': signature, 'pubkey': pubKey.exportKey(), 'date': date} error : signature = signature.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 1: invalid start byte how to return signature? -
Passing generator object to Django template
I am developing a Django dictionary application and I am writing a helper function, get_tags(), to collect all the Tags that there are in a list of tagged Definitions. I would then use get_tags() in my views.py as follows to basically return all the Tags in my dictionary: def index(request): tags = get_tags(Definition.objects.all())) return render(request, "index.html", {"tags": tags}) As per the implementation of get_tags(), I am dubious whether a list comprehension or a generator expression would be more performant in the context I described above. Which version of get_tags() would be more efficient? List comprehension: def get_tags(objects): return [t for o in objects for t in o.tags.all()] Or generator expression? def get_tags(objects): return (t for o in objects for t in o.tags.all()) -
Python django ecommerce application to android apps? How to create?
I have an eCommerce website that created using python Django framework. Now I need an android app. like this website how to create this please help me. -
How do i get the highest ID of an item within a database in djngo?
When I try to save a new item I need to find the item with the highest ID in the database in order to add 1 to it and save the next item in the order in the database. Simply counting the items in the DB will not work as if an item is deleted the count will be incorrect. I have no code to fix but pseudo looks something like: look at all the items in the DB Find the item with the highest ID Add one to that number save the new item with the new highest id in the DB I am using Django. as such it should use the querysets within Django and or python. -
Why Django JQuery Infinitescroll not working (Cannot set property 'Infinite' of undefined, Waypoint is not defined)
I want to make an infinite scroll but it's not working and throws errors in the console: Here is my HTML: {% extends 'base.html' %} {% load static %} {% block imports %} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" /> <script src="https://kit.fontawesome.com/a076d05399.js"></script> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> {% endblock imports %} {% block main %} <h1 class="title">Was soll es denn heute geben?</h1> <div class="all-recipes infinite-container" id="all-recipes"> {% for recipe in queryset_recipes %} <div class="recipe-box infinite-item"> <a href="{{recipe.get_absolute_url}}" class="recipe-link"> <img src="{{recipe.images}}" alt="Rezept Bild" class="image" /> <h3 class="recipe-title">{{recipe.title}}</h3> </a> </div> {% endfor %} </div> {% if page_obj.has_next %} <a class="infinite-more-link" href="?page={{ page_obj.next_page_number }}"></a> {% endif %} <div class="d-flex justify-content-center" style="display:none;"> <div class="spinner-border" role="status"> <span class="sr-only">Loading...</span> </div> </div> {% endblock main %} {% block scripts %} <script src="/static/js/jquery-2.2.4.min.js"></script> <script src="/static/js/waypoints.min.js"></script> <script src="/static/js/infinite.min.js"></script> <script> var infinite = new Waypoint.Infinite({ element: $('.infinite-container')[0], onBeforePageLoad: function () { $('.loading').show(); }, onAfterPageLoad: function ($items) { $('.loading').hide(); } }); </script> {% endblock scripts %} And here are the Errors: 1. infinite.min.js:57 Uncaught TypeError: Cannot set property 'Infinite' of undefined at infinite.min.js:57 at infinite.min.js:58 (index):329 Uncaught ReferenceError: Waypoint is not defined at (index):329 I really hope that somebody could help me solving those errors because I have no idea why this … -
Foreign key data as text field
I am new to Django. I am developing an app in which I have following three models. class Vessel(models.Model): vessel = models.CharField(max_length=100,unique=True) def __str__(self): return self.vessel class Method(models.Model): method_name = models.CharField(max_length=100,unique=True) active = models.BooleanField(default=True) valid_from = models.DateField(null=False, blank=False,help_text='Enter Date in YYYY-MM-DD format') valid_to = models.DateField(null=False, blank=False,help_text='Enter Date in YYYY-MM-DD format') created_by = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) created_at = models.DateTimeField(auto_now_add=True, null=True, blank=True) updated_at = models.DateTimeField(auto_now=True, null=True, blank=True) def __str__(self): return self.method_name class VesselRate(models.Model): cem = models.ForeignKey(Method,related_name='vessels', on_delete=models.CASCADE) vessel_name = models.ForeignKey(Vessel,on_delete=models.CASCADE,null=True,blank=True) rate = models.PositiveIntegerField(null=True) created_at = models.DateTimeField(auto_now_add=True, null=True, blank=True) updated_at = models.DateTimeField(auto_now=True, null=True, blank=True) def __str__(self): return self.vessel_name This is my form for Vessel Rate. class VesselRateForm(ModelForm): class Meta: model = VesselRate fields = ['vessel_name','rate',] labels = {'rate':'Rate in USD'} In the above form in vessel_name, all fields are coming in list form, while I want to display all the names included in the vessel model to be displayed as a non-editable text field. Please help me to get the solution. Thank you. -
How to create a brand page, which will contain all the categories related to that brand in Django
I have 2 models: Brand and Categories: class Brand(models.Model): name = models.CharField(max_length=250, unique=True, default='Undefined') slug = models.SlugField(max_length=250, null=True) brand_lower = models.CharField(max_length=250) site = models.CharField(max_length=250) url = models.CharField(max_length=500, unique=True) letter = models.CharField(max_length=1, default='Undefined') created = models.DateField(auto_now_add=True) updated = models.DateField(auto_now=True) status = models.CharField(max_length=25, default='New') def __str__(self): return self.name def save(self, *args, **kwargs): if not self.slug: self.slug = slugify(self.name) super().save(*args, **kwargs) def get_absolute_url(self): return reverse('manuals:brand', args=[str(self.pk)]) class Meta: ordering = ('name', ) class Category(models.Model): brand = models.ForeignKey(Brand, on_delete=models.CASCADE, default='Undefined') name = models.CharField(max_length=250, unique=True, blank=True, null=True, default='Undefined') slug = models.SlugField(max_length=250, null=True, unique=True) name_lower = models.CharField(max_length=250) url = models.CharField(max_length=500) status = models.CharField(max_length=25, default='New') def __str__(self): return self.name class Meta: ordering = ('name', ) I want to create a separate page for each brand. And that page should list all the categories of the selected brand. For example. The page should be: site.com/samsung/ And that page should have all the categories: - TV - Phones - Dishwashes and so on... I use ListView to get all the categories. But I cannot get the correct url. Here is the View: class BrandCategoryListView(ListView): # List of Categories of a Brand model = Category template_name = 'brand_categories_list.html' and here is the urls.py path('category/<int:pk>/', BrandCategoryListView.as_view(), name='brand_categories_list'), What am I doing … -
Hosting python-java backend with Py4j on AppEngine
Recently I have been working on a project to make a RESTapi using Django rest_framework. This framework requires some processing and objects which need to be done in java. I came across this library called Py4J which allows us to access Java objects, collections etc from a python environment and from what I could understand was that To make JVM accessible to python I had to interact with sockets on another server localhost:25333. I have written a very basic code to test: Views.py from py4j.java_gateway import JavaGateway class TestClass(APIView): permission_classes = [AllowAny] authentication_classes = [] @staticmethod def post(request): gateway = JavaGateway() fn = gateway.entry_point.getFunc() response = Response() response.data = {"res": fn.print()} return response Func.java public class Func{ public String print() { return "Hello from java"; } } TestGateway.java import py4j.GatewayServer; public class TestGateway { private Func func; public TestGateway() { func = new Func(); } public Stack getFunc() { return func; } public static void main(String[] args) { GatewayServer gatewayServer = new GatewayServer(new TestGateway()); gatewayServer.start(); System.out.println("Gateway Server Started"); } } This code works as expected since every interaction is happening on the localhost. But I need to deploy both the java application and django rest api on Google AppEngine. How … -
How to filter blogphoto_set by Catgery from Urls django?
Hello I created a model called BlogPhoto that connect to Blog model and i create a serializer where contain create and update funtion , and also i have url where category and id contain and i want to filter blogphoto_set by category that will be in urls. here is my code so far i did. models.py CATEGORY = [ ("vehicle-photo", _("Vehicle photo")), ("Vehicle-registration", _("Vehicle registration")), ("insurance-police",_("Insurance police")), ("other",_("Other")), ] class BlogPhoto(models.Model): created_by = models.ForeignKey(settings.AUTH_USER_MODEL, models.CASCADE) blog = models.ForeignKey(Blog, models.CASCADE, verbose_name=_('blog')) category = models.CharField(max_length=255, choices=CATEGORY, null=True, blank=True) name = models.CharField(_("Description about image"),max_length=255, null=True, blank=True) file = models.FileField( _("Upload documents image"), null=True, blank=True, upload_to=generic_upload_blog, max_length=500 ) urls.py there in urls there is category and i want to use in queryset to get filter blogphot_set urlpatterns = [ path("list/<int:pk>/<slug:category>/image/", views.BlogImagelView.as_view()), ] views.py here i am getting all category photo of specific blog id but i want also filter here blogphot_set by category from urls value. class BlogImagelView(generics.RetrieveUpdateDestroyAPIView): permission_classes = (IsAuthenticated,) serializer_class = PhotoBlogSerializer def get_queryset(self): blog = Blog.objects.all() return blog serializers.py class BlogPhotoSerializer(serializers.ModelSerializer): id = serializers.IntegerField(required=False) file = Base64ImageField( max_length=None, use_url=True, required=False, allow_null=True, allow_empty_file=True ) class Meta: model = BlogPhoto exclude = ['created_by', 'blog'] def create(self, validated_data): validated_data['created_by'] = self.context['request'].user return super().create(validated_data) class … -
TypeError at /accounts/verification/ save() missing 1 required positional argument: 'self'
Well I am actually trying to add a functionality of email code verification. i am sending four digit number (5577) in email and than comparing that number in my if condition. All I want to do is that if the set numbered is equal to the number enter by the user in verification template form than redirect user to the login page and also set user equal to activate or user.is_active = True. But I am having an error (in the title of this question), So if you guys can help me than please help. If more detail or code is required for help than tell me. I will update my question with that information. I shall be very thankful to you. If you guys spend some of your precious time to answering me with a wonderful and helpful information! class SignUp(CreateView): form_class = forms.UserCreateForm def form_valid(self, form): if form.is_valid: email = form.cleaned_data.get('email') user = form.save(commit=False) user.is_active = False user.save() send_mail( 'Verification code', '5577', #Sending code on gmail 'coolahmed21@gmail.com', [email,], fail_silently=False, ) # messages.success('Successful sent email') return super(SignUp, self).form_valid(form) success_url = reverse_lazy('accounts:code_verification') template_name = "accounts/signup.html" class CodeCreateView(CreateView,SuccessMessageMixin): form_class = CodeForm def form_valid(self,form): vcode = form.cleaned_data.get('vcode') if vcode == 5577: user.is_active … -
login page in django username to email-id
I have to input email-id and password to login to my page but even after giving the right data it is showing "invalid login details supplied"(a print statement in views.py). here is my code: def user_login(request): if request.method == "POST" : email = request.POST.get('email') password = request.POST.get('password') user = authenticate(email=email,password=password) if user: if user.is_active: login(request,user) return HttpResponseRedirect(reverse('index')) #HttpResponse('you are logged in') else: return HttpResponse('account not active') else: print("someone tried to login and failed!") print('email: {} and password: {}' .format(email,password)) return HttpResponse("invalid login details supplied!") else: return render(request,'basicapp/login.html',{}) The below code is login.html {% extends "basicapp/base.html" %} {% load static %} {% block body_block %} <div class='jumbotron'> <h1>plaese login</h1> <form action="{%url 'basicapp:user_login' %}" method="post"> {%csrf_token%} <label for="email">email:</label> <input type="text" name="email" placeholder="email"> <label for="password">password:</label> <input type="password" name="password"> <input type="submit" value="login"> </form></div> {%endblock%} -
how to use absolute and relative path in redirection in django framework
I started learning django and i'm currently writing my first app but i have encountered a weird error, in my url.py i wrote that : path("/wiki/<title>/" , views.view_entry , name="view_entry"), path("search" , views.search , name="search_entry") and in my view.py i wrote that: return redirect('view_entry' , title=entry) when I run that code I get an error saying Page Not Found but when i make a small detail in url.py like that : path("search/" , views.search , name="search_entry") it works why? -
Django: Displaying rendered template with JavaScript - other JS does not work
I converted one of my pages to use render_to_string shortcut from Django. I essentially have just a shell page and JS code with fetch that gets this rendered page and displays it. Everything works as before the change but my JS code included with script tags is not being run. The scripts are part of the page, just not executed. I don't know what exactly to Google in this situation.. I am using the static Django tag to get the scripts URLs. This is my code used to get the output of render_to_string: <script> function writeBody() { fetch('{% url 'load-detail' lookup_id %}') .then(res => { return res.text(); }) .then(data => { document.querySelector('html').innerHTML = data; }); } -
How do I list a model's objects in a different model's list view?
I'm building a small accounting module to track the payments we make for our clients. I want to display the payments made for a client in the client's detail view page. I couldn't get the for loop to work. How do I go about this? I tried adding the other model as a context but it didn't work. Thanks in advance. models.py class Client(models.Model): client_title = models.CharField(max_length=200) client_initial_balance = models.DecimalField(max_digits=10, decimal_places=2, default=0) client_balance = models.DecimalField(max_digits=10, decimal_places=2, default=0) client_total_deposit = models.DecimalField(max_digits=10, decimal_places=2, default=0) client_total_spent = models.DecimalField(max_digits=10, decimal_places=2, default=0) def get_absolute_url(self): return reverse("books:client-detail", kwargs={"id": self.id}) class Transaction(models.Model): client_title = models.ForeignKey(Client, on_delete=models.CASCADE, related_name="transactions") transaction_spender = models.ForeignKey(Spender, on_delete=models.CASCADE) transaction_amount = models.DecimalField(max_digits=10, decimal_places=2, default=0) transaction_details = models.TextField() views.py class ClientDetailView(DetailView): template_name = 'clients/client_detail.html' def get_object(self): id_ = self.kwargs.get("id") return get_object_or_404(Client, id=id_) def get_context_data(self, **kwargs): context = super(ClientDetailView, self).get_context_data(**kwargs) context["transaction_list"] = Transaction.objects.all() return context class TransactionListView(ListView): template_name = 'clients/client_detail.html' queryset = Client.objects.all() model = Transaction def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) return context client_detail.html <div class="container"> <h1> {{ object.client_title }}</h1> <section class="section section-stats"> <div class="row"> <div class="col s12 m4"> <div class="card-panel"> <h6 class="bold">Total Spending</h6> <h1 class="bold">$... </h1> </div> </div> <div class="col s12 m4"> <div class="card-panel"> <h6 class="bold">Total Deposits</h6> <h1 class="bold">$... </h1> </div> </div> <div class="col s12 …