Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
'TemplateDoesNotExist at /' error during local development
I am following two scoops of django and mozilla tutorial for deploying my app. I set up a virtual env and base setting, local setting,etc and when i ran the command : ./manage.py runserver 0:8000 --settings=Books.settings.local the browser showed the error, template home not found... I think there might be some problem due to the env, i am not sure. base.py import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '2z9y' # Simplified static file serving. # https://warehouse.python.org/project/whitenoise/ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' ALLOWED_HOSTS = ['127.0.0.1', 'localhost','https://hackingonlineeducation.herokuapp.com'] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', #third party apps 'star_ratings', 'crispy_forms', #my_apps 'newsletter', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'Books.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR,'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'Books.wsgi.application' # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, … -
Virtual environment not activating - unauthorized access error
I'm trying to activate a virtual environment using the following in PowerShell env_project1\scripts\activate I'm following instructions from an online tutorial called the django book. But this gives me the following error env_project1\scripts\activate : File C:\Users\Admin\Documents\project1\env_project1\scripts\activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 + env_project1\scripts\activate + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess This used to work when I was using django from the same tutorial a few months ago, and I'm confused as to how to fix this. The link in the instructions just redirects to msn. Thanks! -
Django css file is not working
I'm new in Django and get problem. I have: STATIC_URL = '/static/' STATIC_ROOT = '/static/' at my settings.py, have Project/mainapp/static folder and css/header.css inside that folder. Also i have {% load staticfiles %} <link rel="stylesheet" href="{% static 'css/header.css' %}" type="text/css"> at my header html. Browser tries localhost/static/css/header.css but find nothing there. What am i doing wrong? Thanks! -
django celery error "Apps aren't loaded yet" All recommended fixes I've tried has failed - I believe I have settings configured incorrectly somewhere
My goal is to use celery to use celery to automatically run script on my site each day. I followed the instructions for first steps with Django here. After I have all of my setting configured, I use celery -A project worker --loglevel=info and the server seems to start fine. When I attempt to import the tasks app it can't find the module, it says it doesn't exist, but it works if I explicitly call folder.tasks. If I call function.delay() I get the following error: raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. I do a few searches and try adding a recommendation of using Django-Q. After I put it at the bottom of installed apps and attempt to python manage.py migrate celery, I get the same AppRegistryNotReady error as before but when I attempt to start celery. I tried adding import django | django.setup() in my settings.py as recommended by someone. How can I fix this issue? here is the traceback C:\Users\Jup\PycharmProjects\Buylist_django>python manage.py migrate Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "C:\Program Files\Python36\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line utility.execute() File "C:\Program Files\Python36\lib\site-packages\django\core\management\__init__.py", line 365, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Program Files\Python36\lib\site-packages\django\core\management\__init__.py", line 216, … -
Related Field got invalid lookup :exists
In my database, I have a Photo class, that I use as a foreignkey to other classes. These are two examples of such. class SubstancePointsLabel(ResultBase): #: photo being labeled photo = models.ForeignKey(Photo, related_name='substance_points_labels') class SubstancePoint(EmptyModelBase): #: photo photo = models.ForeignKey(Photo, related_name='substance_points') The only difference in these instances the ResultBase and EmptyModelBase but nothing in seems (to me) to be the cause. class EmptyModelBase(models.Model): """ Base class of all models, with no fields """ def get_entry_dict(self): return {'id': self.id} def get_entry_attr(self): ct = ContentType.objects.get_for_model(self) return 'data-model="%s/%s" data-id="%s"' % ( ct.app_label, ct.model, self.id) def get_entry_id(self): ct = ContentType.objects.get_for_model(self) return '%s.%s.%s' % (ct.app_label, ct.model, self.id) class Meta: abstract = True ordering = ['-id'] class ResultBase(UserBase): """ Base class for objects created as a result of a submission """ #: The MTurk Assignment that the user was in when this record was created mturk_assignment = models.ForeignKey( 'mturk.MtAssignment', null=True, blank=True, related_name='+', on_delete=models.SET_NULL ) #: True if created in the mturk sandbox sandbox = models.BooleanField(default=False) #: This has been marked by an admin as invalid or incorrect AND will be #: re-scheduled for new labeling. This can happen when an experiment is #: changed and things need to be recomputed. invalid = models.BooleanField(default=False) #: The method … -
The fun of django form datetime pickers
So I've explored several ways of trying to add a date time picker to my django forms. It's been ugly. I've found one that I've gotten to work well here. It looks good and works...sort of. The new problem becomes I'm rendering my datetime fields in a formset, so I need to add an index value to the id field of the element. That means something like clock_in = forms.DateTimeField(widget=DateTimePicker(attrs={'class': 'form-control', 'id': 'datetimepicker1'})) will not work. datetimepicker# needs to be indexed for each element the formset generates. Can I even do that? If so, how. Are there easier\better ways to graphically select a datetime for input (like the django admin)? -
Using Pika with Django (Event-based microservice using django rest framework)
anyone here has experience implementing pika with Django? I am basically running an event-based microservice using django rest framework. And using RabbitMQ as the message bus. I know the default library to use in this case would be Celery, but I am looking for a lighter version where I can just implement a simple pub / sub on the messages. Has anyone implemented such a service using pika before? My question is more how do you spawn pika as a separate process together with Django? Or is there a more elegant solution out there? Thanks in advance. -
Django sitemap.xml doesn't show my domain
I'm creating a sitemap.xml file through from django.contrib.sitemaps.views import sitemap but it actually comes out with the file in that way below. My domain is replaced with example.com and I can't fix it because the file is not editable in the usual way. <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://example.com/</loc> <changefreq>never</changefreq> <priority>0.5</priority> </url> <url> <loc>http://example.com/recruit/</loc> <changefreq>never</changefreq> <priority>0.5</priority> </url> <url> <loc>http://example.com/contact/</loc> <changefreq>never</changefreq> <priority>0.5</priority> </url> <url> <loc>http://example.com/success/</loc> <changefreq>never</changefreq> <priority>0.5</priority> </url> </urlset> Any help would be appreciated!! -
how to pass the url of image clicked on my html file to my python function in views.py Django
i want to pass the url of the image that was selected by the user in my python function views.py because my python function will process the image that was selected by the user. this is my html command <!DOCTYPE html> <html> <head> <link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <meta charset=utf-8 /> <title>JS Bin</title> <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <style> article, aside, figure, footer, header, hgroup, menu, nav, section { display: block; } </style> </head> <body> <input type='file' onchange="readURL(this);" /> <img id="blah" src="#" alt="your image" /> <script> function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#blah') .attr('src', e.target.result) .width(150) .height(200); }; reader.readAsDataURL(input.files[0]); } } </script> </body> </html> and here is the function on my python def predict(): img = cv2.imread('C:/Users/HABITUS/Desktop/arvin files/download.jpg') #the url of the image selected must be here!! img = cv2.resize(img, (600, 600)) enhancer = Image.fromarray(img) enhancer = ImageEnhance.Contrast(enhancer) enhanced = enhancer.enhance(1.5) enhancer1 = ImageEnhance.Brightness(enhanced).enhance(1.3) convert = scipy.misc.fromimage(enhancer1) imgM = cv2.medianBlur(convert, 5) # blurring and smoothening kernel = np.ones((5, 5), np.uint8) erosion = cv2.erode(imgM, kernel, iterations=1) dilation = cv2.dilate(erosion, kernel, iterations=1) blur = cv2.GaussianBlur(convert, (15, 15), 10) grayscaled = cv2.cvtColor(imgM, cv2.COLOR_BGR2GRAY) retval2, … -
ejabbered xmpp server chat integration with django api
I am trying to integrate ejabbered with django api. I am unable to understand which package to use. Can any one tell me the steps to integrate jabbered with django user table. I also want to know its flow to establish chat in app end. I am unable to figure out the package to use in django for xmpp. Any help will be appreciated. I know that i have to include the ejabbered password and username in user table. -
How to set limit of redisearch default limit is 10 . i want to set 50
from redisearch import Client client = Client('myIndex') res = client.search(search_key)# i want 50 results here -
Django: Modify an Active Directory User
So I am trying to modify a user in my active directory. As of now I can log in as an AD-user but when I try to edit my profile, it does not implement in the AD. I made a connection with a user that has reading an writting permissions. AUTH_LDAP_SERVER_URI = "ldap://192.168.1.12" AUTH_LDAP_BIND_DN = "user" AUTH_LDAP_BIND_PASSWORD = "password" AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_DEBUG_LEVEL: 1, ldap.OPT_REFERRALS: 0 } AUTH_LDAP_USER_SEARCH = LDAPSearch("DC=sb,DC=ch", ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)") # Set up the basic group parameters. AUTH_LDAP_GROUP_SEARCH = LDAPSearch("DC=sb,DC=ch", ldap.SCOPE_SUBTREE, "(objectClass=group)") AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType() # What to do once the user is authenticated AUTH_LDAP_USER_ATTR_MAP = { "first_name": "givenName", "last_name": "sn", "email": "mail" } AUTH_LDAP_USER_FLAGS_BY_GROUP = { "is_active": "CN=ipa-users,cn=users,DC=sb,DC=ch", "is_staff": "CN=ipa-users,cn=users,DC=sb,DC=ch", "is_superuser": "CN=ipa-users,cn=users,DC=sb,DC=ch" } # This is the default, but be explicit. AUTH_LDAP_ALWAYS_UPDATE_USER = True # Use LDAP group membership to calculate group permissions. AUTH_LDAP_FIND_GROUP_PERMS = True # Cache settings AUTH_LDAP_CACHE_GROUPS = True AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600 AUTHENTICATION_BACKENDS = ( 'django_auth_ldap.backend.LDAPBackend', 'django.contrib.auth.backends.ModelBackend', ) So what and where do I have to set or get anything? This is my edit_profile.html: <form method="post"> {% csrf_token %} <label for="first_name">Vorname </label> <input style="margin-bottom: 1em;" id="first_name" class="form-control" type="text" name="first_name" value="{{ user.first_name }}"><br> <label for="last_name">Nachname </label> <input style=" margin-bottom: 1em;" id="last_name" class="form-control" type="text" name="last_name" value="{{ … -
wagtail - How to get all pages in footer with slug in all pages
HI Tried with template tag register = template.Library() @register.simple_tag(takes_context=True) def get_all_pages(context): context['all_page'] = Page.objects.live() return context and in my template {% get_all_pages as queries %} {% for each in queries %} {{each.page_title}} {% endfor %} All pages are not passed in my templates , i want to add all pages in footer please help -
Django-filter | Boolean fields
I'm using django-filter package and I have many boolean fields. Is there a way to filter only when field is True? And show all other posibilities? For example if I have 3 fields: True, False, False... Render objects that have 1st field equal True but doesn't matter about de rest, don't consider it False. -
Django HTML drop-down list does not show the selected option
I have had this code working before, but now it does not show the selected option in the drop-down list. I just need an extra pair of eyes to look over this and let me know what is hiding in plain sight <form action="" method="GET" id="global_project"> {% csrf_token %} <select name="project_selector" id="ps" class="" autofocus onChange="this.form.submit();"> {% if project %} {% for project_name in projects_names %} <option value="{{ project_name|replace_space_with_underscore|replace_apostrophe_with_star }}" {% if project_name == project %} selected="selected" {% endif %} > {{project_name.name}} </option> {% endfor %} {% else %} <option name="project" value="setup">Setup a Project</option> {% endif %} </select> </form> -
IntegrityError when delete model instance
I have two models like class A(models.Model): title = models.CharField(max_length=255) class B(models.Model): recommendation = models.ForeignKey(A, related_name="+") title = models.CharField(max_length=255) When I remove the A model instance, I get something like: IntegrityError: update or delete on table "myapp_a" violates foreign key constraint "myapp_relate_recommendation_id_4a7c5340_fk_myapp_a_id" on table "myapp_b" Detail: Key (id)=(27527) is still referenced from table "myapp_b". I can't figure out why it happens, I thought FKs should be deleted by default. -
How to hide fields for specific record in django-admin?
How to hide field for specific record in djano-admin? For example if I have a model class Book(models.Model): title = models.CharField(..., null=True) author = models.CharField(...) I want to hide an author in admin panel for record with pk = 1. I found the solution as class BookAdmin(admin.ModelAdmin): list_display = ("pk", "get_title_or_nothing") def get_form(self, request, obj=None, **kwargs): if obj.pk == "1": self.exclude = ("author", ) form = super(BookAdmin, self).get_form(request, obj, **kwargs) return form It works well untill I am coming back from record with pk == 1 to other records, in this case all records in table have hided author field. -
javascript template for showing table body
I am using ajax for updating/refreshing the cart when an item is removed from the cart table to show the updated items. ajax functionality and logic is working but could not show the following template inside <tbody class="cart-body"> {% for furniture in cart.furnitures.all %} <tr class="cart-products"> <td class="action"> {% include 'includes/carts/remove-furniture.html' with furniture_id=furniture.id%} </td> <td class="cart_product_img"> {% if furniture.first_image %} <a href="#"> <img src="/media/{{ furniture.first_image.url }}" alt="" class="img-responsive"> </a> {% else %} <a href="#"> <img src={% static 'img/default.jpg' %} alt="" class="img-responsive"> </a> {% endif %} </td> <td class="cart_product_desc"> <h5>{{ furniture.name }}</h5> </td> <td class="price"> <span>Rs. {{ furniture.price }}</span></td> <td class="qty"> <div class="quantity"> <span class="qty-minus" <i class="ion-ios-minus-outline" aria-hidden="true"></i> </span> <input type="number" class="qty-text" id="qty" step="1" min="1" max="99" name="quantity" value="1"> <span class="qty-plus" <i class="ion-ios-plus-outline" aria-hidden="true"></i> </span> </div> </td> <td class="total_price"> <span>Rs 49.88</span></td> </tr> {% endfor %} </tbody> the following template is shown when user is routed to /carts page but when the update part is done, ajax is used and the template i tried is as following success: function(data) { var hiddenCartItemRemoveForm = $(".cart-item-remove-form") if (data.products.length > 0){ productRows.html(" ") $.each(data.products, function(index, value){ var newCartItemRemove = hiddenCartItemRemoveForm.clone() newCartItemRemove.css("display", "block") newCartItemRemove.find(".cart-item-product-id").val(value.id) cartBody.prepend( "<tr><td class='action'>" + newCartItemRemove.html() +"</td><td class='cart_product_img'><a href=""><img src="media/"+data.image class='img-responsive'></a></td><td class='cart_product_desc'><h5>"+value.name+"</h5></td><td class='price'>"+value.price+"</tr>" ) … -
why admin panel of django appears different in production version?
first of all, I don't know whether it's only my issue or someone else have it too. my production version of django admin (which I use it in my website) looks different from what I see, when I lunch a project on my personal computer. you can see the difference In two pictures : local version (127.0.0.1:8000) production version (mywebsite) something that I want to mention: I did not edited the admin template I used collectstatic command in production version Checked it with different browsers Version of django is 1.11 in both server and local So do I have to do something else after doing collectstatic ? -
SMTPServerDisconnected: Connection unexpectedly closed, django, celery?
hello i want to sending email activation this is my settings EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'email' EMAIL_HOST_PASSWORD = 'pass' EMAIL_PORT = 587 EMAIL_USE_TLS = True when i try to send email by celery i get this error, on local server sending email is work, but not work registration, how to solve? maybe because i have ssl, and i use all tls? Traceback (most recent call last): File "/webapps/theband/lib/python3.5/site-packages/celery/app/trace.py", line 240, in trace_task R = retval = fun(*args, **kwargs) File "/webapps/theband/lib/python3.5/site-packages/celery/app/trace.py", line 438, in __protected_call__ return self.run(*args, **kwargs) File "/webapps/theband/src/accounts/tasks.py", line 22, in send_some_email_task msg.content_subtype = 'html' File "/webapps/theband/lib/python3.5/site-packages/django/core/mail/message.py", line 348, in send return self.get_connection(fail_silently).send_messages([self]) File "/webapps/theband/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 104, in send_messages new_conn_created = self.open() File "/webapps/theband/lib/python3.5/site-packages/django/core/mail/backends/smtp.py", line 64, in open self.connection = self.connection_class(self.host, self.port, **connection_params) File "/usr/lib/python3.5/smtplib.py", line 251, in __init__ (code, msg) = self.connect(host, port) File "/usr/lib/python3.5/smtplib.py", line 337, in connect (code, msg) = self.getreply() File "/usr/lib/python3.5/smtplib.py", line 393, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed -
Django service on gunicorn POST request is recieved as GET?
I have a Django rest service running on virutal environment on gunicorn server with the following .wsgi file: import os, sys import site site.addsitedir('/opt/valuation/env/lib/python2.7/site-packages') sys.stdout = sys.stderr os.environ['DJANGO_SETTINGS_MODULE'] = 'valuation.valuationcont.valuation.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() When I do curl POST call the service works perfectly: curl -H "Content-Type: application/json" -X POST -d '{...}' -u username:password http://localhost:8000/valuation/predict/ But when I do the same request on API gateway using axios, Django service responds my custom GET response ("GET not supported, try POST"). axios({ method: 'post', url:'http://localhost:8000/valuation/predict', headers:{ "Content-Type":"application/json", "Authorization":"Basic [BASE64 ENCODING]" }, data:{ ... } }).then(response=>{ console.log(response.data) }).catch(err=>{ console.log(err.toString()) }) The request is transformed from GET to POST. This only happens with the django/gunicorn service. Since I am new to django/gunicorn I think there is something wrong with the .wsgi file. But how come the curl call then works? Any help appreciated, been struggling with this for a week now. -
Spaces and special characters in URL - django
My URL is as follows: test/One%20**&**%20Two/edit django URLs: r'^(?P<test>[\w\-]+)/(?P<text>[\w\s]+)/edit/$' Can anyoen tell me why django is not able to display page ? ( I see Page not found (404) ) -
How much data can be serialized by Django
For instance i have millions of users and i want to serialize all users data and return it when client requests, so client can get list of all users. Also is this a is a good approach? performance wise. -
could not connect to server, django, celery, sqlite3, how to solve?
when i send register tast, email sending, like register is successes, but it's not, email is correct, but it's cannot to work, beacuse user have no in a database. redis, celery is runnig, sending on email tasks is executing! P.S. i'm using sqlite3 database! raised unexpected: OperationalError('could not connect to server: Connection refused (0x0000274D/10061)\n\tIs the server running on host "localhost" (::1) and accepting\n\tTCP/IP connections on port 5432?\ncould not connect to server: Connection refused (0x0000274D/10061)\n\tIs the server running on host "localhost" (127.0.0.1) and accepting\n\tTCP/IP connections on port 5432?\n',) Traceback (most recent call last): File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\celery\app\trace.py", line 240, in trace_task R = retval = fun(*args, **kwargs) File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\celery\app\trace.py", line 438, in __protected_call__ return self.run(*args, **kwargs) File "C:\Users\P.A.N.D.E.M.I.C\Desktop\Dev\Deploy__\theband\src\accounts\tasks.py", line 34, in register_task email=email File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\contrib\auth\models.py", line 159, in create_user return self._create_user(username, email, password, **extra_fields) File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\contrib\auth\models.py", line 153, in _create_user user.save(using=self._db) File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\contrib\auth\base_user.py", line 80, in save super(AbstractBaseUser, self).save(*args, **kwargs) File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\db\models\base.py", line 808, in save force_update=force_update, update_fields=update_fields) File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\db\models\base.py", line 835, in save_base with transaction.atomic(using=using, savepoint=False): File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\db\transaction.py", line 158, in __enter__ if not connection.get_autocommit(): File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\db\backends\base\base.py", line 385, in get_autocommit self.ensure_connection() File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\db\backends\base\base.py", line 213, in ensure_connection self.connect() File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\db\utils.py", line 94, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "c:\users\p.a.n.d.e.m.i.c\desktop\dev\theband\lib\site-packages\django\utils\six.py", line 685, … -
Django-filter | How to render boolean field
I'm using django-filter package and I want to filter by many boolean fields, but django renders it as . I try to declare the fields as: django_filters.BooleanFilter() and put it into class Meta fields, but it has always been displayed in template as . How do I have to do it?