Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django template if statement return wrong value
In my home page I have blog, on the right side there is Posts category list like: Sports Crime and etc.. I try to make that when I'm in certain category that active category button will be highlighted. I'm doing that by setting GET parameter to my home page like: /?category=1 NOW... In index.html template I'm doing this: {% for category in category_list %} {{ category.pk }} != {{ request.GET.category }} // This is for debugging. Returns 1==1 {% if category.pk == request.GET.category %} <li><a href="{% url 'web_serv:index' %}?category={{ category.pk }}">{{ category }}<span class="pull-right">({{ category.post_set.count }})</span></a></li> {% else %} <li class="active"><a href="{% url 'web_serv:index' %}?category={{ category.pk }}">{{ category }}<span class="pull-right">({{ category.post_set.count }})</span></a></li> {% endif %} {% endfor %} But this is not working. Any suggestions how to solve this, maybe there is another way? -
Django Celery SQS Routing
Can somebody explain to me how this works because no matter what I do the tasks always ends up in the default queue. Here... even though in a billion places it says "PUT IN THE QUEUE LONG" it still puts it in the default one "reports." @task(queue='long') def build_master_list_entries(report_id): report = models.Report.objects.get(id=report_id) for tag in report.configuration.master_list_tags.all(): build_master_list_for_report.apply_async(args=[tag.id,report_id], queue='long', routing_key='long_tasks') settings CELERY_DEFAULT_QUEUE = 'reports' CELERY_DEFAULT_EXCHANGE_TYPE = 'topic' CELERY_DEFAULT_ROUTING_KEY = 'default' CELERY_ACCEPT_CONTENT = ['pickle', 'json'] BROKER_TRANSPORT = 'sqs' CELERY_BROKER_TRANSPORT_OPTIONS = BROKER_TRANSPORT_OPTIONS = { 'region': 'us-west-1', 'visibility_timeout': 43200, } CELERY_QUEUES = ( Queue('reports', routing_key='default'), Queue('long', routing_key='long_tasks'), ) CELERY_ROUTES = { 'dryden.tasks.build_master_list_entires': { 'queue': 'long', 'routing_key': 'long_tasks', }, 'dryden.tasks.build_master_list_for_report': { 'queue': 'long', 'routing_key': 'long_tasks', }, } -
Django not recognizing or seeing JSON file
I've been working on trying to integrate google sheets with django, i'm trying to use gspread. I can see the data using python filename.py, but when I run python manage.py runserver, I keep getting this error: IOError: [Errno 2] No such file or directory: 'key.json' It's not recognizing for seeing my json file for some reason, i've also tried using 'key' without the .json, no luck. I've been googling here, any ideas here? Here's my code below *************************** code below ******************************* import gspread import json from oauth2client.service_account import ServiceAccountCredentials import os scope = ['https://spreadsheets.google.com/feeds'] credentials = ServiceAccountCredentials.from_json_keyfile_name('key.json', scope) gc = gspread.authorize(credentials) wks = gc.open("RAMP - Master").sheet1 print wks cell_list = wks.range('A1:B7') print cell_list -
How to include emojis in Django fixtures?
[ { "model": "myapp.mymodel", "pk": 3, "fields": { "country_name": "China", "country_symbol":"\xF0\x9F\x87\xBA\xF0\x9F\x87\xB8" } } ] I am trying to add emojis to populate my table using fixtures, but when I run this, I get django.core.serializers.base.DeserializationError: Problem installing fixture '/Users/../myapp/fixtures/init_fixture_country.json': Invalid \escape: line 7 column 25 (char 124) -
"abc" is not a registered tag library. must be one of: "efg" | django
I was actually trying to find a way to sort a queryset in my template and saw that we can create our custom filter and use it. let's not to mention the function I put into my tag but I created the tag in the same directory as all other tags... I created my tag name sort_tags.py under templatetags *weird I cannot upload image, was going to show my directories` Anyways, that's where all other tags are. I got this piece of code and want to try it..so I paste it into my sort_tags.py from django import template register = template.Library() @register.filter def sort_by(queryset, order): return queryset.order_by(order) then in my template.html I used {% load sort_tags %} also, there are other tags being loaded too. Then when I load the page...is not a registered tag library. must be one of shows up. in the list of MUST BE, I see all the tags in the same directory as me. I tried something like filter_function, register_filter('sort_by',sort_by) or something similar, found a few different ways, so I tried them all and none of them work. Does anyone has any idea what might be wrong? Thanks in advance -
Adding annotations to all querysets with a custom QuerySet as Manager
I'm not sure how to put words on this precisely, but what I'm trying to do is use a custom QuerySet for a model, but I want to annotate the results of any queryset. So whether filters were applied, or it was a direct get of an object (which I think is still a filter() call in the end), I want the annotations to be applied so I can access them in the Model objects I get back. My current solution is using a custom QuerySet + custom Manager, and the custom Manager passes custom calls off to the appropriate call on the custom Queryset. Of course, this has the unfortunate need to match methods between the manager and queryset for any custom method I want. I know that CustomQuerySet.as_manager() exists to avoid this duplication, but if I use that, then I lose the ability to override get_queryset() so my annotations can be applied in all cases of evaluating a queryset. Is there a cleaner way to do this so I am still left with the ability to chain calls and have my annotations apply when the queryset is finally evaluated? Ideally I'd like to keep using standard calls like: … -
Django rest-auth/allauth and weibo integration
I'm trying to use django rest-auth and allauth together for backend authentication process with reactjs frontend application. I'm not sure if I have the setup correctly or if this is a bug. The "uid" does not exist in the response, it only carries token which is passed from the api. I think the uid should be from either existing user or a new one from new users, and "complete_login" should pass those uid along... Please let me know if anyone has any ideas. Full traceback below: Traceback: File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 149. response = self.process_exception_by_middleware(e, request) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 147. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view 58. return view_func(*args, **kwargs) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/rest_framework/views.py" in dispatch 466. response = self.handle_exception(exc) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/rest_framework/views.py" in dispatch 463. response = handler(request, *args, **kwargs) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/rest_auth/views.py" in post 81. self.serializer.is_valid(raise_exception=True) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/rest_framework/serializers.py" in is_valid 213. self._validated_data = self.run_validation(self.initial_data) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/rest_framework/serializers.py" in run_validation 410. value = self.validate(value) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/rest_auth/registration/serializers.py" in validate 106. login = self.get_social_login(adapter, app, token, access_token) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/rest_auth/registration/serializers.py" in get_social_login 42. social_login = adapter.complete_login(request, app, token, response=response) File "/home/ubuntu/panbecopy/src/penv/local/lib/python2.7/site-packages/allauth/socialaccount/providers/weibo/views.py" in complete_login 20. uid = kwargs.get('response', {}).get('uid') Exception Type: AttributeError at /rest-auth/weibo/ Exception … -
Refresh the Data in a Django Template without reloading the page
In my code, I am musing most of the objects that I called in view, in the Javascript part and not the HTML part. hence, how can I update that. HTML <div class= "box-body"> <canvas id="canvas" width="900" height="900" style="cursor: crosshair;background-color: #000000 "></canvas> </div> Script where the all the data comes from <script> var x = {{ frame.x1 }} var y = {{ frame.y1 }} var g = {{ frame.g1 }} {% if frame.g1 == '1' %} drawCoordinates2(x , y) {% else %} drawCoordinates(x , y) {% endif %} `</script>` My AJAX request <script> var append_increment = 0; setInterval(function() { $.ajax({ type: "GET", url: {% url 'js_update' %}, // URL to your view that serves new info data: {'append_increment': append_increment} }) .done(function(response) { $('#canvas').append(response); append_increment += 10; }); }, 2000) </script> View def js_update(request): increment = int(request.GET['increment']) increment_to = increment + 10 frame = Coordinates.objects.last() return render(request, 'js_update.html', {'frame': frame}) And i have left , update_js.html empty , as i do not want to update the html , in the div , just the javascript queries data needs to be changed. How can I do that. Thanks -
django-admin-tools how to change the "logo" on login
I managed to change the menus and dashboard, but how to change the "logo" (Word Django) on login and admin page? I tried (many times) to post an image, but the imageur always rejected. https://i.cubeupload.com/s5eujP.png -
Django static files redirecting to URL with language code
I'm using Mezzanine 4.1.0 with Django 1.9.12 and django-modeltranslation 0.1.2. All of my static files are getting redirected as if they were pages: "GET /static/js/bootstrap.js HTTP/2.0" 301 0 "GET /static/js/bootstrap.js/ HTTP/2.0" 302 0 "GET /en/static/js/bootstrap.js/ HTTP/2.0" 404 6960 Has anyone seen this before? It only just started happening, for no apparent reason. -
Detail View is not displaying details of the post? Django
I have a list of aircraft displayed in browseaircraft.html. The user clicks on the title and is taken to the details page, however, it doesn't display the details of that particular post, rather all of the posts? There is no error message, but it's not working as expected Models class Aircraft(models.Model): title = models.CharField(max_length=50, default="") cost = models.DecimalField(max_digits=8, decimal_places=3) range = models.IntegerField() cruise_speed = models.IntegerField() def get_absolute_url(self): return reverse('aircraftdetail', kwargs={'pk': self.id}) urls urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^aircraft', 'aircraft.views.browseaircraft', name='browseaircraft'), url(r'^aircraftdetail/(?P<pk>\d+)/$', 'aircraft.views.aircraftdetail', name='aircraftdetail'),] Views def browseaircraft(request): all_aircraft = Aircraft.objects.all() variables = {'all_aircraft':all_aircraft} return render(request,'browseaircraft.html', variables) def aircraftdetail(browseaircraft): model = Aircraft def aircraft_detail_view(request,pk): try: aircraft_id=Aircraft.objects.get(pk=pk) except aircraft.DoesNotExist: raise Http404("Book does not exist") return render(request,'aircraft_detail.html', context={'aircraft':aircraft_id,} ) Browseaircraft.html {% if all_aircraft%} {% for a in all_aircraft %} <img src="{{a.image.url}}"height="100" width="100"> <a href="{{ a.get_absolute_url }}"> {{ a.title }}</a> {{ a.range }}, {{ a.body }}, {% endfor %} aircraft_detail.html {% block content %} {% for a in all_aircraft %} <h1>Title: {{ a.title }}</h1> {{ a.cost }} {{ a.range}} {{ a.cost }} {{ a.cruise_speed }} {% endfor %} {% endblock %} -
How to negate this filter in Django?
Here is my view function: def job_find(request): queryset = Job.objects.filter(user=request.user).order_by('created_at') jobs = get_list_or_404(queryset) return render(request, 'jobs/all_jobs.html', {'jobs': jobs}) I want the queryset to contain all jobs which do not belong to the current user. To do this I must negate the filter, but how? -
delta is not defined in the class
class timetravel(object): """ Fast forward in time with simulated CRON jobs (used for unit testing) """ delta = None def __init__(self, *args): self.initial_now = datetime.now() if isinstance(args[0], timedelta): self.delta = delta elif isinstance(args[0], datetime): self.now = args[0] if args[0] > self.initial_now: self.delta = args[0] - self.initial_now else: self.delta = self.initial_now - args[0] else: print("Please provide a datetime or timedelta object as argument") #self.now = self.initial_now #self.freezer = freeze_time(self.now) #self.freezer.start() def __enter__(self): # Traveling in the past, we don't run cron jobs backward if self.now < self.initial_now: self.now = self.now - self.delta self.freezer = freeze_time(self.now) self.freezer.start() # Traveling in the future, run cron jobs else: self.now = self.initial_now self.freezer = freeze_time(self.now) self.freezer.start() hours = self.delta.total_seconds() / 60 / 60 weekday = self.now.weekday() month = self.now.month year = self.now.year for i in range(1, int(hours)+1): call_command('cron', hourly=True, verbosity=0) if weekday != self.now.weekday(): weekday = self.now.weekday() call_command('cron', daily=True) if self.now.weekday() == 6 and weekday != self.now.weekday(): call_command('cron', weekly=True) if self.now.month != month: month = self.now.month call_command('cron', monthly=True) if self.now.year != year: year = self.now.year call_command('cron', yearly=True) self.freezer.stop() self.now = self.now + timedelta(hours=1) self.freezer = freeze_time(self.now) self.freezer.start() return self.now def __exit__(self, *args): self.freezer.stop() Why do we pass the argument object at timetravel? If I create … -
unable to connect django with remote mysql database
django.db.utils.OperationalError: (1045, "Access denied for user 'user'@'x.x.x.x' (using password: YES) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'db_name', # Or path to database file if using sqlite3. 'USER': 'user', # Not used with sqlite3. 'PASSWORD': 'password', # Not used with sqlite3. 'HOST': 'server.example.net', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. } } -
Django - NoReverseMatch at /Profile/user
My problem is I am getting a NoReverseMatch error after clicking one of the links on my homepage. The problem points to a text file which I refuse to delete. Here's the code that's causing the problems <a href="{% url 'edit_Profile' slug=Profile.slug %}">Edit me!</> Heres my code views.py from django.shortcuts import render, redirect from django.views.generic.base import TemplateView from webapp.models import Profile from webapp.forms import ProfileForm def index(request): Profiles = Profile.objects.all() return render(request, 'index.html', { 'Profiles': Profiles, }) def Profile_detail(request, slug): Profiles = Profile.objects.get(slug=slug) return render(request, 'Profiles/Profile_detail.html', { 'Profile': Profile, }) def edit_Profile(request, slug): Profile = Profile.objects.get(slug=slug) form_class = ProfileForm if request.method == 'POST': form = form_class(data=request.POST, instance=Profile) if form.is_valid(): form.save() return redirect('Profile_detail', slug=Profile.slug) else: form = form_class(instance=Profile) # and render the template return render(request, 'Profiles/edit_Profile.html', { 'Profile': Profile, 'form': form, }) url.py from django.conf.urls import url, include from django.contrib import admin from django.views.generic import TemplateView from webapp import views from django.conf.urls import url, include from django.contrib import admin from django.views.generic import TemplateView from webapp import views urlpatterns = [ url(r'^$', views.index, name='home'), url(r'^about/$', TemplateView.as_view(template_name='about.html'), name='about'), url(r'^contact/$', TemplateView.as_view(template_name='contact.html'), name='contact'), url(r'^Profiles/(?P<slug>[-\w]+)/$', views.Profile_detail, name='Profile_detail'), url(r'^things/(?P<slug>[-\w]+)/edit/$', views.edit_thing, name='edit_thing'), ] forms.py from django.forms import ModelForm from webapp.models import Profile class ProfileForm(ModelForm): class Meta: model = … -
Connect pdfs together
I converted two html files into pdfs and now I want to connect them into a single one. I could save them as files and use PyPDF2 but I would like to avoid unnecessary file operations. Any ideas? pdf = PDFTemplateResponse(template='pdf1.html', request=request, context=context) pdf_content = pdf.rendered_content pdf2 = PDFTemplateResponse(template='pdf2.html', request=request, context=context) pdf2_content = pdf2.rendered_content -
Django REST Framework: serializing an ImageField
I'm having huge issues with Django REST Framework and its serializers in relation to a model with an ImageField Here's the code for my model: class Photo(models.Model): id = models.AutoField(primary_key=True) image_file = models.ImageField(upload_to=generate_image_filename_and_path, width_field="image_width", height_field="image_height", null=False, blank=False) image_width = models.IntegerField(null=False, blank=False) image_height = models.IntegerField(null=False, blank=False) and here's the serializer: class PhotoSerializer(serializers.ModelSerializer): class Meta: model = Photo fields = ('image_file',) read_only = ('id', 'image_width', 'image_height') id, image_width and image_height are set as read_only fields, as I want them to be generated by the model class. ID is something I couldn't even provide when first creating a model instance. I've had much trouble. In the current state, I have a test that looks like this: class PhotoSerializerTestCase(TestCase): def test_native_data_type_serialization(self): img_file = create_generic_image_file('test_img.jpg', 'image/jpeg') p = Photo(image_file=img_file) p.save() serialization = PhotoSerializer(p) expected_id = p.id expected_image_width = p.image_width expected_image_height = p.image_height print(serialization) actual_id = serialization.data['id'] actual_image_width = serialization.data['image_width'] actual_image_height = serialization.data['image_height'] self.assertEqual(expected_id, actual_id) self.assertEqual(expected_image_width, actual_image_width) self.assertEqual(expected_image_height, actual_image_height) Here's the function that I call to create the generic image file for the test: def create_generic_image_file(name, content_type): path = '\\test_files\\test_image_generic.jpg' file_path = BASE_DIR + path file_name = name content = open(file_path, 'rb').read() image_file = SimpleUploadedFile(name=file_name, content=content, content_type=content_type) return image_file In present state, I'm left with an … -
Django SQL injection in GET requests
One of the SAST tools has flagged the below piece of code as vulnerable on SQL injection grounds, I want to know why does it show vulnerable although Django documents says that all inputs are type safe converted/ bad inputs are escaped in backend, file is views.py: def infopanel(request): item_id = request.GET.get('item_id','') change_key = request.GET.get('change_key','') context = request.GET.get('context','') if item_id == '' or change_key == '': return render_to_response('emailtrackergenericfailure.html',{'errorcode':"invalid message parameters (item_id, change_key, and or folder)"},context_instance=RequestContext(request)) -
Cannot install Django on docker
Please, i am still having a problem of installing Django on docker. The solution given here did not solve the problem. Can't install pip packages inside a docker container with Ubuntu -
Django Multiple concurrent logged-in accounts
In the context of a e-health related service, the end-users (health operators, doctors and physiotherapists) working in the same physical environment and sharing just one client PC to interact with my backend, asked me to provide them with a mechanism to quickly switch among different accounts (security is not a concern most of the time because they are used to work within a LAN but, occasionally, they might work from remote clients, so I must keep an authentication/authorization backend in place). They would log in just once and then, before using the web application, would select their logged-in account from a combobox (sort-of). The UI model might be the same as in GMail where it's possible to keep multiple logged-in user accounts and switch between them through the account selector in the top right corner. I'm no django-authentication expert, so I am not able to even tell whether this is possible in the context of a django based app. Does anyone know of any ready-made app/middleware to get this done? Or maybe point me in the right direction if I have to extend or modify existing code? Thanks a lot. -
(django-testing) assertIs error
I have tried a simple test and got this error message in the console: AIL: test_get (navbar.test.ContextManagerTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/media/me/049C11249C1111B2/backup me/Freizeit/Django Projekte/mysitetest/lib/navbar/test.py", line 16, in test_get self.assertIs(cm.get('hi/du',0), 'hi') AssertionError: 'hi' is not 'hi' We can see in the last line, cm.get('hi/du',0) returned 'hi'. But why the test has failed than? First, I thaught there could be an error, but neither that code line: self.assertIs('hi','hi') nor this one: self.assertIs(['hi'][0],'hi') nor this one: self.assertIs(cm.get('hi',0),'hi') failed. For better understanding, I add the code of cm.get(mypattern,number): def get(self, mypattern, number): parts = mypattern.split('/').strip() return parts[number] This is the code of the test that failed: def test_get(self): cm = context.ContextManager([]) self.assertIs(cm.get('hi',0), 'hi') self.assertIs(cm.get('hi/du',0), 'hi') #this line failed self.assertIs(cm.get('hi/du',1), 'du') It looks like there was some trouble with the split() function, but, at least, cm.get('hi/du',0) returned 'hi', as we can the in the stacktrace above. For remembering I add the relevant lines: self.assertIs(cm.get('hi/du',0), 'hi') AssertionError: 'hi' is not 'hi' Small detail (I don't know whether this is important): I started the test with python3 manage.py test lib/navbar. So you know why that failed? Or do you have at least some guesses? Thank your for reading this! -
Flat representation of nested models in Django Rest Framework
Having a hierarchical model structure: class Lable(models.Model): name = models.CharField() class Artist(models.Model): label = models.ForeignKey( 'Label', related_name='artists' ) class Album(models.Model): artist = models.ForeignKey( 'Artist', related_name='albums' ) class Track(models.Model): album = models.ForeignKey( 'Track', related_name='tracks' ) My goal is to have an API endpoint for Labels showing all the tracks (distinct): [ { 'name': 'Label A' 'tracks': [ … ] }, { 'name': 'Label B' 'tracks': [ … ] } ] Is there a way to achieve such a structure not having an N + 1 queries? I was trying to use prefetch_related, SQL queries looks ok, but I can't access cached data in LabelSerializer, my current queryset: Label.objects.all().prefetch_related( models.Prefetch( 'artists__albums__tracks', queryset=Tracks.objects.distinct(), to_attr='tracks_list' ), ) -
Heroku scheduler vs clock process
I have a Django app running on Heroku and I need to run background tasks every hour. It's quite important that I don't miss an event I know I can use the Heroku scheduler. However, it says: Scheduler is a “best effort” service, meaning that execution is expected but not guaranteed. Scheduler is known to occasionally (but rarely) miss the execution of scheduled jobs. If scheduled jobs are a critical component of your application, it is recommended to run a custom clock process instead for more reliability, control, and visibility. Since I don't want to miss event, I went to the custom clock process page and there it says: Since dynos are restarted at least once a day some logic will need to exist on startup of the clock process to ensure that a job interval wasn’t skipped during the dyno restart. So my question is, is there an advantage to using a clock process vs the Heroku scheduler apart from being more flexible regarding times it should run? Since neither is 100% reliable I rather use the scheduler and implement some logic to make sure it gets run otherwise I have to pay for an extra dyno (the clock … -
JetBrains Pycharm - Getting error while debugging my project
I just switched to Mac from windows. I imported my project in pycharm from GitHub but it is giving unknown errors. Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10b75f6a8> Traceback (most recent call last): File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run autoreload.raise_last_exception() File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(*_exception) File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise raise value.with_traceback(tb) File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/Users/rajababu/anaconda/lib/python3.6/site-packages/django/apps/config.py", line 90, in create module = import_module(entry) File "/Users/rajababu/anaconda/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked ModuleNotFoundError: No module named 'import_export' -
Why does gettext default to ascii encoding?
So this is the error message: How could I fix this? Also why is gettext even using ascii? can I make it use utf-8 instead? And can I have it ignoring the characters it doesn't understand instead of crashing the app?