Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Outputting csv in django didnt working automatically
so i try to outputting csv files with django the problem is when i try to press the export button , it didnt did anything except i open tab with F12 -> press network , and i see some url there when i click export , then i click it (Like in the picture i give here). But i want it to do automatically after i click the export button i already did what i do like in django documentation is there anyproblem with the code? or the problem with my browser?need help Here's the code (HTML and Views) <div class="col-lg-12"> <div class="form-panel"> <form action="#" class="form-horizontal style-form" id="form1"> <div class="form-group"> <label class="control-label col-md-3">Campaign Name</label> <div class="col-md-3 col-xs-11"> <input id = "campaign_name" type="text" class="form-control form-width"> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Campaign Type</label> <div class="col-md-3 col-xs-11"> <div class="btn-group"> <select id = "campaigntype" style="width:425px;background-color:white;height:30px;font-color:red;text-align-last:center;"> <option disabled selected value>-- Choose --</option> <!-- <li><a href="#"></a></li> --> <option value = "Informasi" >Informasi</option> <option value = "Promosi" >Promosi</option> <!-- <li><a href="#">Dropdown link</a></li> --> </select> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Segment</label> <div class="col-md-3 col-xs-11"> <div class="btn-group"> <select id = "segment_list_name" style="width:425px;background-color:white;height:30px;font-color:red;text-align-last:center;"> <option disabled selected value>-- Choose --</option> <!-- <li><a href="#"></a></li> --> {% for x in … -
django.core.exceptions.ImproperlyConfigured: The included URLconf does not appear to have any patterns in it
I have a django 3 app i made following a tutorial. The tutorial was for django 2 but i would like to learn how to do it in django 3. I got this error and i do not understand what to do to correct this error. The error mentions something about a circular import. django.core.exceptions.ImproperlyConfigured: The included URLconf '' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import. The have provided the important code below along with the error with the full error /main_project/urls.py from django.contrib import admin from django.urls import path, include from django.views.generic.base import TemplateView urlpatterns = [ path('admin/', admin.site.urls), path('users/', include('users.urls')), path('users/', include('django.contrib.auth.urls')), path('', TemplateView.as_view(template_name='home.html'), name='home'), ] users/urls.py from django.urls import path from .views import SignUpView urlspatterns = [ path('signup/', SignUpView.as_view(), name='signup') ] Full Error Exception in thread django-main-thread: Traceback (most recent call last): File "/home/vicktree/.local/share/virtualenvs/news-PoORdt_O/lib/python3.7/site-packages/django/urls/resolvers.py", line 590, in url_patterns iter(patterns) TypeError: 'module' object is not iterable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/vicktree/.local/share/virtualenvs/news-PoORdt_O/lib/python3.7/site-packages/django/utils/autoreload.py", line … -
Django detailview filter by other fields like isbn
If I have another field like ISBN in book so how do I filter with this field in from django.views.generic import DetailField here is my book/urls.py file code urlpatterns = [ path('',BookListView.as_view(), name="book_list"), path('<isbn>/',BookDetailView.as_view(), name="book_detail") ] book/views.py class BookDetailView(DetailView): template_name = "book/detail.html" def get_queryset(self,*args, **kwargs): print(self.kwargs['isbn']) return BookModel.objects.filter(isbn=self.kwargs['isbn']) and the Error is Generic detail view BookDetailView must be called with either an object pk or a slug in the URLconf. -
How to make a reverse Foreign Key in multiple tables with annotate/aggregate
I have 3 models connected to one by Foreign Key like: class A(models.Model): name = models.CharField(max_length=20) class B(models.Model): a = models.ForeignKey(A, on_delete=models.CASCADE) amount_b = models.CharField(max_length=20) class C(models.Model): a = models.ForeignKey(A, on_delete=models.CASCADE) amount_c = models.FloatField() class D(models.Model): a = models.ForeignKey(A, on_delete=models.CASCADE) amount_d = models.CharField(max_length=100) And I want to make an JOIN query based on the foreign keys using Django ORM to get the sum of each amount. In SQL I would make something like: SELECT a.name, b_sum, c_sum, d_sum FROM A AS a LEFT JOIN (SELECT b.a, sum(amount_b) as b_sum from B as b group by b.a) as AB AB.a = a.id LEFT JOIN (SELECT c.a, sum(amount_c) as c_sum from C as c group by a) AS AC ON AC.a = a.id LEFT JOIN (SELECT d.a, sum(amount_d) as d_sum from D as d group by a) AS AD ON AD.a = a.id WHERE a.name LIKE 'init%' But I didn't thing something like that on django ORM. -
Vue: Should a component's data be updated via JS or an API call?
Imagine in a Vue app I have a parent component. Amongst other things, it includes a "total" which shows the total value of its linked child components. This "total" data originally comes from a Django database where it is a @property in the parent model. <template> <div> <p>Total value: ${{parent.total}}</p> </div> </template> On page load, this parent total is loaded (with other data) via an API call: getParentData() { let endpoint = `/api/parent/${this.id}/`; apiService(endpoint) .then(data => { this.parent = data }) } Now, the child data can be manipulated via some grandchildren (add, delete, etc). This is easy enough to do with $emit and some simple code to update the list of children. The list of children updates automatically through Vue's reactivity when the $emit is fired. Child: <template lang="html"> <div v-for="child in children" :key="child.id"> <p>{{ child.name }} ${{child.amount}} <DeleteChild :some-data:"data" @delete-child="deleteChild"/> </p> </div> </template> deleteChild(childToDelete) { this.$delete(this.children, this.children.indexOf(childToDelete)); }, My question is: What is the accepted best practice to update the parent component? The way I see it there are two options Use $listener to send a signal all the way to the parent then call getParentData. Use $listener (or Vuex) to update the actual data() of the parent, … -
How to catch HTTP request of python selenium web driver?
I am making a web application with Django-Gunicorn-Nginx. It is a kind of closed community. Therefore at the start of sign-up, authentication by the third-party server is required. Because the third-party server does not provide official auth API, I'm trying to implement module by my self with python selenium. I have built the module in a python file in Django accounts app directory. When I test the module with the terminal by python3 somemodulename.py, it works perfectly. However, when I import the module(which is a function) in view.py of the accounts app and test with browser, at some point, the third-party app throws an invalid session message. It never happened when I test exactly the same function with the terminal. So, if there is any way to catch HTTP request that selenium chrome web driver sends, I would like to compare both cases for debugging. How could one get the full HTTP request of Chrome web driver with python selenium, without interfering the process of code? I am sorry that I could not append the actual code because of the security issue. -
How i can to render form error in django cms
in djangocms have many plugin in page. i have a Contactform plugin and more plugins in one page. i want to display error in form when user submit invalid data. this my code in views.py def savecontactform_1(request): if request.method == "POST": form = forms.ContactForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect("/thank-you") else: return render_to_response(.......?????.......) when i use render_to_response('form.html',{'form':form}) it render form.html only. not render page contain many plugins. thank for expert. -
Pandas KeyError when testing Dash app on Django server
So I am developing a Django site for a Dash app and after a lot of research, I've been stopped dead in my tracks with this KeyError. I'm using PyMongo to retrieve data into a Pandas DataFrame. When I run the code line-by-line in a notebook, it runs without errors, but as soon as I try to update my app with a Dash RangeSlider, I'm getting this KeyError. File "/home/xristos/anaconda3/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/xristos/anaconda3/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/xristos/anaconda3/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/xristos/anaconda3/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/home/xristos/anaconda3/lib/python3.7/site-packages/django_plotly_dash/views.py", line 74, in update return _update(request, ident, stateless, **kwargs) File "/home/xristos/anaconda3/lib/python3.7/site-packages/django_plotly_dash/views.py", line 93, in _update resp = view_func() File "/home/xristos/anaconda3/lib/python3.7/site-packages/django_plotly_dash/dash_wrapper.py", line 505, in dispatch return self.dispatch_with_args(body, argMap=dict()) File "/home/xristos/anaconda3/lib/python3.7/site-packages/django_plotly_dash/dash_wrapper.py", line 565, in dispatch_with_args res = self.callback_map[target_id]['callback'](*args, **argMap) File "/home/xristos/anaconda3/lib/python3.7/site-packages/dash/dash.py", line 1339, in add_context output_value = func(*args, **kwargs) # %% callback invoked %% File "/home/xristos/projects/2020-primary-election-tracker/tw33tyPyElections/homepage/dash_apps/finished_apps/sentiment.py", line 84, in update_figure dates_df = can_data.set_index(can_data['date'], drop=True) File "/home/xristos/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 2980, in __getitem__ indexer = self.columns.get_loc(key) File "/home/xristos/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2899, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc … -
Django register with email error UNIQUE constraint failed: auth_user.username
I am trying to register my users without email and i get an error. Here is my code : forms.py def save(self, commit=True): user = super(RegistrationForm, self).save(commit=False) user.email = self.cleaned_data['email'] user.first_name = self.cleaned_data['first_name'] user.last_name = self.cleaned_data['last_name'] if commit: user.save() return user views.py def register(request): if request.method == 'POST': form = RegistrationForm(request.POST) form.save() return redirect('login/') else: form = RegistrationForm() args = {'form': form} return render(request, 'account/register.html', args) settings.py ACCOUNT_USER_MODEL_USERNAME_FIELD = None ACCOUNT_USERNAME_REQUIRED = False ACCOUNT_USER_MODEL_EMAIL_FIELD = "email" ACCOUNT_UNIQUE_EMAIL = True ACCOUNT_AUTHENTICATION_METHOD = "email" -
Data rendering in django
Each user has certain vacations that he adds , i want to render him his vacations not anyone else's or the entire vacations what sjould i do ? the below view returns the entire queryset of the vacations def all_Vacations(request): vacations = Vacation.objects.all() return render(request, 'homePage.html', {'vacations': vacations }) -
Initial values do not appear in the form rendered
I'm having some problems to solve a problem. I have a template, which allows the user to change some of their account settings. My goal is to initialize the form, with the user's default values, and he can keep or change them (by after submit form). However, until now the page does not render these values. I'm using a class based view, CreateView, for this purpose. My code is listed below. Here, is my CreateView. enter image description here Here the form. enter image description here And finally an extract of template. enter image description here I'd appreciate it if you could help me. I am new to the Django environment, and have tried many approaches, and I have not yet been able to solve this problem. -
Django DetailView filter by two parameters not using the primary key
I need to filter a model by two values that none of them is the PK of the model. I want to filter the payments for an specific car and week, this means that I can have more than one payment for a car and in a week. I'm using Django-Tables2 to display the results. views.py class PagosDetailView(SingleTableMixin, DetailView): template_name = "AC/paymentsbycarandweek.html" context_table_name = 'table' model = Pagos table_class = PagosTable slug_url_kwarg = 'carro_id' def get_queryset(self): qs = super(PagosDetailView, self).get_queryset() return qs.filter(carro=self.kwargs['carro'], semana=self.kwargs['semana']) models.py class Pagos(models.Model): carro = models.ForeignKey( Carros, on_delete=models.CASCADE, blank=False, null=False) pago = models.DecimalField(max_digits=6, decimal_places=2) fecha = models.DateField( auto_now=False, auto_now_add=False, blank=True, null=True) semana = models.CharField(max_length=20) startweek = models.DateField( auto_now=False, auto_now_add=False, blank=True, null=True) endweek = models.DateField( auto_now=False, auto_now_add=False, blank=True, null=True) renta = models.ForeignKey( Renta, on_delete=models.PROTECT, blank=False, null=False) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Meta: verbose_name_plural = "Pagos" def get_absolute_url(self): return reverse('pagos') def __str__(self): return self.semana urls.py path('paymentsbycarandweek/<int:carro>/<slug:semana>', views.PagosDetailView.as_view(), name='pagos_bycar') This last time that I have tried several options, I'm getting the following error message: Generic detail view PagosDetailView must be called with either an object pk or a slug in the URLconf. How exactly can I pass these two parameters? -
Custom User model not authenticating to Admin
I'm trying to create my own User model. I followed the instructions here and it works fine when I run the createsuperuser command. But it won't authenticate in Admin. Also, is a way to refactor the code in create_user and create_superuser? class MyUserManager(BaseUserManager): def create_user(self, first_name, last_name, email, mobile_phone, date_birth, region, is_admin=False, is_staff=False, password=None): if not email: raise ValueError('Users must have an email address') user = self.model( first_name = kwargs['first_name'], last_name = kwargs['last_name'], mobile_phone = kwargs['mobile_phone'], date_birth = kwargs['date_birth'] ) user.set_password(kwargs['password']) user.save(using=self._db) return user def create_superuser(self, first_name, last_name, email, mobile_phone, date_birth, region, password=None): if not email: raise ValueError('Users must have an email address') user = self.model( first_name = kwargs['first_name'], last_name = kwargs['last_name'], mobile_phone = kwargs['mobile_phone'], date_birth = kwargs['date_birth'], is_admin = True, is_staff = True ) user.set_password(kwargs['password']) user.save(using=self._db) return user class BaseUser(AbstractBaseUser): REGION_CHOICES = [ ('I', 'Tarapacá'), ('II', 'Antofagasta'), ('III', 'Atacama'), ('IV', 'Coquimbo'), ('V', 'Valparaíso'), ('VI', 'Libertador General Bernardo O\'Higgins'), ('VII', 'Maule'), ('VIII', 'Concepción'), ('IX', 'Araucanía'), ('X', 'Los Lagos'), ('XI', 'General Carlos Ibañez del Campo'), ('XII', 'Magallanes y de la Antártica Chilena'), ('RM', 'Metropolitana de Santiago'), ('XIV', 'Los Ríos'), ('XV', 'Arica y Parinacota'), ('XVI', 'Ñuble') ] first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) email = models.CharField(max_length=50, unique=True) mobile_phone = models.CharField(max_length=9, unique=True) date_birth … -
Vimeo Thumbnail Generator works in development, but not production?
I have a site where users post video links (vimeo, youtube, instagram), and the site automatically files them and generates a thumbnail. For youtube and instagram this is very easy as you simply pull the ID from the URL and insert it into the thumbnail path and it works. Vimeo, however, does not share the same ID for the video and its thumbnails. There is a big post from a while back with several different solutions to generate vimeo thumbnails from the ID, multiple of which work while on development on the local server, but neither of which work while online. Any thoughts as to why this might be? Below are two of the codes I've tried, neither of which work unfortunately: <img id="{{video.id}}thumb" class="img-responsive img-fluid img-thumbnail;" style="position: absolute; top: -9999px; left: -9999px; right: -9999px; bottom: -9999px; margin: auto; width:320px"/> <script> $(document).ready(function () { var vimeoVideoUrl = 'https://player.vimeo.com/video/{{video.vimeo_id}}'; var match = /vimeo.*\/(\d+)/i.exec(vimeoVideoUrl); if (match) { var vimeoVideoID = match[1]; $.getJSON('http://www.vimeo.com/api/v2/video/' + {{video.vimeo_id}} + '.json?callback=?', { format: "json" }, function (data) { featuredImg = data[0].thumbnail_large; $('#{{video.id}}thumb').attr("src", featuredImg); }); } }); </script> and <img class="{{video.vimeo_id}} img-responsive img-fluid img-thumbnail;" style="position: absolute; top: -9999px; left: -9999px; right: -9999px; bottom: -9999px; margin: auto; width:320px"/> <script> … -
Is it possible to use django-celery-beat with django-tenant?
I am using celery for scheduling tasks. So far everything was fine, including hosted on AWS. However, I decided to transform my single application to multi tenant, using django-tenant. That way, I can create the subdomains perfectly. ./manage.py create_tenant However, when running the command celery -A myproject worker -B, despite not showing me any error, It seems to me that he cannot run for the created schema (test with only one created). I tried to specify the schema, using python manage.py tenant_command celery worker -B --loglevel = info --schema = myschema but I received the following error: raise CommandError ("Unknown command:% r"% argv [2]) django.core.management.base.CommandError: Unknown command: 'celery' If anyone can help me, I really appreciate It! If It is possible to run the command for a specific schema, is It also possible to run globally for all schemas created? Thanks! -
Translate table sql to django model
I have a table in sql who are a realtionship between other two tables. Whall a do to get this table as django models class? -
Django AJAX modal not showing up
I'm trying to display modal form on button click using ajax, but after clicking there is nothing shown on the screen. JS function. What is strange is that the hrml_form is shown as unresolved variable, maybe this is the problem? $(function() { $('.js-create-book').click(function() { $.ajax({ url: '/patients/create/', type: 'get', dataType: 'json', beforeSend: function () { $("#modal-book").modal("show"); }, success: function (data) { $("#modal-book .modal-content").html(data.html_form); } }); }); }); forms.py file from django import forms from .models import Patients class PatientForm(forms.ModelForm): class Meta: model = Patients fields = ('name', 'surname', 'gender', 'birth_date', 'pesel', 'phone', 'email') views.py def patients_create(request): form = PatientForm() context = {'form': form} html_form = render_to_string('dental/partial_patient_create.html', context, request=request) return JsonResponse({'html_form': html_form}) partial_patient_create.html {% load widget_tweaks %} <form method="post"> {% csrf_token %} <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <h4 class="modal-title">Create a new book</h4> </div> <div class="modal-body"> {% for field in form %} <div class="form-group{% if field.errors %} has-error{% endif %}"> <label for="{{ field.id_for_label }}">{{ field.label }}</label> {% render_field field class="form-control" %} {% for error in field.errors %} <p class="help-block">{{ error }}</p> {% endfor %} </div> {% endfor %} </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Create book</button> </div> </form> I would be very … -
How to pass a variable from views to base.html in Django?
I want to show the user's first name on the navbar of my project. This navbar is on the base.html file. In my views.py I have created a variable that does this def base(request): user = request.user u = User.objects.get(username=user) us = u.clients.first_name context = {'u': u, 'us': us} return render(request, "backend/base.html", context) I can get it to work on any other .html file, but not on the base.html, that looks like this <span class="mb-0 text-sm font-weight-bold">{{us}}</span> This is my model class Clients(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=30, verbose_name="Primeiro Nome") last_name = models.CharField(max_length=30, verbose_name="Apelido") address = models.CharField(max_length=200, verbose_name="Morada") nif = models.CharField(max_length=9, verbose_name="NIF", validators=[RegexValidator(r'^\d{1,10}$')], primary_key=True) mobile = models.CharField(max_length=9, verbose_name="Telemóvel", validators=[RegexValidator(r'^\d{1,10}$')]) email = models.CharField(max_length=200, null=True, verbose_name="Email") def __str__(self): return "%s %s" % (self.first_name, self.last_name) class Meta: verbose_name_plural = "Clientes" -
Django save() not sending to database
my from is not sending data to database here is my view.py and form.py And yet they are no error reported on my console views.py def register(request): if request.method == 'POST': form = RegistrationForm(request.POST) return redirect('../login/') else: form = RegistrationForm() args = {'form': form} return render(request, 'account/register.html', args) forms.py class RegistrationForm(UserCreationForm): def save(self, commit=True): user = super(RegistrationForm, self).save(commit=False) user.email = self.cleaned_data['email'] user.first_name = self.cleaned_data['first_name'] user.last_name = self.cleaned_data['last_name'] if commit: user.save() return user -
how can i add the logged in user's name in form django
I just want to put the username of the logged in user inside the author filed and at the same time assign the author filed as the user's username in the data base , i am using django def create_vacation(request): form = creationForm(request.POST or None) vacations = Vacation.objects.all() vacations.author=request.user.username if form.is_valid(): form.save() return redirect('/vacations/all') return render(request, 'creationForm.html', {'form': form}) and this is the vacation model class Vacation(models.Model): vacationInformation = models.TextField() startDate= models.DateTimeField('start date') endDate = models.DateTimeField('end date') author = models.ForeignKey(User, null=True, on_delete=models.SET_NULL) def __str__(self): return self. vacationInformation this is the form template <form method="post" novalidate> {% csrf_token %} {% for hidden_field in form.hidden_fields %} {{ hidden_field }} {% endfor %} {% if form.non_field_errors %} <div class="alert alert-danger" role="alert"> {% for error in form.non_field_errors %} {{ error }} {% endfor %} </div> {% endif %} {% for field in form.visible_fields %} <div class="form-group"> {{ field.label_tag }} {% if form.is_bound %} {% if field.errors %} {% render_field field class="form-control is-invalid" %} {% for error in field.errors %} <div class="invalid-feedback"> {{ error }} </div> {% endfor %} {% else %} {% render_field field class="form-control is-valid" %} {% endif %} {% else %} {% render_field field class="form-control" %} {% endif %} {% if field.help_text … -
Is there a way to stop Django from automatically ordering a database?
So I have a migration script I use to load data into my Django database (sqllite). I would like the data to appear in the database in the order that I load it in (i.e, I load in line by line for a text file, and I want the order of the lines to be preserved). However, when I make queries or view the database, it is automaitcally sorted by alphabetical order based on my primary key. Is there a way to disable this automatic storing and have the data appear in the order it was inputted? I suppose a solution would be to attach a field to each object that has its "load-in position" however id like avoid having to do this if possible edit: I would specifically like to preserve the order of elements inputted into a ManyToManyField -
ValuesQuerySet type hint
What type hint to use for a function which returns a queryset like the one below? def _get_cars_for_validation(filter_: dict) -> QuerySet: return ( Car.objects.filter(**filter_) .values("id", "brand", "engine") .order_by("id") ) mypy returns an error Incompatible return value type (got "ValuesQuerySet[Car, TypedDict({'id': int, 'brand': str, 'engine': str})]", expected "QuerySet[Any]") I would use ValuesQuerySet but it was removed in Django 1.9. ValuesQuerySet reported by mypy comes from 3rd party lib django-stubs (and I am unable to import it; is it actually possible?). -
CORS error when posting data to my DRF API from a template within the project itself
I have a Django project that has an end-point created using DRF. I am posting data to it from a template within the project itself (another rendered view). However, I get the following error code: 403 Unauthorized. CSRF token not provided. This makes no sense because both the end-point and the view shares the same origin. So why am I getting this error? And how can I solve this issue? Thanks for any help. -
Is there a security risk placing two nginx internal location block directories beside each other?
I have a Django app where I need to serve public as well as private media (images, docs, etc..). I was thinking about using the following location blocks in nginx: Location /media/public { Internal Alias: /media/public } Location /media/private { Internal Alias: /media/private } My thought is that I can create a url pattern in my Django app to /media/private and be able to authenticate users file requests for private files. Would the above be secure though? Can two directories like this live side by side? Is there a better way? -
Django Pillow Install Works for Migrate, But Not Run
When running mange makemigrations, I got an error that said I needed to install Pillow because I was using an ImageField. I ran the following on MacOS: python3 -m pip install pillow Defaulting to user installation because normal site-packages is not writeable Collecting pillow Downloading Pillow-7.0.0-cp37-cp37m-macosx_10_6_intel.whl (3.9 MB) |████████████████████████████████| 3.9 MB 2.1 MB/s Installing collected packages: pillow Successfully installed pillow-7.0.0 When I ran the checkmigrations again, it didn't complain and the migrate worked as well. In my models.py file, I didn't receive any errors (from PyCharm) for the follow import: from PIL import Image I read I had to use this command in place of Pillow. Using Pillow gets flagged as not found. When I ran the run command in PyCharm, I get the error: ERRORS: base.Team.profile_image: (fields.E210) Cannot use ImageField because Pillow is not installed. HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow". When I check the Project Interpreter in PyCharm, it shows Pillow as a package at the latest version. I've used home-brew to install the latest version of Python3. There is also the outdated MacOS version. Could Pillow it be installed in the wrong location? How could I tell? Another odd thing …