Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to remove or ignore part of a url in django?
I'm developing a multi tenant application that takes the tenant via path. Ex: www.project.com/tenant1/ or www.project.com/tenant2/. I have created, following a tutorial (http://books.agiliq.com/projects/django-multi-tenant/en/latest/shared-database-shared-schema.html) codes that resolve the address, take the path and select the corect tenant. However, I can not find a way to ignore the tenant when the request arrives on the routes because the route is dynamic. Ex: When typing "www.project.com/tenant1/" is expected to return to index but for this to happen you must ignore the "tenant1/" in the routes. Here I solve the url and select the schema: def path_from_request(request): #get path print('Path:', request.get_full_path()) print('Path Striped: ', request.get_full_path().split("/")[1].lower()) return request.get_full_path().split("/")[1].lower() def tenant_schema_from_request(request): path = path_from_request(request) print('Path: ', path) tenants_map = get_tenants_map() print('Tenant Map: ', tenants_map.get(path)) return tenants_map.get(path) def set_tenant_schema_for_request(request): schema = tenant_schema_from_request(request) print('Schema ', schema) with connection.cursor() as cursor: cursor.execute(f"SET search_path to {schema}") def get_tenants_map(): return { "tenant1": "tenant1", "tenant2": "tenant2", } Here I try to redirect the url: urlpatterns = [ re_path(r'^(?P<slug>[\w-]+)/', admin.site.urls), ] I would like that by typing "www.project.com/tenant1/" or "www.project.com/tenant2/" the url will reply to my admin page. -
How can I write a unit test with pagination in django
I want to write unit tests for my project in django rest framwork but I can not compare my res.data with my serializer.data This is my json for one object Brand : { "count": 1, "next": null, "previous": null, "results": [ { "url": "http://localhost:8000/shops/tags/1/", "id": 1, "name": "PS4", "link": "https://www.playstation.com" } ] } This is my unit test : BRANDS_URL = reverse('brands-list') def test_retrieve_brand_list(self): """Test retrieving a list of brands""" Brand.objects.create(name='Bestbuy', link='https://bestbuy.ca') Brand.objects.create(name='Amazon', link='https://amazon.ca') res = self.client.get(BRANDS_URL) brands = Brand.objects.all().order_by('-name') context = {'request': RequestFactory().get('/')} serializer = BrandsSerializer(brands, context=context, many=True) self.assertEqual(res.status_code, status.HTTP_200_OK) self.assertEqual(res.data, serializer.data) My serializer : class BrandsSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Brand fields = ('url', 'id', 'name', 'link') How I can add count, next, previous and results to my serializer.data ? How I can have a serializer.data like res.data ? I'm a little lost, I can not find a solution -
Usefulness of GraphQL
I am relatively new to learning Graphql. I am working with another developer who is designing the front end in ReactJS and backend in Django. His opinion regarding Graphql is that it is not necessary and can use MySql and Django ORM instead. I am not sure what benefit then Graphql brings if entire development can be done using only ReactJS, DjangoORM and MySql. -
Why can't I save to an IO Buffer?
I'm trying to save png plot to a buffer and read and save the bytes into S3 in order to avoid saving locally on my ElasticBeanstalk instance. However everytime I try this, I get the following error: PermissionError: [Errno 13] Permission denied: '/home/wsgi' The code that triggers this error is: buf = io.BytesIO() plt.savefig(buf, format="png") What causes this error and how do I fix it? -
Django Models - Create ManyToManyField that connects to the members of a group
I have these models: Users, Grades, Groups, Projects, Tasks. Every Grade, has Users (that can be student or teacher). The teacher can create groups of students. How do I create a ManyToManyField that connects to the specific users of that Grade? Right Now when I try to make a group, it inherits from Grades and I get EK17A, TE17A (Note that i want to get the users in EK17A, or the users in EK17A) This is so the teacher can put the students into project groups :D from django.db import models # Create your models here. from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver # Create your models here. class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) age = models.IntegerField() description = models.CharField(max_length=300) is_student = models.BooleanField(default=False) is_teacher = models.BooleanField(default=False) class Meta: verbose_name_plural = 'User Profiles' def __str__(self): return self.user.username @receiver(post_save, sender=User) def create_user_data(sender, update_fields, created, instance, **kwargs): if created: user = instance profile = UserProfile.objects.create(user=user, is_teacher=False, is_student=True, age=18, description='No Description') class Grades(models.Model): name = models.CharField(max_length=10) members = models.ManyToManyField(UserProfile, blank=True) class Meta: verbose_name_plural = 'Grades' def __str__(self): return self.name class TeacherProjectTask(models.Model): title = models.CharField(max_length=150) description = models.CharField(max_length=1000, blank=True) state = models.CharField(max_length=20) class Meta: verbose_name_plural = … -
local variable 'form' referenced before assignment error
i am new to django 2.x .. trying to create blog project as a training to me i have a problem error UnboundLocalError at /create_post/ local variable 'form' referenced before assignment this error will made me mad this is my views.py file # views.py def add_post (request): if request.method=='POST': form = postform(request.POST) if form.is_valid(): form.save() else: form=postform() context = { 'form': form } return render(request, 'create_post.html', {}) and this my models.py file # models.py from django.db import models from django.utils.timezone import now # Create your models here. class post (models.Model): Post_Title = models.CharField (max_length=200) Post_Image = models.ImageField(upload_to='post/statics/img/') Post_Text = models.TextField() Post_Date = models.DateTimeField(default=now, editable=False) def __str__(self): return self.Post_Title this is my create_post.html file # create_post.html <form method="post"> {% csrf_token %} {{ form }} <button type="submit"}>save new post</button> </form> this is my forms.py file # forms.py from django import forms from .models import * class postform (forms.ModelForm): class Meta: model = post fields = ['Post_Title', 'Post_Image', 'Post_Text'] this is the error what i got UnboundLocalError at /create_post/ local variable 'form' referenced before assignment Request Method: GET Request URL: http://127.0.0.1:8000/create_post/ Django Version: 2.2.1 Exception Type: UnboundLocalError Exception Value: local variable 'form' referenced before assignment Exception Location: D:\PEPSI\PycharmProjects\bloggersystem\post\views.py in add_post, line 29 Python … -
Saleor Ecommerce-Uploading images in the content field of pages
I want to be able to add images in the content of a new page in saleor. I have been searching about it and saw it use medium editor to style the text. Currently(as far as I know), the only way to display a picture is by pasting the link, selecting it and then when thy style bar pops you click on image icon( convert selected text to image). After doing that the image displays but it is not responsive to different screen sizes and you cannot adjust in size when editing. I search and found out a medium-insert-plugin but don't know the correct approach to implement it. -
How do do a multi-table join in Django with aliases
Ok, i'm having some trouble understanding on Django does joining and aliasing. I have four tables defined as such in my models: (i've removed un-pertinent columns) class Field(models.Model): name = models.CharField(max_length=200, default='') class Survey(models.Model): name = models.CharField(max_length=200, default='') class Question(models.Model): text = models.CharField(max_length=200, default='') survey = models.ForeignKey(Survey) class Answer(models.Model): question = models.ForeignKey(Question) field = models.ForeignKey(Field) Now I can write a very simple and easy to understand sql query to get exactly what I want. which would look like this: SELECT s.id, s.name, q.id as q_id, q.text, f.id as f_id, f.name as answer FROM "App_survey" s JOIN "App_question" q ON q.survey_id = s.id JOIN "App_answer" a ON a.question_id = q.id JOIN "App_field" f ON a.field_id = f.id; But I can't for the life of me figure out how to do this using the orm. I can't even get two tables joined and select the data from both let alone deal with the aliasing. This is as far as I've gotten: questions = Question.objects.prefetch_related('survey') questions_dict = [{'form':x.name, 'id':x.id, 'question':x.text} for x in questions] This gives me a 'Question' object has no attribute 'name' error. Note: this is postgres and python and I am new to both. -
How to add RateYo to Django project
I plan on using the RateYo jQuery plugin within my Django project but there are a variety of parts I plan on changing and therefore I would like to have all the files directly within my project (unless I can easily modify RateYo options with CDNjs imports) The official RateYo website shows a variety of methods of implementation but with a Django project structure, I'm not quite sure how to adapt the installation guide. I have the following project architecture: PWEB |--> exchange | |--> __pycache__ | |--> migrations | |--> static | | |--> exchange | | | |--> assets | | | | |--> css | | | | | |--> *.css | | | | |--> fonts | | | | |--> js | | | | | |--> ..., jquery.min.js, jquery2.min.js, ... | | | | |--> sass | | | |--> images | |--> templates | | |--> exchange | | | |--> *.html | |--> *.py |--> PWEB | |--> __pycache__ | |--> *.py |--> manage.py |--> *.* As you can see, I already have a jquery.min.js file in my project (even a second one). Should I add the file within the RateYo zip … -
Send item selecto from form-control in templato django to views
I'm sending a list of values, 1 to 42, from views to template, for user choose what value return to the views, for me use it, but for some reason the returned value is always the firsti value from the list, how can I take the selected value? Code from the views: def gerar_graficos(request): descricao = '01/02/2019 08:00' descricao2 = '01/02/2019 09:00' item_unidade = 0 if request.method=='POST': descricao = request.POST['descricao'] descricao2 = request.POST['descricao2'] item_unidade = request.Post['item_unidade'] unidade2 = ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27', '28','29','30','31','32','33','34','35','36','37','38','39','40','41','42'] Show this error: AttributeError at /polls/ 'WSGIRequest' object has no attribute 'Post' Editing this views to that, returns the first value from the list: def gerar_graficos(request): descricao = '01/02/2019 08:00' descricao2 = '01/02/2019 09:00' item_unidade = 0 if 'is_private' in request.POST: item_unidade = request.POST['item_unidade'] else: is_private = False if request.method=='POST': descricao = request.POST['descricao'] descricao2 = request.POST['descricao2'] unidade2 = ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27', '28','29','30','31','32','33','34','35','36','37','38','39','40','41','42'] template code: <form method="POST"> {% csrf_token %} <label for="Unidades">Selecione unidade</label> <select class="form-control" id="item_unidade"> {% for item_unidade in unidade2 %} <option>{{ item_unidade }}</option> {% endfor %} </select> <input type="submit"> -
Why doesn't the {% empty %} option show when no items available?
I have set up a "for/in" loop in a django template with an "empty" option, but when my view produces no items I get a 404 page instead of my "empty" option. I have tried subbing in an "if" tag, but get the same result. Template code: {% for item in object_list %} <p>{{ item.desc }} {% empty %} <p>Nothing scheduled {% endfor %} views.py: class ItemTodayArchiveView(LoginRequiredMixin, TodayArchiveView): login_url = '/admin/' redirect_field_name= 'redirect_to' date_field = 'airpub_date' allow_future= True def get_queryset(self): destination = self.kwargs['destination'] return Item.objects.filter(airpub_date__gte=date.today()).filter(destination=destination) When the queryset is empty (i.e., there's nothing with that airpub_date) I want the template page to show "Nothing scheduled". Instead I'm getting a 404 debug page: Page not found (404) Request Method: GET Request URL: http://xxx.xxx.xxx/items/atc/today/ Raised by: items.views.ItemTodayArchiveView No items available -
Using existing user database made with Django in ASP.NET app?
I've taken over for a programmer who build a web app using django. I'm building a new web app using asp.net and it's been requested that both apps have a common login system. They both run on heroku and use postgresql databases in AWS. The django app has an existing database containing user credentials. I don't know too much about python or django but I'm trying to figure out how I can use that database for both apps. The passwords in the database look like this in the admin panel: algorithm: pbkdf2_sha256 iterations: 120000 salt: EhIX0s****** hash: DTJYel************************************** I have the source code for the django app but I can't find any code that clearly shows how it encrypts the password or how users are authenticated. I can't even find a reference to the html id of the password entry box. The app uses some libraries that I believe are related: cachetools, google authentication, rsa, pyasn1, and others. The developer of the original app is gone and I know I haven't given too much context to a point in the right direction would be greatly appreciated. I've tried looking through the code for anything that has to do with encryption … -
Calling a function with URL parameter to get argument for .as_view() Is it possible?
Here's my current code: form_list = [PilotForm, BriefingsForm] ... url(r'^inspections/(?P<inspection_type_id>[0-9]+)/new-inspection/$', InspectionWizard.as_view(form_list), name='new_inspection'), what I want to achieve is so that I could have a function that would dynamically return form_list based on inspection_type_id (url param): it would look like: def get_form_list(inspection_type_id): forms_list = [] # dynamically filter forms and add to forms_list return forms_list ... url(r'^inspections/(?P<inspection_type_id>[0-9]+)/new-inspection/$', InspectionWizard.as_view(get_form_list(inspection_type_id), name='new_inspection'), Is it possible to do this ? -
Adding UUIDs to my Django app yields a NoReverseMatch error
I have a books app using a UUID with a listview of all books and detailview of individual books. I keep getting the following error message: NoReverseMatch at /books/ Reverse for 'book_detail' with arguments '('/books/71fcfae7-bf2d-41b0-abc8-c6773930a44c',)' not found. 1 pattern(s) tried: ['books/(?P<pk>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$'] Here is the models.py file: # books/models.py import uuid from django.db import models from django.urls import reverse class Book(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) title = models.CharField(max_length=200) author = models.CharField(max_length=200) price = models.DecimalField(max_digits=6, decimal_places=2) def __str__(self): return self.title def get_absolute_url(self): return reverse('book_detail', args=[str(self.id)]) The urls.py file where I'm using to convert the id from the model to a uuid. # books/urls.py from django.urls import path from .views import BookListView, BookDetailView urlpatterns = [ path('', BookListView.as_view(), name='book_list'), path('<uuid:pk>', BookDetailView.as_view(), name='book_detail'), ] The views.py file: from django.views.generic import ListView, DetailView from .models import Book class BookListView(ListView): model = Book context_object_name = 'book_list' template_name = 'books/book_list.html' class BookDetailView(DetailView): model = Book context_object_name = 'book' template_name = 'books/book_detail.html' And the relevant templates file. <!-- templates/book_detail.html --> {% extends '_base.html' %} {% block content %} {% for book in book_list %} <div> <h2><a href="{% url 'book_detail' book.get_absolute_url %}">{{ book.title }}</a></h2> </div> {% endfor %} {% endblock content %} I believe I'm implementing this correctly … -
Django Query for Total Count of Records In ManyToMany Field
Given two models joined by a ManyToMany without a through table: class Ingredient(models.Model): name = models.CharField(max_length=255) class Recipe(models.Model): name = models.CharField(max_length=255) ingredients = models.ManyToManyField(Ingredient) How do I find the total count of instances of an ingredient being used in a recipe? For example, if I had two ingredients (apples and sugar) and two recipes (apple pie and donuts) how would I know that there are 3 uses of recipes (two because apple pie uses apples and sugar, and one because donuts use sugar)? I could do this with the following: count = 0 for recipe in Recipe.objects.all(): count += recipe.ingredients.count() but that generates too many queries. Is there an easy way to get this number with annotation / aggregation? -
Communication between two POST requests
Question I have a Django form in which the user submits a text search string (full example setup below). Question: how can (and should) two POST requests, currently handled by the same view tied to the same URL pattern, "talk" to each other via the first post request passing off data to the second? Currently, everything lives within the same URLconf path and is handled differently based on (1) whether the request is GET/POST, (2) what the POST request name/value attributes are from its <input> tag. Setup Imports: import csv from time import time_ns from django import forms from django import models from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from django.urls import path In my_app/urls.py: urlpatterns = [ path("run/<uuid:pk>", views.run), ] In my_app/forms.py: class RunForm(forms.Form): start = forms.DateTimeField() query = forms.CharField() In my_app/templates/my_app/run.html: <form method="post"> {% csrf_token %} <h1>Launch a search</h1> <table> {{ form.as_table }} </table> <input type="hidden" name="router" value="run"> <input type="submit" value="Submit"> </form> In my_app/templates/my_app/results.html: <table> {% for row in results %} <tr> {% for val in row %} <td>{{ val }}</td> {% endfor %} </tr> {% endfor %} </table> <form method="post"> {% csrf_token %} <input type="hidden" name="router" value="csv"> <input type="submit" value="Download to CSV"> </form> In my_app/views.py: … -
How do I query a generic relation queryset in Django to annotate a list with objects whos generic relations is the object?
Model with a Generic relations. I want MyModel.objects.filter() and do something to add a list containing the objects where their Generic relations is its row from MyModel.objects.filter() To clarify i want to list_of_my_models = MyModel.objects.filter() then do something so that i can for my_model in list_of_my_models: for related_my_model in my_model.related_my_models: // do something with related_my_model I tried using OuterRef in annotate with a Subquery, but get the error. "Expression contains mixed types. You must set output_field." When i visit the page that uses it. class MyModel(models.Model): x1= models.CharField(max_length=100) x2= models.CharField(max_length=255, blank=True) x3= models.CharField(max_length=255, blank=True) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.IntegerField() content_object = GenericForeignKey() def custom_models(object): my_models= MyModel.objects.filter(object_id=OuterRef('pk'), content_type=ContentType.objects.get(model='mymodel', app_label='app_my_model')) return MyModel.objects.filter( object_id=object.pk, content_type=ContentType.objects.get_for_model(object) ).annotate(related_my_models=Subquery(my_models)) So is there any way to fix this or is there an other way to achieve the desired outcome? -
Django IIS mixed-mode authentication can't login to Admin site
I have a Django site with IIS 8 and I have followed the Django Docs and this Stackoverflow ticket Django authenticate using logged in windows domain user and added RemoteBackendUser and ModelBackend. Plus I enabled Windows Authentication as well as Anonymous Authentication in my IIS site. I can login with Windows Authentication but I cannot login to Django Admin (http://mysite/Admin) The Admin login comes up and says myDomain\username is not authorized to see this page and my Django Superuser credentials simply do not work. Has anyone come across this and figured out a way around it? -
Django, collectstaic copy old files
I have settings for static files like this(everything is fine with the path - i use this settings for all projects): STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static/templates'), ) MEDIA_ROOT = os.path.join(BASE_DIR, 'media') in my static folder i have only one folder - templates, if i do colleectstatic when in my static folder only a one folder templates i will see this message: Tracking file by folder pattern: migrations You have requested to collect static files at the destination location as specified in your settings: /home/alex/projects/TEST_PROJECT/static This will overwrite existing files! Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: and if i type yes, django create a folders admin, rest_framework with files. If i will delete all files in static and copy my own files - for documentation(folders, html, css...) and type collectstatic djanango output the message: Tracking file by folder pattern: migrations You have requested to collect static files at the destination location as specified in your settings: /home/alex/projects/TEST_PROJECT/static This will overwrite existing files! Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: and if i type yes django … -
Django for loop inside JQuery gives me wird error, what I'm doing wrong?
I saw few examples of Django's for loop inside JQuery, but when I replicate it gives me console error, like doesn't read the {% for i...%}, please help, thanks in advance. $(document).ready(function() { event.preventDefault(); $('#calendar').fullCalendar({ defaultDate: '2019-05-31', editable: true, eventLimit: true, events:[ {% for i in sales_events %}<--gives error { title: "i.title", } {% endfor %} ] }); }); --errors-- Property assignment expected. Expression expected. ':' expected. -
Have Web viewer display local Host (http://127.0.0.1:8000/)
Currently I have a website built in python (Django) and have been using the browser (http://127.0.0.1:8000/) for testing the website. I am now entering the app development phase and would like to use the webviewer to display my site that is seen through the browser while running the python project. My current setup is this: Blocks: Any assistance would be much appreciated. -
React native Websocket connection with Django Channels is open but no messages get through
I have a react native app (android) communicating with Django channels. When connecting to my development server over ws, everything works fine. However, when I try to connect to my remote wss server with the same code, nothing gets through. The socket connection is showing as OPEN. I even receive this first "connected" message sent from the server to my app: class RGConsumer(AsyncWebsocketConsumer): rooms = [] async def connect(self): self.rooms = [] await self.join_room('all') await self.accept() await self.send(text_data=json.dumps({'event': 'connected'})) async def join_room(self, room_name): if room_name not in self.rooms: self.rooms.append(room_name) await self.channel_layer.group_add( room_name, self.channel_name ) The problem is that apart from this first message, nothing else goes through. For example whatever I send through this function never gets received by the app: def send_to_all(event, data=None): message = {'type': 'channel_event', 'message': {'event': event, 'data': data}} channel_layer = get_channel_layer() async_to_sync(channel_layer.group_send)( 'all', message ) In the same manner, when I call websocket.send on my app, the receive function of my consumer is not triggered at all. Once again, this works perfectly fine on my local server, so I assume the code is correct. It's only when connecting the app to the production wss server that it stops working (besides the first connected message that … -
BootstrapDialog does not work in my django project
I'm using BootstrapDialog to show a pop up but it does not work. My piece of code is: function monitor(user,ip,start_time,url){ var div_username = 'User: ' +'<span class="text-info">'+user+'' + </span>'; var div_ip = 'Server: ' +'<span class="text-info">' + ip + '</span>'; var div_time = 'Start Time: ' + '<span class="text-info">'+start_time +'</span>'; var title = div_username + div_ip + div_time; BootstrapDialog.show({ size: BootstrapDialog.SIZE_WIDE, title: title, cssClass: 'large-dialog', type: BootstrapDialog.TYPE_DEFAULT, message:$('<iframe src="' + url +'" frameborder="0" scrolling="no" onload="this.height=780;this.width=1030;this.contentWindow.focus();" onmouseover="this.contentWindow.focus();"></iframe>'), draggable: true }); return false; } -
DoesNotExist at /admin/login/ redux -- moved repo to new computer
I'm writing a django site and this error suddenly appeared on pulling my repo to a new computer. I'm having difficulty troubleshooting. I've already tried checking my URLs, which are all normal. I also tried deleting django.contrib.sites in settings (as per this Django admin DoesNotExist at /admin/), which caused another error, apparently because the relevant module is used all through django. from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import path, include, re_path from users import views as user_views urlpatterns = [ path('admin/', admin.site.urls), path('users/', include('users.urls')), path('chat/', include('chat.urls')), path('register/', user_views.register, name='register'), path('login/', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='users/logout.html'), name='logout'), path('profile/', user_views.profile, name='profile'), path('mail/', include('chat.urls')), re_path(r'^captcha/', include('captcha.urls')), re_path(r'^accounts/', include('allauth.urls')), ] -
CSS on Select Boxes for Windows Not Working like OSX
I have a piece of code that isn't working on Windows/Android but works fine on OSX and Linux. I know it has something to do with the CSS, but I can't figure out the issue. All the data in the select boxes don't display in the box. Both images below have the same values chosen. Windows OSX Here is my code: CSS input::placeholder { color: dodgerblue; } .filter-form { font-size: .75em; } .filter-form select { color: dodgerblue; border-radius: 0; margin: 0px; padding: 15px; display: block; height: 35px; width: 100%; border: 1px solid dodgerblue; font-family: "PT Sans", "Helvetica", sans-serif; font-weight: bold; } .filter-form input { color: dodgerblue; border-radius: 0; margin: 0px; padding: 15px; display: block; height: 35px; width: 100%; border: 1px solid dodgerblue; font-weight: bold; font-family: "PT Sans", "Helvetica", sans-serif; } And the code from the page: <div class="product-filter"> <h3>Filter By:</h3> <div class="sort"> <div class="collection-sort filter-form"> <form method="get"> {{ filter.form.as_p }} <button class="btn-a btn-a_size_small btn-a_color_theme" type="submit" style="margin:10px 0;">Filter Results </button> </form> </div> </div> </div>