Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Getting a ValueError from an old migration even though makemigrations command seemed to detect a change in fields
I'm trying to get this change in my fields to properly update so I can work on the rest of the project. This is the model that's causing the issue currently: class Hotel(models.Model): name = models.CharField(max_length=255) address = models.CharField(max_length=255) check_in_date = models.DateField() check_out_date = models.DateField() notes = models.TextField(blank=True) id = models.AutoField(primary_key=True) people = models.CharField(max_length=255) # the people field is the issue rn def __str__(self): return self.name + ", " + str(self.id) Previously, the people field was an ArrayField but I changed it to a CharField because it didn't need to be an array. Here is migration 7 where I added the people field as an ArrayField class Migration(migrations.Migration): dependencies = [ ('project_name', '0006_confirmationentry_alter_hotel_notes'), ] operations = [ migrations.AddField( model_name='hotel', name='people', field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), default=list, size=None), ), ] Here's migration 8 where I changed it to a CharField class Migration(migrations.Migration): dependencies = [ ('project_name', '0007_hotel_people'), ] operations = [ migrations.AlterField( model_name='hotel', name='people', field=models.CharField(max_length=255), ), ] I've deleted/commented out the people field several times and put it back, and when I do python3 manage.py makemigrations, these changes are detected. But when I do python3 manage.py migrate it gives me this error: Applying project_name.0007_hotel_people...Traceback (most recent call last): File "/Users/me/Desktop/project_name/manage.py", line 22, in <module> execute_from_command_line(sys.argv) … -
Why django signals are not called when I create a new entry in the table?
Created a signal that checks the Robot table for new entries. Then compares the model and version data with the Order table, then sends an email. But nothing works. What could be the problem? @receiver(post_save, sender=Robot) def robot_created(sender, instance, **kwargs): orders = Order.objects.all() for order in orders: robot_exists = Robot.objects.filter(model=order.robot_model, version=order.robot_version).exists() if robot_exists: subject = 'text' message = 'text' from_email = 'text@gmail.com' recipient_list = ['text22@gmail.com'] send_mail(subject, message, from_email, recipient_list) order.models.py class Order(models.Model): customer = models.ForeignKey(Customer,on_delete=models.CASCADE) robot_model = models.CharField(max_length=2, blank=True,null=True) robot_version = models.CharField(max_length=2, blank=True,null=True) robots.models.py class Robot(models.Model): serial = models.CharField(max_length=5, blank=False, null=False) model = models.CharField(max_length=2, blank=False, null=False) version = models.CharField(max_length=2, blank=False, null=False) created = models.DateTimeField(auto_now_add=True) I tried to throw it into different folders, put the print inside the function (nothing came out) -
How can I parse the string representation of a decimal value to decimal (python) from a JSONField?
so I created a Model that contains a JSON field: metadata = models.JSONField(verbose_name=_('Metadata'), blank=True, default=dict, db_index=True, encoder=DjangoJSONEncoder, decoder=JSONDecoder(parse_float=decimal.Decimal)) If I access the metadata field that contains a decimal value I get a string representation of the value (that makes sense, because they are stored internally as strings. But I want that its automatically parsed to the type decimal.Decimal. The json.JSONDecoder has a parameter "parse_float", but Django wants a callable as decoder parameter. I tried to pass a instantiated decoder class (but I got obviously a ValueError, that this must be a callable. I also tried to start working on a subclassed JSONDecoder, but in the parent class I cannot see the code, what I need to adjust to receive a decimal.Decimal. So I am a little bit confused how I can solve my problem. Has someone any idea? -
Query repeated multiple times in a many-to-many relation
I have a problem with a many to many relationship in Django Admin. I have simplified my model so that it does not contain irrelevant fields for the problem. If we take "actor" as an example. If I have, for example, 15 actors for a movie, SQL makes 15 queries instead of one. I have search for a long time now but only finds solutuions for one to many based on the foreignkey thats automaticly created in my "many to many" relation. I am grateful for any help I can get! models.py class Cast(models.Model): firstname = models.CharField(max_length=250, blank=True) lastname = models.CharField(max_length=250, blank=True) class Meta: indexes = [["firstname", "lastname"]] class Meta: abstract= True class Director(Cast): def __str__(self): return self.firstname + ' ' + self.lastname class Actor(Cast): def __str__(self): return self.firstname + ' ' + self.lastname class Film(models.Model): title_eng = models.CharField(max_length=250, verbose_name='Title English') directors = models.ManyToManyField(Director, related_name='directors') actors = models.ManyToManyField(Actor, related_name='actors') def __str__(self): return self.title_eng admin_film.py class DirectorInline(admin.TabularInline): model = Director.directors.through verbose_name_plural = "Film-Director" list_display = ['firstname','lastname'] extra = 0 @admin.register(Director) class DirectorAdmin(admin.ModelAdmin): search_fields = ("firstname",) list_display = ['id', 'firstname', 'lastname', 'get_fullname'] fields = ['firstname', 'lastname', 'fullname'] def get_fullname(self, obj): fullname = "" if (len(obj.firstname) != 0): fullname = obj.firstname return fullname … -
Filepond, How to get file name that user reverted
I have this server configuration of filepond server: { process: (fieldName, file, metadata, load, error, progress, abort) => { ***** }, revert: { url: '{% url "file_revert" %}', headers: { 'FileName': '????????', } }, } How can i get filename of the file that user reverted Thank you for taking the time over this question <3 I've already tried something like this: revert: { url: '{% url "file_revert" %}', headers: { 'FileName': (file) => file.name }, }, But it does not work -
Why does index.html have such a name in Django?
I’m not a native speaker and I don’t understand why the standard name of the initial page in Django applications is index.html. Can someone explain in simple words why this is so, and not, for example, home.html I'm trying to find out the answer to my question. I just need a verbal explanation -
Django Multipart/form-data serialization attrs are empty
I have an issue when trying to serialize multipart/form-data. Code: class View(GenericAPIView): permission_classes = [IsAuthenticated] queryset = QS.objects.all() serializer_class = SampleSerializer parser_classes = (MultiPartParser, FormParser, ) class SampleSerializer(serializers.Serializer): event = serializers.CharField() kwargs = serializers.DictField(required=False) def validate(self, attrs): print(attrs) // result: { event: "request", kwargs: {} } Why do I get empty kwargs in serializer validate method? Do I need a different parser? I tried using different parsers but they doesn't seem to work. The initial data is: -----------------------------23641203962992511458665574039 Content-Disposition: form-data; name="event" request -----------------------------23641203962992511458665574039 Content-Disposition: form-data; name="kwargs[email]" sample email -----------------------------23641203962992511458665574039-- -
Detect when a text editor is run in xterm such as nano,vim etc
I am currently using 5.2.1 version of xterm.js and django in backend. I want to detect when a text editor is run in terminal and log it. My current approach is to filter it using the keywords such as nano,vim etc. The only problem is that the user may use alias so i want to run "alias" command in the background constantly and check if there is any alias of nano or vim and add them to blacklist too. How can i achieve this in the most foolproof way? index.html: <script type="module"> var socket = io.connect({ transports: ["websocket", "polling"] }); const status = document.getElementById("status") const button = document.getElementById("button") const fit = new FitAddon.FitAddon(); var term = new Terminal({ cursorBlink: true, }); term.loadAddon(fit); term.open(document.getElementById('terminal')); fit.fit(); var terminal_line = ''; term.onKey(e => { if (e.key == "\r") { terminal_line = term.buffer.active.getLine(term._core.buffer.y)?.translateToString(); console.log("terminal line: ", terminal_line); socket.emit("log_input", { "user_input": terminal_line }); } socket.emit("pty_input", { "input": e.key }); }) socket.on("pty_output", function (output) { console.log("output: ", output["output"]); term.write(output["output"]); }) socket.on("connect", () => { status.innerHTML = '<span style="background-color: lightgreen;">connected</span>' button.innerHTML = 'Disconnect' }) socket.on("disconnect", () => { status.innerHTML = '<span style="background-color: #ff8383;">disconnected</span>' button.innerHTML = 'Connect' }) function myFunction() { if (button.innerHTML == 'Connect') { location.reload(); } … -
How to create a Django with existing directories, files and etc.?
I am trying to startproject with django-admin startproject <project_name> but it either makes more files that already exists (like manage.py, and other configurations files) or gives an error - CommandError: ~/Dev/r4c/R4C/manage.py already exists. Overlaying a project into an existing directory won't replace conflicting files. My project structure: r4c/ └── R4C/ ├── R4C/ │ └── settings.py └── ... (other configuration files) ├── customers/ │ └── views.py └── ... (other customer-related files) ├── orders/ │ └── views.py └── ... (other customer-related files) └── robots/ └── views.py └── ... (other customer-related files) ├── R4C_README.md ├── R4C_manage.py └── R4C_tasks.md I just need to start the project and apps with already existing directories and files I tried to startproject command but cant get and idea of not just starting project from the beginning, just work with existing ffiles and directories. -
React useContext is undefined in useeffect
I am coding a chat app with django channels and react. I want when a new message is send, to have a className of the current user. I already have the current user in context so I just have to call it and get it. But when I try to get the user in useEffect, it returns {}. const {currentUser} = useContext(AuthContext) useEffect(()=> { chatSocket.onmessage = function(e) { console.log(currentUser) const data = JSON.parse(e.data); setMessages(old => [...old, <p ref={oneRef} className={currentUser[0]?.username}>{data.message}</p>]) }; },[]) Also I need the useEffect so I can't just remove it. I don't wanna to call an axios call every time a new message is sended. And the currentUser is an object. -
Django and VueJS PWA on Nginx
First of all we build the frontend using npm build. We also configure the assetsDir to /static/ui and outputDir to dist/ui. After the build process is complete, we copy the whole build files to another /static directory, where we load static files through django static. We also specify the /static to alias /etc/var... etc. In nginx.conf So everything works fine like this. The problem arise when I made the VueJS app to pwa, it just won't work, I don't know why, but I have even configured nginx to serve the service-worker.js file. And other files like icons and manifest.json also loads correctly. Any help on this will be appreciated. More info: in browser console.log, when we type 'serviceWorker' in navigator returns true if we are hosting (only the VueJS app) through netlify or vercel, in django's case, it already returns false, thus making it not to support pwa. -
How to use jupyter in existing django project
i followed the instruction on the internet to access django apps in jupyter. I tried 2 ways: 1: created a jupyter file and add the django settings to it like below ''' import sys, os print('Python %s on %s' % (sys.version, sys.platform)) import django print('Django %s' % django.get_version()) sys.path.append('D:/VSCODE/GPOSSYS') os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') if 'setup' in dir(django): django.setup() ''' 1 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 2 if 'setup' in dir(django): 3 django.setup() File d:\\VSCODE\\GPOSSYS\\.venv\\Lib\\site-packages\\django\\__init__.py:24, in setup(set_prefix) 20 if set_prefix: 21 set_script_prefix("/" if settings.FORCE_SCRIPT_NAME is None else settings.FORCE_SCRIPT_NAME) 24 apps.populate(settings.INSTALLED_APPS) File d:\\VSCODE\\GPOSSYS\\.venv\\Lib\\site-packages\\django\\apps\\registry.py:83, in Apps.populate(self, installed_apps) 78 # An RLock prevents other threads from entering this section. The 79 # compare and set operation below is atomic. 80 if self.loading: 81 # Prevent reentrant calls to avoid running AppConfig.ready() 82 # methods twice. 83 raise RuntimeError("populate() isn't reentrant") 84 self.loading = True 86 # Phase 1: initialize app configs and import app modules. RuntimeError: populate() isn't reentrant 2: I installed jupyter, Django-extensions, added it to settings in installed apps and ran python manage.py shell_plus --notebook in the terminal this is the response i got Traceback (most recent call last): File "D:\VSCODE\GPOSSYS\.venv\Lib\site packages\django_extensions\management\commands\shell_plus.py", line 281, in get_notebook from notebook.notebookapp import NotebookApp ModuleNotFoundError: No module named 'notebook.notebookapp' CommandError: Could … -
Unable to login into django-admin with superuser credentials Using a custom user model
i am using the custom user model my superuser get's created but i am unable to login into the django-admin using the superuser credentials below is the code i wrote to create a custom_user model from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin from GOVDairySync.exceptions import * import uuid class UserManager(BaseUserManager): def create_user(self, email, password=None, **extra_fields): if not email: raise ValueError("The Email field must be set") email = self.normalize_email(email) user = self.model(email=email, **extra_fields) user.set_password(password) user.save(using=self._db) return user def create_superuser(self, email, password=None, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) if extra_fields.get('is_staff') is not True: raise ValueError("Superuser must have is_staff=True.") if extra_fields.get('is_superuser') is not True: raise ValueError("Superuser must have is_superuser=True.") user = self.create_user(email=email, password=password, **extra_fields) user.save(using=self._db) return user class User(AbstractBaseUser, PermissionsMixin): id = models.UUIDField(default=uuid.uuid4, primary_key=True, unique=True, editable=False) email = models.EmailField( verbose_name="Email", max_length=255, unique=True, ) name = models.CharField(max_length=200) mobile = models.CharField(max_length=10) is_active = models.BooleanField(default=True) is_deactivated = models.BooleanField(default=False) is_staff = models.BooleanField(default=False) # Added this field is_superuser = models.BooleanField(default=False) # Added this field created_at = models.DateTimeField(auto_now_add=True) deleted_at = models.DateTimeField(null=True, blank=True) objects = UserManager() USERNAME_FIELD = "email" REQUIRED_FIELDS = ['name', 'mobile'] def __str__(self): return self.name def has_perm(self, perm, obj=None): return self.is_superuser # Modify as needed def has_module_perms(self, app_label): return self.is_superuser # Modify as needed class Meta: … -
why am I not able to filter events by month in django?
I have below django views to filter events based on month class FilterByMonthView(ListView): model = Event template_name = 'your_template.html' context_object_name = 'filtered_data' def get_queryset(self): month = self.kwargs.get('month') month = str(month).zfill(2) # Construct a date range for the specified month start_date = datetime.strptime(f'2023-{month}-01 00:00:00', '%Y-%m-%d %H:%M:%S') end_date = datetime.strptime(f'2023-{month}-01 23:59:59', '%Y-%m-%d %H:%M:%S') # Assuming end of the month # Filter the data based on the date range queryset = Event.objects.filter( event_date__range=(start_date, end_date) ) return queryset Below is my models.py class Event(models.Model): emp_id = models.IntegerField(max_length=50) event_type = models.CharField(max_length=50) event_date = models.DateTimeField() email = models.EmailField() def __str__(self): return f"{self.event_type} {self.event_date} {self.email}" In the django admin page when I am creating an event, I see below output ID Emp id Event type Event date Email 6 67565 Birthday Nov. 15,2010,6 a.m. jhad@jhsd.com Below is the urls.py for project level and app level respectively urlpatterns = [ path('admin/', admin.site.urls), path('emp/', include('EVENTS.urls')), ] from django.urls import path from .views import FilterByMonthView urlpatterns = [ path('filter/<int:month>/', FilterByMonthView.as_view(), name='filter-by-month'), ] HTML looks as below <!DOCTYPE html> <html> <head> <title>Filtered Events</title> </head> <body> <h1>Events for the Selected Month</h1> <ul> {% for event in filtered_data %} <li>{{ event.event_date }} - {{ event.event_name }}</li> <!-- Display other event attributes as needed … -
How do I make the openai api message output in real time?
I'm trying to make a chatbot website. I want the ai's response to be sent chunk by chunk as soon as the chunk is processed, but the output message is being sent all at once on my website. In the terminal, I made it so that the response gets outputted as soon as each chunk is processed, and it worked for the terminal using this code: print(chunk_message['content'], end='', flush=True) But I can't figure out how to make it send as soon as each chunk was processed in my website. I made the browser console print out the times when the chunks were sent to it and they all were apparently sent at the same time. I know that is the problem but I can't figure out how to solve it. Here is my github link for the full code: https://github.com/Breath3Manually/chat-bot.git the important files are the consumers.py file and the chat_view.html file any help will be appreciated, I've spent 2 days trying to fix this <3 I want the ai's response to be sent chunk by chunk as soon as the chunk is processed, but the message is being sent only after all of the chunks have finished processing. -
NGINX UWSGI Permission Denied
Using: Ubuntu 20.04 Python 3.8.10 not using virtualenv. Everything is installed globally. I am trying to deploy a Django website on my VPS using uwsgi and nginx but I keep getting 502 error code. In nginx error.log file I have the following exception: *543 connect() to unix:/root/uwsgi/testproject.sock failed (13: Permission denied) while connecting to upstream The project structure is as follows: wsgi file: root/html/testproject/testproject/wsgi.py uwsgi ini: root/uwsgi/sites/testproject.ini socket: root/uwsgi/testproject.sock Note: I have used the root user during the whole setup. testproject.ini [uwsgi] chdir=/root/html/testproject wsgi-file=/root/html/testproject/testproject/wsgi.py socket=/root/uwsgi/testproject.sock chmod-socket=666 uid=www-data gid=www-data master=True pidfile=/tmp/project-master.pid vaccum=True max-requests=5000 daemonize=/tmp/uwsgi.logs /etc/nginx/sites-available/testproject server{ listen 80; server_name 85.31.237.228; location / { include uwsgi_params; uwsgi_pass unix:/root/uwsgi/testproject.sock; } } Can someone please help me figure out what I'm doing wrong? I have switched between 666 and 644 for chmod param but nothing worked. -
Python:Selenium finding element by XPATH by Django If statement class
I am trying to test a simple notification page in Django using Selenium to test whether notifications are marked as read. To do this, I have a notifications model which includes a boolean field, defaults to False if the notification hasn't been read. I want to be able to show that some are read, and some aren't by using css. I have the following html which works exactly as I want it to when running runserver; however, I can't get it to pass the tests. {% for notification in notifications %} <div class="notification-card {% if notification.read == False %} unread {% else %} read {% endif %}"> <h3>Badge Awarded</h3> {% endfor %} Then in my Selenium test file, I have the following line. If I hardcode the class in the html file, this test passes, but if I try to add Django for the class selector, the test fails. unread_notifications = self.browser.find_element(By.XPATH, '//div[@class="notification-card unread"]/h3') self.assertEqual(unread_notifications.text, 'Badge Awarded') How do I find the desired element? I have already tried using '//div[contains(@class="unread")]/h3' to no avail. I don't want to hardcode the html because the next test is to find the read notifications. -
Django: ClearableFileInput does not support uploading multiple files -- error?
I am trying to add an option to add multiple files at once in a form, and I found the solution with using ClearableFileInput: class Image(models.Model): id = models.AutoField(primary_key=True) post = models.ForeignKey(BlogEntry, on_delete=models.CASCADE) photo = models.ImageField(null=True, blank=True, upload_to='media/') photo_objects = models.Manager() class ImageForm(forms.ModelForm): class Meta: model = Image fields = ['photo', ] widgets = { 'photo': forms.ClearableFileInput(attrs={'multiple': True}) } However, when I tried to run it using runserver, it gave me an error. Can somebody help me with fixing it? Is there another straightforward option to add multiple files? I tried to search difference solutions on the internet but some of them did not work while others looked too complicated for my current level. I also see this option to upload multiple files in the official documentation (https://docs.djangoproject.com/en/dev/topics/http/file-uploads/) but I wonder if there is a simpler version in which I would not need to create MultipleFileInput and MultipleFileField by myself. Is there something in Django to enable multiple file upload? -
Trying to migrate from Vue-cli to Vite and Components are not Rendering
I have this django and vue 2 application that is currently using vue-cli and webpack loader but I'm trying to migrate the application to vite. I've gone through what I thought would be all the steps. But when I build and run the dev server and have it communicate with the backend, loading it at localhost:8000, although I see all the vue, js, sass, scss components in the networks tab in dev tools returning 200s I don't see anything show up on the page. Anyone ever face this issue before and know what the issue might be? I've followed all the steps from here and was expecting my components to at least render even if there were some errors that I could worry about troubleshooting after, but instead I see 200s for all my components in the network tab but a blank page. My django endpoints are also not showing up in the terminal or network tab. -
Django-Project folder not found inside a script
I'm having a problem including the settings.py file inside a script. My django project uses a script that fills my database with models. To do this, I use following code: # some imports import <project_name>.settings as app_settings from <app_name>.models import ( .... different models) settings.configure( INSTALLED_APPS=app_settings.INSTALLED_APPS, DATABASES=app_setttings.DATABASES ) django.setup() # read file external file and insert data (model) into the db.sqlite3 database The problem is that the module <project_name> can not be found. The above script is in the project directory. The error is thrown in line import <project_name>.settings as app_settings. : ModuleNotFoundError: No module named '<project_name>' Why can't the script include the project folder? -
Paypal Webhook get Email from request data
I am building an endpoint that receives the webbhooks from paypal. At the event PAYMENT.SALE.COMPLETED a mail should be sent. Of course the email has to be filtered from the request data. However, neither in the request.META nor in the eventbody such information can be found. The situation is different for the BILLING.SUBSCRIPTION.ACTIVATED. There you can find the email in the eventbody. But since this is a completely different event and not an indicator for a successful payment, I cannot use this. Does anyone have experience with this, how to use the email forPAYMENT.SALE.COMPLETED to get the email of the Paypal user account? -
How is the value of page column under wagtailcore_page table is populated. How is it decided which page will have what value?
I need to insert bulk pages in wagtail database and I need to find out how is the value of path column under wagtailcore_page table is decided? I tried looking into the database but couldn't map the value of this path column to the path of the page. -
Django - Image not supporting while DEBUG = False
In my Django project some of dynamic image files is not served when I change the DEBUG mode into False, other static files are working properly the issue that I faced only in the case of some images. For example if I have 20 products contain 20 images maybe 5 or 6 will not show rest of them have issues. How can I solve the issue in a production time I can't make DEBUG in True mode, for static serving I have used WhiteNoise module. -
How to display the errors of the "Django authentication system" in a template?
I use Django authentication system for my project. According to the structure of the template, I have to use the form fields individually. This is signup template: <section class="form-container___auth"> <div class="form-container"> <img src="{% static './images/white-logo-all.png'%}" /> <p class="title">ثبت نام دانش آموز</p> <form class="form" method="post" action=""> {% csrf_token %} <div class="input-group"> <label for="email">ایمیل</label> <input type="email" name="{{ form.email.name }}" id="{{ form.email.id_for_label }}" placeholder="" value="{{ form.email.key }}"> </div> <div class="input-group"> <label for="email">نام کاربری</label> <input type="text" name="{{ form.username.name }}" id="{{ form.username.id_for_label }}" placeholder="" value="{{ form.username.key }}"> </div> <div class="input-group"> <label for="password">رمز عبور</label> <input type="password" name="{{ form.password1.name }}" id="{{ form.password1.id_for_label }}" placeholder="" value="{{ form.password1.key}}"> </div> <div class="input-group"> <label for="password">تکرار رمز عبور</label> <input type="password" name="{{ form.password2.name }}" id="{{ form.password2.id_for_label }}" placeholder="" value="{{ form.password2.key}}"> </div> <button type="submit" class="sign">ثبت نام</button> </form> <div class="social-message"> <div class="line"></div> <p class="message">ورود</p> <div class="line"></div> </div> <p class="signup">.اگر حساب کاربری دارید ، وارد سایت شوید <a rel="noopener noreferrer" href="{% url 'login' %}" class="">ورود</a> </p> </div> </section> Django authentication system detects the errors and provides them to you, but I don't know how to display the errors of each field in my template. Now how can display the errors? -
Django cannot run because GDAL is loading wrong libtiff version
I am unable to run Django on my MacOS Ventura. Looking at the error, I think GDAL is unable to load libtiff library. I did some investigation, I do have libtiff installed. % otool -L /opt/homebrew/lib/libgdal.dylib | grep libtiff /opt/homebrew/opt/libtiff/lib/libtiff.6.dylib (compatibility version 7.0.0, current version 7.1.0) If looking at the error, I think its trying to load libtiff.5.dylib, but I have libtiff.6.dylib. How can I get GDAL to load the installed libtiff ? % python manage.py runserver Watching for file changes with StatReloader 2023-10-01 17:14:00,801 INFO Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "/opt/homebrew/Cellar/python@3.9/3.9.18/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 980, in _bootstrap_inner self.run() File "/opt/homebrew/Cellar/python@3.9/3.9.18/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 917, in run self._target(*self._args, **self._kwargs) File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/utils/autoreload.py", line 54, in wrapper fn(*args, **kwargs) File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/utils/autoreload.py", line 77, in raise_last_exception raise _exception[1] File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/core/management/__init__.py", line 337, in execute autoreload.check_errors(django.setup)() File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/utils/autoreload.py", line 54, in wrapper fn(*args, **kwargs) File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/apps/registry.py", line 91, in populate app_config = AppConfig.create(entry) File "/Users/myproj/Documents/project/projectdotcom/env_m1/lib/python3.9/site-packages/django/apps/config.py", line 90, in create module = import_module(entry) File "/opt/homebrew/Cellar/python@3.9/3.9.18/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line …