Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django-allauth beginner problems
Django Version: 1.10.2 Python Version: 3.5.2 Django-allauth Version: 0.27 I am new to python and django. I have read several articles about how easy allauth is to get running. It has not been a happy beginner's journey for me. I am on an Ubunto shared hosting platform. I have a "local" pyenv python install. In the history of this project I have installed django-registration and got it to work fairly fast but the lur of social auth has hooked me and all the articles point at allauth. I am not far into this at all so I have ripped everything out and tried from scratch many, many times at this point. I have installed the allauth "requirements". At this moment I can python manage.py runserver and the system checks pass. However, if I visit the site in question I get the message: DoesNotExist at /accounts/login/ Site matching query does not exist. Traceback: File "/home/myUser/.pyenv/versions/3.5.2/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner 39. response = get_response(request) File "/home/myUser/.pyenv/versions/3.5.2/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/home/myUser/.pyenv/versions/3.5.2/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/myUser/.pyenv/versions/3.5.2/lib/python3.5/site-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/home/myUser/.pyenv/versions/3.5.2/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapper 67. return bound_func(*args, **kwargs) File "/home/myUser/.pyenv/versions/3.5.2/lib/python3.5/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper … -
Django migrate error : TypeError expected string or bytes-like object
I'm trying to learn django and error occur in changing models. I tried a lot like default=datetime.datetime.now but I dont know how to fix it. these are my models from django.db import models import datetime class Candidate(models.Model): name = models.CharField(max_length=10) introduction = models.TextField() area = models.CharField(max_length=15) party_number=models.IntegerField(default=0) def __str__(self) : return self.name class Poll(models.Model) : start_date = models.DateTimeField(default=datetime.datetime.now) end_date = models.DateTimeField(default=datetime.datetime.now) area = models.CharField(max_length=15) class Choice(models.Model) : poll = models.ForeignKey(Poll) candidate = models.ForeignKey(Candidate) votes = models.IntegerField(default=0) when I type commmand : python mangage.py migrate, this error occured Operations to perform: Apply all migrations: admin, ang, auth, contenttypes, sessions Running migrations: Applying ang.0003_poll_end_date...Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "C:\Python\Python35-32\lib\site-packages\django\core\management\__init__.py", line 367, in execute_from_command_line utility.execute() File "C:\Python\Python35-32\lib\site-packages\django\core\management\__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Python\Python35-32\lib\site-packages\django\core\management\base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "C:\Python\Python35-32\lib\site-packages\django\core\management\base.py", line 345, in execute output = self.handle(*args, **options) File "C:\Python\Python35-32\lib\site-packages\django\core\management\commands\migrate.py", line 204, in handle fake_initial=fake_initial, File "C:\Python\Python35-32\lib\site-packages\django\db\migrations\executor.py", line 115, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "C:\Python\Python35-32\lib\site-packages\django\db\migrations\executor.py", line 145, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "C:\Python\Python35-32\lib\site-packages\django\db\migrations\executor.py", line 244, in apply_migration state = migration.apply(state, schema_editor) File "C:\Python\Python35-32\lib\site-packages\django\db\migrations\migration.py", line 129, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "C:\Python\Python35-32\lib\site-packages\django\db\migrations\operations\fields.py", line … -
Django Rest- get fields of related model
I have two models "TestCases" and "IssueTestCases". IssueTestCases has a foreign key to TestCases. IssueTestCases model maps issues to test cases. I am want the data of all the test cases belonging to a particular issue. test_cases = IssueTestCases.objects.filter(issue_key="issue-2356") ser = IssueTestCasesSerializer(test_cases, many=True) print(ser.data) Gives: id = IntegerField(label='ID', read_only=True) test_case_name = CharField(max_length=500) description = CharField(style={'base_template': 'textarea.html'}) project_id = CharField(max_length=50, required=False) The response is model structure of TestCases NOT the data. What should I do to get the data? DETAILS--------------> These are the models of interest: class TestCases(models.Model): test_case_name = models.CharField(max_length=500) description = models.TextField() project_id = models.CharField(max_length=50, default=None) frequency = models.IntegerField(default=1) class IssueTestCases(models.Model): TEST_CASE_VERDICTS = ( (0, 'Failed'), (1, 'Pass') ) issue_key = models.CharField(max_length=50) test_case_id = models.ForeignKey(TestCases, on_delete=models.CASCADE, related_name='test_cases') verdict = models.IntegerField(choices=TEST_CASE_VERDICTS, null=True, blank=True) Serializers are: class TestCasesSerializer(serializers.ModelSerializer): class Meta: model = models.TestCases fields = ('id', 'test_case_name', 'description', 'project_id') class IssueTestCasesSerializer(serializers.ModelSerializer): my_field = serializers.SerializerMethodField('get_test_case_fields') def get_test_case_fields(self, foo): print(foo.test_case_id) return TestCasesSerializer(foo.test_case_id) class Meta: model = models.IssueTestCases fields = ('my_field',) -
Can I stack user-selected operations on a view's data?
So I have a recipes model, with a detail view called recipe_detail, which renders recipe_detail.html. Currently, I have two forms in the template: one for changing recipe servings, and one for changing recipe units (e.g. metric vs u.s.). My problem is that the operations don't stack, because the page refreshes. e.g. If I double a recipes servings from 4 to 8, the page will update. Then if I change the units to metric, the page will update again, but the servings will be back to 4. I see two potential sort-of-solutions to this: If servings and units are part of the same form, then the servings wouldn't need to go back to 4, but I'd need to re-compute the 4-8 effects when units were changed, which I'd like to avoid (it's slow). I'm thinking I could use AJAX for both of these forms - but I don't know enough about it to know if it would work. --> Would AJAX help solve this problem? If not, is there another good way to do this? I'm also wondering if I could just pass around my (e.g. servings modified) recipe object to new view instances, but I also don't know if that … -
using sqlserver 2008 in django1.8
Our workplace is invested in sqlserver2008 Ser but can't support django1.8 , MSSQL1.7 is not support django1.8,django-pyodbc-azure is also not working Are there any other ways for sqlserver2008 that are well django1.8? What are your experiences? -
Updating Django mixin subclassed instances
I am using my custom permission mixin on several of my apps's models (not all). For the case when I need to merge from the "old - context" permission to the "new - context" permission I want to have function which changes the corresponding permission reference attribute in all models, which subclassed this mixin. How do I know which models subclassed this permission mixin and that they have the inherited permission reference attribute? In fact I want to have such function in my mixin: class WorkspaceManagedMixin(models.Model): workspace = models.ForeignKey(Workspace) class Meta: abstract = True @classmethod def merge_to(cls, from_wspace, to_wspace): """ Reallocating workspace's objects to other workspace. """ workspace_managed_models = [] # HOW TO GET THIS? try: with transaction.atomic(): for model in workspace_managed_models: model.objects.filter( workspace=from_wspace, ).update(workspace=to_wspace) except IntegrityError as e: # or DatabaseError raise e The subclassed models can be in in other django applications in the project. -
Check whether user did like the post or not through template tag Django
I am using template tag to check whether user liked the question in the feed previously in order to show him liked "red heart" img or otherwise not. I send user profile and pk of question as arguments to the functions, I want to know whether that user profile is one of that who liked the question. How can I implement it in the right way? That's my template tag code from django import template from blog.models import UserProfile from blog.models import Question register = template.Library() def likecheck(theuser, question_pk): question_object = Question.objects.get(pk=question_pk) # just rude logic of what I seek # if theuser in question_object.who_liked: # return true # else: # return false register.filter('likecheck', like check) Relevant piece of class in models.py: class Question(models.Model): who_liked = models.ManyToManyField('UserProfile', related_name='who_liked_QUESTION', blank=True, null=True) -
How do I return two variables in one Django HttpResponse?
Ok, I'm pretty new to django and I was building a very simple app. User enters location into a textbox, I fetch the co-ordinates for that location from google maps and print it in the next page. So far, I have been able to get the co-ordinates in a JSON file along with a lot of other information. I have also successfully isolated the latitudes and longitudes and stored them into separate variables. I can't get them to print though. Only one value gets printed. Could someone help me with this? This is what I've written so far: My views.py: from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect import requests import json # Create your views here. def homepage(request): if request.method == 'GET': return render(request, 'geog/homepage.html') if request.method == 'POST': string = request.POST['location'] maps_url = "http://maps.googleapis.com/maps/api/geocode/json?address="+string json_string = requests.get(maps_url).content json_dict = json.loads(json_string) lat = json_dict['results'][0]['geometry']['location']['lat'] lng = json_dict['results'][0]['geometry']['location']['lng'] return HttpResponse(lat, lng) #It only prints lat, does not print lng My Html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>geog</title> </head> <body> <form action="" method="POST"> {% csrf_token %} <input type="text" name='location'/> <button type="submit">submit</button> </form> </body> </html> -
How to extract one value from an xml url in django
Im trying to print the value of just one field of a XML tree, here is the XML tree (e.g), the one that i get when i request it <puco> <resultado>OK</resultado> <coberturaSocial>O.S.P. TIERRA DEL FUEGO(IPAUSS)</coberturaSocial> <denominacion>DAMIAN GUTIERREZ DEL RIO</denominacion> <nrodoc>32443324</nrodoc> <rnos>924001</rnos> <tipodoc>DNI</tipodoc> </puco> Now, i just want to print "coberturaSocial" value, here the request that i have in my views.py: def get(request): r = requests.get('https://sisa.msal.gov.ar/sisa/services/rest/puco/38785898') dom = r.content asd = etree.fromstring(dom) If i print "asd" i get this error: The view didn't return an HttpResponse object. It returned None instead. and also in the console i get this I just want to print coberturaSocial, please help, new in xml parsing! -
Can't send email in Python/Django
can't figure out how to call send_email in the forms.py from views.py can anybody please help me. it's a scoping issue forms.py from django import forms from django.core.mail import send_mail class ContactForm(forms.Form): subject = forms.CharField(max_length=75) message = forms.CharField(widget=forms.Textarea) sender = forms.EmailField() def send_email(self): send_mail(subject, message, sender, 'TheAndrewFranklin@gmail.com', fail_silently=False) print('sent') and here's views.py views.py from django.shortcuts import render from django.views.generic.edit import FormView from .forms import ContactForm ... class ContactView(FormView): template_name = "main/contact.html" form_class = ContactForm success_url = '/thanks/' def form_valid(self, form): ContactForm.send_email(form) return super(ContactView, self).form_valid(form) -
Structuring setup.py and requirements.txt so that pip installs properly
I'm trying to write a python package that can be installed from PyPI and am having trouble getting my head around how exactly to structure setup.py and requirements.txt properly. I know that they have different semantics and different purposes with setup.py defining whats needed, and requirements.txt given exact versions. I also know that you shouldn't read requirements.txt into setup.py. So what I need to know is how to structure setup.py and requirements.txt so that when my package is installed from PyPI the reight requirements are installed. In my example, I need django-haystack (the latest version is 2.5.1), but my code is only compatible with django-haystack version 2.5.0, so my setup.py and requirements.txt are as shown below: setup.py: setup( name='my_package', install_requires = [ 'django-haystack', ], ) requirements.txt: django-haystack==2.5.0 How can I structure my setup code so that when this is installed, django-haystack==2.5.0 is installed not the latest? -
Are Python multiprocessing Pool thread safe?
I have Django project. If I make package variable that contains Pool() object, and will try to use that Pool from Django views (which run in parallel way), will be this way thread safe? Are there any others ways to do it? from multiprocessing import Pool general_executor_pool = Pool() -
Django REST Framework - is_valid() always passing and empty validated_data being returned
I have the following JSON request going to the server that defines a product configuration: '[{"finish":"b16561c9","component":"c6ce9951"},{"finish":"0bd5dcab","component":"048f8bed"},{"finish":"8f90f764","component":"96801e41"},{"option":"6a202c62","enabled":false},{"option":"9aa498e0","enabled":true}]' I'm trying to validate this through DRF, and I have the following configuration: views.py class pricingDetail(generics.ListAPIView): authentication_classes = (SessionAuthentication,) permission_classes = (IsAuthenticated,) parser_classes = (JSONParser,) def get(self, request, *args, **kwargs): pricingRequest = pricingRequestSerializer(data=request.query_params) if pricingRequest.is_valid(): return Response('ok') serializers.py class pricingComponentSerializer(serializers.ModelSerializer): class Meta: model = Component fields = ('sku',) class pricingFinishSerializer(serializers.ModelSerializer): class Meta: model = Finish fields = ('sku',) class pricingOptionSerializer(serializers.ModelSerializer): class Meta: model = ProductOption fields = ('sku',) class pricingConfigSerializer(serializers.ModelSerializer): finish = pricingFinishSerializer(read_only=True, many=True) component = pricingComponentSerializer(read_only=True, many=True) option = pricingOptionSerializer(read_only=True, many=True) enabled = serializers.BooleanField(read_only=True) class pricingCurrencySerializer(serializers.ModelSerializer): class Meta: model = Currency fields = ('currencyCode',) class pricingRequestSerializer(serializers.Serializer): config = pricingConfigSerializer(read_only=True) currency = pricingCurrencySerializer(read_only=True) As you can see I'm trying to validate multiple models within the same request through the use of inline serializers. My problem The code above allow everything to pass through is_valid() (even when I make an invalid request, and, it also returns an empty validated_data (OrderedDict([])) value. What am I doing wrong? -
What is the point of having "logout" endpoint in django-rest-auth?
I this article I have read that token based authentication is stateless, meaning that the servers don't keep record of logged in users. On the other hand in the django-rest-auth API docs there is a logout endpoint mentioned. What is it for? -
Django - Grabbing related objects and VALUES simultaneously
Best descriped by example. I have a model class Vendors(models.Model): legal_entity = models.ForeignKey(LegalEntities, on_delete=models.CASCADE, related_name = 'vendors') class AgreementVendors(models.Model): vendor = models.ForeignKey(Vendors, on_delete=models.CASCADE, related_name='agreement_vendors') A view: def some_view(request): vendors_qs = Vendors.objects.filter(is_deleted = False).select_related('legal_entity').\ prefetch_related('agreement_vendors').\ values('legal_entity__name_short',\ 'legal_entity__inn',\ 'legal_entity__rating') And a template {% for vendor in vendors_qs %} <tr> <td>{{vendor.legal_entity__name_short}} <td>{{vendor.legal_entity__inn}}</td> </tr> As you can see, the table in the template renders the list of vendors. Now, I want to add a column to this table which renders all the agreements associated with a given vendor. To do this, one might use a loop which would look smth like <td> {% for vend_agr in vendor.agreement_vendors.all() %} ... {% endfor %} </td> But naturally, I can't do this, because I fetch the values in the above code. I know that I can remove the values('legal_entity__name_short'... part in the above code, and rewrite the view code like so: vendors_qs = Vendors.objects.select_related('legal_entity').prefetch_related('agreement_vendors') This would enable the above-mentioned looping through the related objects, but the critical problem with this is that giving up fetching values would break things down with endless pagination and page load speed. THE QUESTION What would be the most optimal way here which would both Preserve the instant page load as with … -
Django - iterating over related objects in the template not working when fetching "VALUES"
I ran into the following issue best described by example. I have a model like the following: class Vendors(models.Model): legal_entity = models.ForeignKey(LegalEntities, on_delete=models.CASCADE, related_name = 'vendors') class AgreementVendors(models.Model): vendor = models.ForeignKey(Vendors, on_delete=models.CASCADE, related_name='agreement_vendors') And a view that renders a template: def some_view(request): vendors_qs = Vendors.objects.filter(is_deleted = False).select_related('legal_entity').\ prefetch_related('agreement_vendors').\ values('legal_entity__name_short',\ 'legal_entity__inn',\ 'legal_entity__rating') Now the problem is that when I fail to loop through the related agreement_vendors corresponding to vendors (no error message is arisen, and still I see blank spaces on my web page instead of what is expected). {% for vend_agr in vendor.agreement_vendors.all %} The problem with agreements goes away if I remove the values('legal_entity__name_short'... part from vendors_qs, in which case it's ok with agreements, but I can't access legal_entity__name_short and other fields mentioned in the values part; and the second issue - removing values seems to dramatically slow down endless pagination Hope clearly stated the question. What am I doing wrong ? -
process_template_response with new style django middleware
I used to use a middleware, just implementing process_template_response method. I used this to alter response context before rendering. With new style middlewares, I cant seem to able to use such method, it looks like we only have self.process_request(request) self.process_response(request, response) Anybody knows how to alter response context before rendering, with a middleware? -
django.views / django.models, can't delete entities with foreign key
Actually I have two things that don't seem to work. I'll list couple of models and their dependencies (shortened). The StudentGroup has students (which may be active/inactive), and messages, which are listed as chat. In views.py, when I call delete_group(), I want to make all students inactive and delete all of the messages relevant to the group. class StudentsGroup(models.Model): students = models.ManyToManyField(User,limit_choices_to={'is_staff': False}, related_name="user_groups",blank=True) finished = models.ManyToManyField(User,limit_choices_to={'is_staff': False}, related_name="finished_user_groups",blank=True) class Message(models.Model): group=models.ForeignKey(StudentsGroup) def delete_group(request,group): Message.objects.filter(group=group).delete() groupl=StudentsGroup.objects.get(id=group) for s in group1.students.all(): groupl.finished.add(s) group1.save() Nothing changes. I've tried similar things in console and it seemed to be ok. Tried bunch of similar code. Tried to add makemigrations to the server restarting but still no result. Kinda noob in django and webdev overall, any help would be appreciated. -
Django Invalid block tag: 'bootstrap_styles' error
When I try to run may django page an error message comes up and I can't fix it. It says Invalid block tag: 'bootstrap_styles' and says the problem is with this line in my HTML- {% bootstrap_styles theme='simplex' type='min.css' %} I cannot load the page and I spent a day researching this error and havn't found anything. The error message is Environment: Request Method: GET Request URL: http://localhost:8000/store/ Django Version: 1.8 Python Version: 2.7.12 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'social.apps.django_app.default', 'registration', 'bootstrap3', 'bootstrap_themes', 'compressor', 'store') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware') Template error: In template /home/jag/Development/bookstore/store/templates/base.html, error at line 11 Invalid block tag: 'bootstrap_styles' 1 : {% extends 'bootstrap3/bootstrap3.html' %} 2 : 3 : {% load staticfiles %} 4 : 5 : (% load bootstrap3 %} 6 : 7 : (% load bootstrap_themes %} 8 : 9 : {% load compress %} 10 : 11 : {% bootstrap_styles theme='simplex' type='min.css' %} 12 : 13 : {% block bootstrap3_extra_head %} 14 : <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,700" rel="stylesheet" type="text/css"> 15 : {% compress css %} 16 : <link href="{% static 'base/css/style.css' %}" rel="stylesheet" type="text/css"> 17 : {% endcompress %} 18 : {% endblock %} 19 : 20 … -
Django import error 'no module named django'
When I try to start my django app on openshift I get the following message. Hence deploying fails... File "wsgi/djangoProjectNew/manage.py", line 11, in <module> execute_from_command_line(sys.argv) File "/var/lib/openshift/55555511111114444444444/python/virtenv/lib/python2.7/site-packages/Django-1.8-py2.7.egg/django/core/management/__init__.py", line 338, in execute_from_command_line utility.execute() File "/var/lib/openshift/55555511111114444444444/python/virtenv/lib/python2.7/site-packages/Django-1.8-py2.7.egg/django/core/management/__init__.py", line 312, in execute django.setup() File "/var/lib/openshift/55555511111114444444444/python/virtenv/lib/python2.7/site-packages/Django-1.8-py2.7.egg/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/var/lib/openshift/55555511111114444444444/python/virtenv/lib/python2.7/site-packages/Django-1.8-py2.7.egg/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/var/lib/openshift/55555511111114444444444/python/virtenv/lib/python2.7/site-packages/Django-1.8-py2.7.egg/django/apps/config.py", line 119, in create import_module(entry) File "/opt/rh/python27/root/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named django This app is a copy of an app I set up several months ago. I changed all relevant paths, names, etc. It's running fine locally. Isn't it strange that the last command __init__.py runs outside the virtualenv? I'm using the python2.7 cartridge and the github openshift example https://github.com/openshift/django-example This app uses django 1.8.0 as a dependency. This is installed apps from djangoProject.settings INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'myDjangoApp', 'djcelery', 'kombu.transport.django', 'progressbarupload', 'widget_tweaks', ) -
How do you group comments by week start/end (period) date in django python
I'm developing an web app in django python that shows a list all the comments made on a particular project. What I want is to group comments by date so I can list them by week start/ending, similar to what i have in the example below. Example: Dataset = { [ period: '10/03/2016 - 10/07/2016', comments: [ comments.object, comments.object, ...] ], [ period: '10/10/2016 - 10/14/2016', comments: [ comments.object, comments.object, ...], ], } -
heroku app domain works but custom domain gives 400 error
I've recently deployed a (django) app to heroku and although the app works fine on the default heroku app domain appname.herokuapp.com it doesn't work at the custom url www.appname.com it instead gives a 400 bad request error. The domain dns has been configured at namecheap.com but domain added to heroku via: $ heroku domains:add appname.com, $ heroku domains:add www.appname.com what's the best way to diagnose the error as currently the app on heroku doesn't seem to be generating any errors (ie none showing in opbeat which captured earlier errors fine - apart from the custom domain routing, everything is working fine). -
Django PREPEND_WWW when http:// is hardcoded into backlink
I have PREPEND_WWW set on my clients site at http://www.thefrostfirm.com and it works as it should to take care of naked domains, but I have run into a scenario I am unsure how to fix. There is an article linking back to the site as http://thefrostfirm.com and it should prepend the www to the url but it doesn't and I am thinking its because of http:// being hardcoded to the link. I tried with RedirectView - see below; but it doesn't work url(r'^http://thefrostfirm$', RedirectView.as_view(url='www.thefrostfirm.com', permanent=True), name='home'), Any ideas would be appreciated, thank you. -
Turn off imported app's AdminConfig in a Django Project
I have project, where i am utilizing an imported project, but I do not want the imported project's sections appearing in the automatic admin portal. is there away to override a projects adminConfig via configuration/code? -
django rest framework. raise_exception=True
I'm wondering, when should I use serializer.is_valid(raise_exception=True)? If I'm not implementing any custom validation, do I need to use the raise_exeption=True flag? What if my API doesn't raise ValidationErrors, is it a bad practice? if it is, then why is the default raise_exception=False? I'm just wondering if I should set this to True. Thanks for your advice.