Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Is there any way to pass an ID from URL to views.py using generic views?
I need to pass id from the url slug. I am using generic views. This is my code for urls.py: path('category/<int:pk>/details/', CategoryDetailView.as_view(), name='category-details'), and I need to pass the <int:pk> value into views.py, so I can filter my queryset with this id. My views.py code: class CategoryDetailView(DetailView): model = Category def get_context_data(self, *, object_list=Expense.objects.get_queryset(), **kwargs): queryset = object_list return super().get_context_data( summary_per_year_month = summary_per_year_month(queryset.filter(category_id= <int:pk> )) ) -
Django with Docker error 'SessionStore' object has no attribute '_session_cache'
I have an app in which I use Django authentication. When I use it locally with classic python manage.py runserver All works fine, but when I try to run it from docker I get a TypeError Exception Value: argument 1 must be str, not PosixPath Which is triggering from this piece of code in my template {% if user.is_authenticated %} And then I get this error, During handling of the above exception ('SessionStore' object has no attribute '_session_cache'), another exception occurred: Any idea what happening here? -
How to display a DIV during a period of time? Javascript
I have a queary in Django that shows all the posts of the current user Ordered by the starting date of the post. I want to display a DIV in the html template that says: “Will start soon” ,15 minutes before the Starting time of the post. Does anybody knows in Javascript how can I display that html div During the last 15 minutes before the post starts? I have two fields for making this script works: Start_date and start_time Thank you very much! Any idea is welcome! -
open edx mobile rest Api
oauth2 is not avilable in django admin how can I add oauth2 to the django admin I have tried with pip install django-oauth-toolkit and then added that to the common.py INSTALLED_APPS = ( ... 'oauth2_provider', ) but I got an error how can I fix it Thanks -
Django-Q and request.POST data
I have a budget app I am working on and using Django and Django-Q. I want to create a schedule to post automatically an expense based on a Django-Q schedule I create. The issue I am having is understanding the logic of using three positional arguments in my Djano-Q Schedule. The three positional arguments are request, budget_id and category_id. I want to post data to my add_expense view, which will create an initial expense based on the form data, and then create a Django-Q schedule to trigger an expense creation to run every month with that same data going forward. Can anybody help shed some light on this process? Thanks. -
TemplateDoesNotExist for detail.html but works for index.html (Django Tutorial Part 3)
I'm at my wit's end trying to fix this super strange error where one template works perfectly fine but the other doesn't??? I'm following the Django tutorial and when it comes to the part where I'm supposed to raise a 404 error the prompt tells me that detail.html does not exist at the given source even though it DOES. my views.py file: from django.shortcuts import render from django.http import Http404 from .models import Question # Create your views here. def index(request): latest_question_list = Question.objects.order_by('-pub_date')[:5] context = {'latest_question_list': latest_question_list} return render(request, 'polls/index1.html', context) def detail(request, question_id): question = Question.objects.get(pk = question_id) return render(request, 'polls/detail.html', {'question': question}) the error: Internal Server Error: /polls/1/ Traceback (most recent call last): File "C:\Users\Admin\Appdata\Local\Programs\Python\Python38\Scripts\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "C:\Users\Admin\Appdata\Local\Programs\Python\Python38\Scripts\env\lib\site-packages\django\core\handlers\base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\Admin\Appdata\Local\Programs\Python\Python38\Scripts\env\Scripts\mysite\polls\views.py", line 15, in detail return render(request, 'polls/detail.html', {'question': question}) File "C:\Users\Admin\Appdata\Local\Programs\Python\Python38\Scripts\env\lib\site-packages\django\shortcuts.py", line 19, in render content = loader.render_to_string(template_name, context, request, using=using) File "C:\Users\Admin\Appdata\Local\Programs\Python\Python38\Scripts\env\lib\site-packages\django\template\loader.py", line 61, in render_to_string template = get_template(template_name, using=using) File "C:\Users\Admin\Appdata\Local\Programs\Python\Python38\Scripts\env\lib\site-packages\django\template\loader.py", line 19, in get_template raise TemplateDoesNotExist(template_name, chain=chain) django.template.exceptions.TemplateDoesNotExist: polls/detail.html The following is what shows up on the webpage: Template-loader postmortem Django tried loading these templates, in this order: Using … -
Django Admin Million Data - Admin page takes too long to open
I have a million lines of data on my website. I am very waiting when I want to reach this page via admin. Maybe 40-50 seconds. I did the pagination 20, but nothing changed. Currently the default is 100. Its my admin code @admin.register(PollVote) class PollVoteAdmin(admin.ModelAdmin): list_display = ['title','referer','vote','ip', 'created_date'] ordering = ('-created_date',) search_fields = ['ip'] raw_id_fields = ['title'] What can I do to speed up this page in Admin? -
django.core.exceptions.ImproperlyConfigured: WSGI application 'DjBlog.wsgi.application' could not be loaded; Error importing module
I started a website building project With Django, but you ran into a problem with the WSGI server and but I haven't change any thing Please anyone who knows the answer, let me know this is the code that I wrote settings.py INSTALLED_APPS = [ # 'django.contrib.admin', 'django.contrib.admin.apps.SimpleAdminConfig', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'django.contrib.sitemaps', 'mdeditor', 'haystack', 'blog', 'accounts', 'comments', 'oauth', 'servermanager', 'owntracks', 'compressor', # 'corsheader', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheader.middleware.CorsMiddleware', 'django.middleware.gzip.GZipMiddleware', 'corsheaders.middleware.CorsMiddleware', # 'debug_toolbar.middleware.DebugToolbarMiddleware', 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.http.ConditionalGetMiddleware', 'blog.middleware.OnlineMiddleware' ] ROOT_URLCONF = 'DjBlog.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'blog.context_processors.seo_processor' ], }, }, ] WSGI_APPLICATION = 'DjBlog.wsgi.application' wsgi.py """ WSGI config for DjBlog project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_project.settings') application = get_wsgi_application() the eror Traceback (most recent call last): File "D:\DjangoBlog\venv\lib\site-packages\django\core\servers\basehttp.py", line 45, in get_internal_wsgi_application return import_string(app_path) File "D:\DjangoBlog\venv\lib\site-packages\django\utils\module_loading.py", line 17, in import_string module = import_module(module_path) File "C:\Users\Dell\AppData\Local\Programs\Python\Python39\lib\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 … -
Issue With Python and Django Time Zone Format
I recently added in my settings.py USE_TZ = True to get Celery working on my Django project and now in my other views that use the datetime.strptime command , it is adding the -04:00 since my time zone is America/Newyork. I don't need the time zone for this field. How do I remove the TimeZone from this ? Here is my code below. Thank you new_event.start = datetime.strptime(str(obj.start_date) ,"%Y-%m-%d %H:%M:%S") new_event.end = datetime.strptime(str(obj.end_date) ,"%Y-%m-%d %H:%M:%S") -
How to check if an admin inline form field has been changed and obtain those changed values?
I can check whether a field has changed in the save_model method by inspecting form.changed_data. With this I obtain a list of the fields names which have been changed. I need the same but with inline forms, I need to check if one inline form was changed and obtain those values. What I have Models class Case(TimeStampedModel, models.Model): pass class CaseFile(TimeStampedModel, models.Model): case = models.ForeignKey(to=Case, on_delete=models.CASCADE, verbose_name=_("Case")) Admins class CaseFileInlineAdmin(admin.TabularInline): model = CaseFile extra = 1 class CaseAdmin(admin.ModelAdmin): inlines = [CaseFileInlineAdmin] Problem I need to know when the user modified some input value from inline form CaseFileInlineAdmin inside CaseAdmin and obtain the changed values. -
ValueError at /posts/user/first-post-check/remove/ invalid literal for int() with base 10: ''
I have this function to remove photos from album, but getting this error invalid literal for int() with base 10: ''. The add to album is very much similar and it works fine, but the remove function is putting out this error. Can anyone help with this? Traceback: File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\handlers\exception.py" in inner 34. response = get_response(request) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\handlers\base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\handlers\base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\views\generic\base.py" in view 71. return self.dispatch(request, *args, **kwargs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\contrib\auth\mixins.py" in dispatch 52. return super().dispatch(request, *args, **kwargs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\views\generic\base.py" in dispatch 97. return handler(request, *args, **kwargs) File "C:\danny\Study\Test\posts\views.py" in post 611. album = PhotoAlbum.objects.get(id=album_id) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\manager.py" in manager_method 82. return getattr(self.get_queryset(), name)(*args, **kwargs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\query.py" in get 399. clone = self.filter(*args, **kwargs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\query.py" in filter 892. return self._filter_or_exclude(False, *args, **kwargs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\query.py" in _filter_or_exclude 910. clone.query.add_q(Q(*args, **kwargs)) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\sql\query.py" in add_q 1290. clause, _ = self._add_q(q_object, self.used_aliases) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\sql\query.py" in _add_q 1315. child_clause, needed_inner = self.build_filter( File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\sql\query.py" in build_filter 1251. condition = self.build_lookup(lookups, col, value) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\sql\query.py" in build_lookup 1116. lookup = lookup_class(lhs, rhs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\lookups.py" in __init__ 20. self.rhs = self.get_prep_lookup() File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup 70. return self.lhs.output_field.get_prep_value(self.rhs) File "C:\Users\danny\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\models\fields\__init__.py" in … -
How i can filter all the info open?
There are 2 models class info(models.Model): name = models.CharField() class state(models.Model): shopkeeper = models.ForeignKey(info) state = models.CharField(max_length=5,blank=False) date_register = models.DateTimeField(auto_now_add=True) There are the records on DB. How can I get all the info objects who last Status is Open. For example in image they will be only 85,84,81,82. The id 85 and 79 is not returned in the query because they have a last register on Close -
Django resync autoincrementing pk with restored database
I am working on a feature that requires me to use pg_restore to restore a database so I have enough historical data to do what I need to locally. The problem with this is when I create a new instance of any model, I end up with an IntegrityError as the pk is not unique. This has something to do with auto-incrementing behavior of pks when creating, but it doesn't seem like Django is using that last row to "resync" the next number so what I'm left with is Django trying to create a new instance with pk of 1361 despite there being 31k rows. How can I set the next value to what the next value actually should be, and is there a reliable way to do this after every restore? -
how can I use react router with 'django'
I wanna use react as frontend with django as backend I tried urlpatterns = [ path('api/',include('api.urls')), path('admin/', admin.site.urls), path('',include('frontend.urls')), ] frontend is the app contains react frontend app urls urlpatterns = [ path('/',index) ] def index(request): return render(request,'frontend/index.html') i wanna use index.html any other route -
Querying for Users with identical ManyToMany fields
This is more of a design question. My problem is that I wish to query for users that have identical selections in their manytomany fields. Is there a build-in method or combination of methods I can use to achieve this? Otherwise, I have a solution but it wouldn't be ideal. Thank you! My Solution- Upon the form submission, I was thinking on also storing a corresponding key which will be an integer created based on their selections. Then I can query to see if these keys are equal. -
how could I get the password hash in Django ORM?
I want to get the user by a password so when I type the following code User.objects.get(password='test') I get an error and I already know what is error is talking about which occurs because the password has been hashed but I want to get it, so what is the trick I need here? -
Validating a form field against another model
I'm trying to build an auctions website that allows users to bid on listings. For a user to successfully place a bid they must input an amount higher than the current highest bid and if there is no current highest bid because no user has placed a bid yet, that first bid input must be higher than the listing start price. I want to add a form validation to my BidForm to raise an error if the input doesn't fit these conditions but I have a pylint error on listing.id in def clean_bid_input and it says it is an undefined variable so I feel my form validation isn't quite right. Please could someone have a look and see if my form validation is following the logic I'm hoping it will? models.py class Listing(models.Model): class NewManager(models.Manager): def get_queryset(self): return super().get_queryset().filter(status='active') options = ( ('active', 'Active'), ('closed', 'Closed'), ) title = models.CharField(max_length=64) description = models.TextField(max_length=64) start_price = models.DecimalField(max_digits=9, decimal_places=2, validators=[MinValueValidator(0.99)]) image = models.URLField(max_length=200, blank=True) category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name="listings") lister = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, default=None, null=True, blank=True, related_name="lister_user") date_added = models.DateTimeField(default=timezone.now) status = models.CharField(max_length=10, choices=options, default="active") winner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET(get_sentinel_user), related_name="winner_user", null=True) favourites = models.ManyToManyField(User, related_name="favourite", default=None, blank=True) objects = models.Manager() listingmanager = … -
How to generate a horizontal bar with chartjs and categorical axes?
I'm trying to implement a chart bar with the following structure in chartjs: chart1 My data have the following structure: data={'hindex': 'SNI-I', 'citations': 'SNI-I', 'frh': 'SNI-II', 'products': 'SNI-III'} Is there any way to achieve that? -
How to write tests to test the create view function in django?
I am having a view function for creating a post in my small blogging project, Here's the views.py function for creating a post:- @login_required def post_create(request): form = PostForm(request.POST or None, request.FILES or None) if form.is_valid(): instance = form.save(commit=False) instance.author_id = request.user.id instance.save() form.save_m2m() messages.success(request, "Successfully Created") return redirect('blog-home') context ={ "form": form } return render(request, "blog/post_create.html", context) I am trying to write a test script using django's inbuilt TestCase library, here it is:- test.py function:- def testpostcreateview_GET(self): self.client.login(username='testuser', password='secret') response = client.Post.objects.create(title= 'this created by the client',content='this is the content of the blog-post') print(Post.objects.all().count()) # self.assertEquals() self.assertEquals(response, True) I am unable to figure out a way of achiveing it,Or am I missing something or in my above code. -
Accessing a ManyToManyField in template
I am attempting to build a portfolio website and the idea was having a 'Project' model that contains multiple instances of an image. I think I was able to achieve this by using the 'ManyToManyField' relationship. class Image(models.Model): image = models.ImageField(upload_to='media/') class Project(models.Model): title = models.CharField(max_length=32) description = models.TextField(default='', null=False) stack = models.TextField(default='', null=False) image = models.ManyToManyField(Image, related_name='images') def __str__(self): return self.title From messing around a bit with the querying API, I've been able to retrieve the querysets for the images, but I am unsure how to keep those associated with their project and feed them into the context of my view. I already pass in an all() query for my Projects model (which is great), but I want to access the images as well. Basically, I want my HTML template to end up looking like this: {% for project in projects %} <div class="card mx-auto" style="width: 50rem;"> <img class="card-img-top" src="{{ project.images }}" alt=""> // Issue here <div class="card-body"> <p>{{ project }}</p> <h5 class="card-title">{{project.title}}</h5> <p class="card-text">{{project.description}}</p> <p class="card-text">{{project.stack}}</p> </div> </div> {% endfor %} And here is the view: def portfolio_view(request, *args, **kwargs): p = Project.objects.all() for project in p: print('title: ', project.title) print('description: ', project.description) print('stack: ', project.stack) print('images: ', … -
Customizing django logger call levels using filters
I'm new to Django and I've been assign to do a task about loggers. I have in mind a simple logger where INFO messages use a simple format and WARNING messages (and above) use a more complex one. This was my attempt: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'simple': { 'format': '{levelname} {message}', 'style': '{', }, 'verbose': { 'format': '{levelname}: {message} Time: [{asctime}] Module: [{module}] Process: [{process:d}] Thread: [{thread:d}] ', 'style': '{', } }, 'handlers': { 'console_simple': { 'class': 'logging.StreamHandler', 'formatter': 'simple', 'level': 'INFO' }, 'console_verbose': { 'class': 'logging.StreamHandler', 'formatter': 'verbose', 'level': 'WARNING' } }, 'loggers':{ '': { 'handlers': ['console_simple'], 'level': 'INFO' } } } As you can problably imagine, the problem is that WARNING messages or higher will be logged twice. I've though about using filters, but I couldn't find any undestandable explanation on the documentation. How do I set up a filter for this task? I've never created filters before -
Django subscriber feature
I am creating a django site/platform where the main concept is users can create shops and other users can subscribe to those who have shops open (think Etsy). Trying to implement the subscriber feature and this is a model I have so far for it: class Subscriber(models.Model): user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) sub_shop = models.ForeignKey(Shop, on_delete=models.CASCADE) It works perfect for giving users the ability to subscribe and have the subscribtions listed in their profile and vice versa for shop owners, but for now a user can subscribe to a shop as many times as they want and I would like to prevent this. Idk if there is a constraint to allow multiple subscriber model instances by the same user but not allow for the same exact 'user' and 'sub_shop' instance OR if I am just going on about this in a very bad way! -
Changing docker image throws: psycopg2.errors.UndefinedFile: could not access file "$libdir/postgis-3" error
I am running a dockerized django application with a postgres database that has postgis installed. I am using the official image for that and I build it with docker-compose like so: postgres: container_name: postgres_postgis image: postgis/postgis volumes: - local_postgres_data:/var/lib/postgresql/data - local_postgres_data_backups:/backups env_file: - ./.envs/.local/.postgres That worked well. Now I am trying to change this image with the official timescale image that has postgis installed as well (https://hub.docker.com/r/timescale/timescaledb-postgis/). I am changing my docker-compose file like this: postgres: container_name: postgres_postgis_timescale image: timescale/timescaledb-postgis:latest-pg12 volumes: - local_postgres_data:/var/lib/postgresql/data - local_postgres_data_backups:/backups env_file: - ./.envs/.local/.postgres My app builds fine and runs fine, but when I try to access data that use postgis I get this error: django.db.utils.OperationalError: could not access file "$libdir/postgis-3": No such file or directory So I entered my database and tried to upgrade the extension with ALTER EXTENSION postgis UPDATE; but I get extension "postgis" has no update path from version "3.0.1" to version "2.5.3" , so I guess I am up to date. I am quite sure it is connected to this extension but have no idea how I could fix this... Anyone might be able to help me out? Thanks a lot in advance! -
Field 'id' expected a number but got 'User'
I am trying to get the username through POST and filter out the user and save it to the model. Whenever I am trying to migrate I am getting the error "Field 'id' expected a number but got 'User'" def newrequest(requests): if (requests.user.is_authenticated and requests.user.userrank.userstatus == 'Agent'): if requests.method == 'POST': principalamount = requests.POST['principalamount'] interest = requests.POST['interest'] emi = requests.POST['emi'] tenure = requests.POST['tenure'] applicantsalary = requests.POST['applicantsalary'] applicantname = requests.POST['applicantname'] applicantcity = requests.POST['applicantcity'] bankname = requests.POST['bankname'] accountnumber = requests.POST['accountnumber'] age = requests.POST['age'] email = requests.POST['email'] userid = User.objects.filter(email__email=email).values('id') loan = Loan( user = User.objects.get(id= userid), principalamount = principalamount, interest = interest, emi = emi, tenure = tenure, applicantsalary = applicantsalary, applicantname = applicantname, applicantcity = applicantcity, bankname = bankname, accountnumber = accountnumber, age = age, ) loan.save() return JsonResponse({"message": "Loan Requested"}) else: return HttpResponseForbidden() This is my Model: class Loan(models.Model): user = models.OnetoOneField(User, on_delete=models.CASCADE) loanid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) principalamount = models.IntegerField() interest = models.IntegerField() emi = models.IntegerField() tenure = models.IntegerField() applicantsalary = models.IntegerField() applicantname = models.CharField(max_length=300) applicantcity = models.CharField(max_length=25) bankname = models.CharField(max_length=100) accountnumber = models.CharField(max_length=25) age = models.IntegerField(null=True) -
Can't install mysqlclient on Mac OS Catalina
I am using Mac OS Catalina 10.15.7, and I want to install mysqlclient on my virtualenv-django directory but I couldn't. I've tried all possible suggestions but I am still getting the same massive error. Please help me out.. I tried >> pip install mysqlclient Collecting mysqlclient Using cached mysqlclient-2.0.1.tar.gz (87 kB) Building wheels for collected packages: mysqlclient Building wheel for mysqlclient (setup.py) ... error ERROR: Command errored out with exit status 1: command: /Users/capstone1/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jn/yn1khnks19589dh7c51p6z7r0000gn/T/pip-install-pr0_4r66/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/jn/yn1khnks19589dh7c51p6z7r0000gn/T/pip-install-pr0_4r66/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/jn/yn1khnks19589dh7c51p6z7r0000gn/T/pip-wheel-wrv_jpbq cwd: /private/var/folders/jn/yn1khnks19589dh7c51p6z7r0000gn/T/pip-install-pr0_4r66/mysqlclient/ Complete output (27 lines): running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.14-x86_64-3.8 creating build/lib.macosx-10.14-x86_64-3.8/MySQLdb copying MySQLdb/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb copying MySQLdb/_exceptions.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb copying MySQLdb/connections.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb copying MySQLdb/converters.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb copying MySQLdb/cursors.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb copying MySQLdb/release.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb copying MySQLdb/times.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb creating build/lib.macosx-10.14-x86_64-3.8/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-x86_64-3.8/MySQLdb/constants running build_ext building 'MySQLdb._mysql' extension creating build/temp.macosx-10.14-x86_64-3.8 creating build/temp.macosx-10.14-x86_64-3.8/MySQLdb clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/opt/openssl/include -Dversion_info=(2,0,1,'final',0) -D__version__=2.0.1 -I/usr/local/opt/mysql-client/include/mysql -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/capstone1/include -I/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.macosx-10.14-x86_64-3.8/MySQLdb/_mysql.o xcrun: …