Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Chat server: Websocket Server vs Django Channels vs SignalR
I'm looking to utilize a chat service for my app. Does anyone know which chat service can host the most amount of users with the current technology? -
python manage.py runserver No module named projectname.settings error message
I have a problem that occurred once I moved my Django project to a new Mac. Once I fired up the virtual environment, I have a problem with running my server. Stacktrace, code, and images attached. Any help is appreciated. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'fiveminread', ] settings.py manage.py -
Deploying Django on VPS using Apache2 on ubuntu 20.04
I had tried to set up the Django application on VPS. At first, I have installed all dependencies on Linux, then copied the Django project via ssh. I created virtualenv inside Django project. At first, I decided to review the project by running ./manage.py runserver 0.0.0.0:8000 . Everything works fine. I have configured the firewall settings: To Action From -- ------ ---- 22/tcp ALLOW Anywhere 80/tcp ALLOW Anywhere Apache ALLOW Anywhere 22/tcp (v6) ALLOW Anywhere (v6) 80/tcp (v6) ALLOW Anywhere (v6) Apache (v6) ALLOW Anywhere (v6) So I move to the next step – Apache2. I run apache2 with 000-default.conf to check that Apache is working properly and is listening to the IP address. To check my server IP I hit: hostname -I Let’s say my Server address is Ex. 77.55.111.246 and servername.domain.com By hitting IP address my browser return: Apache2 Ubuntu Default Page. All’s well that is end well… I made a copy 000-default.conf with the name django_project.conf Enable the domain configuration file sudo a2ensite django_project.conf I also diabled old configuration sudo a2dissite 000-default.conf django_project.conf <VirtualHost *:80> ServerAdmin jacobitedge@77.55.111.246 ServerName 77.55.111.246 DocumentRoot /home/jacobitedge/bike/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /static /home/jacobitedge/bike/static <Directory /home/jacobitedge/bike/static> Require all granted </Directory> <Directory /home/jacobitedge/bike/bike> … -
Social Network Login Failure on Django, Callback url mismatched
I have problem for attaching social login. I have tried google login on local, it was fine. But when I try for deploy, Non-public domain is not supported. I`m not sure *.link is non-public domain, but it did not work for some reason. So I am trying to do github login, but I have following errors.. There is callback URL mismatch, but I don't know which URL should I use. Im using on Github this URL : https://taeheejo.link/user/githubin/github/login/callback/ urls.py ... path('admin/', admin.site.urls), path('user/', include('authy.urls')), path('sub/', include('tier.urls')), ... authy/urls.py ... path('login/', authViews.LoginView.as_view(template_name='registration/login.html'), name='login'), path('githubin/', include('allauth.urls')), ... And Here is an Error.. I have added on admin pannel sitename and application too.. Can someone please tell me which part am I missing? -
AttributeError: 'QuerySet' object has no attribute 'category'
I am using DRF to get and create data from and to the API. I was struggling with a model Question and a attribute category which is a model too. So in order to create and read data I had to implement this question's answer method. Whenever I use the default API route I can create and read the data, but I am getting the following error whenever I write a different scenario: AttributeError: Got AttributeError when attempting to get a value for field category on serializer QuestionSerializer. The serializer field might be named incorrectly and not match any attribute or key on the QuerySet instance. Original exception text was: 'QuerySet' object has no attribute 'category'. This is my custom code, where something is wrong...: class UserQuestions(APIView): permission_classes = [permissions.IsAuthenticated] def get(self, request, *args, **kwargs): questions = Question.objects.filter(created_by=request.user.id).all() data = QuestionSerializer(questions).data return Response({ 'questions': data }) Just in case, this is my answer's implementation: class RelatedFieldAlternative(serializers.PrimaryKeyRelatedField): def __init__(self, **kwargs): self.serializer = kwargs.pop('serializer', None) if self.serializer is not None and not issubclass(self.serializer, serializers.Serializer): raise TypeError('"serializer" no es una clase serializer válida') super().__init__(**kwargs) def use_pk_only_optimization(self): return False if self.serializer else True def to_representation(self, instance): if self.serializer: return self.serializer(instance, context=self.context).data return super().to_representation(instance) class … -
Django multiple user acess specific content
I'm trying to make a page has diffrent content what I'm trying to do is to make specific users to acess specific objects in this page when I do for example: Something.objects.filter(user=request.user) only one user is have acess to this content can't add another user from django admin Any advice Thanks -
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 107654: invalid start byte Django database change to MySQL
I recently attempted to switch databases on my Django project from the default SQLite to MySQL. After setting up MySQL accordingly, I used the following command: python manage.py dumpdata > datadump.json # to export existing data into a json file After I set up the MySQL db in settings.py and doing all the migrations, trying to load the json file to the db with the command: python manage.py loaddata datadump.json # should return sth like "Installed 59 object(s) from 1 fixture(s)" I get the following error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 107654: invalid start byte Now I tried setting the default charset of the mysql DB to utf8 but nothing happened. When I click on the datadump.json file in Pycharm, I also get the following warning, I do not know whether it is relevant or not: File was loaded with the wrong encoding: UTF-8 Any help would be appreciated -
Getting a phone number by logging in via telegram
I use the django-telegram-login library to log in to the site via telegram. How can I get a phone number after logging in? In the GET parameters, there is a user id. Maybe you can somehow find out the number through the id -
Adding placeholder to ChoiceField in Django?
In my forms.py I have a simple form class defined as: SAMPLE_STRINGS = ['aa','ab','bb','c0'] class IndicatorForm(forms.Form): chosen_number = forms.IntegerField(label='Please select a value') chosen_string = forms.ChoiceField(choices=SAMPLE_STRINGS, label='Please select a string', required=True) I want to add a placeholder for both fields. For the first one, it was easy: chosen_number = forms.IntegerField(label='Please select a value', widget=forms.NumberInput(attrs={'placeholder': 0})) But for the ChoiceField, I didn't have any luck. I tried using widget=forms.TextInput(attrs=...) but that removes the choices and transforms the field into a simple text field. widget=forms.ChoiceInput and widget=forms.ChoiceField do not work either. How can I add a placeholder saying "Select..." to my ChoiceField? -
How to separate a category in a django template
I get this error: ValueError at /product/ The QuerySet value for an exact lookup must be limited to one result using slicing. this is my models : class Categorie (models.Model): title = models.CharField(max_length=50) category_slug = models.SlugField(blank=True) def __str__(self): return self.category_slug class Products(models.Model): category = models.ForeignKey(Categorie,on_delete=models.CASCADE,null=True, related_name="product") product_slug = models.SlugField(blank=True) product_title = models.CharField(max_length=50 , null=True) product_name = models.CharField(max_length=100 , null=True ) product_describe = models.CharField(max_length=200 , null=True) product_picture = models.ImageField(upload_to='img_pro' , null=True) product_created_at = models.DateField(auto_now_add=True) product_updated_at = models.DateField(auto_now=True) def __str__(self): return self.product_slug this is my view: def index(requset): category = Categorie.objects.all() product = Products.objects.filter(category_slug=category) context = { 'category':category, 'product ':product , } return render( requset , 'product/index.html' , context) this is my template: {% for cat in category %} <div class="fix single_content"> <h2>{{cat.title}}</h2> <div class="fix"> {% for pro in product %} <ul> <li> <div class="entry_name"><a href=""><img src="{{pro.product_picture.url}}" alt=""><span> {{pro.product_title}}</span></a><h6>{{pro.product_name}}</h6></div> </li> </ul> {% endfor %} </div> {% endfor %} Can anyone help me with that please? -
Django post not working (Your file couldn’t be accessed) ERROR
I did not change anything in my form where I was able to upload files normally, before I got this error just today : (just in POST not GET method) Your file couldn’t be accessed It may have been moved, edited, or deleted. ERR_FILE_NOT_FOUND in the browser but nothing in the console (even the request is not captured !!!). I used nginx as web server. Any explanation and/or solution please ? -
Website visitor/ view counter app in django
I have created website with Django consisting 3+ app. Now I wanted add hit counter/ visitor counter to complete website (all apps) not individual to any app. I have tried some of app: django-hitcount, django-pageviews & django-visits but they not fulfilling my requirement. They are using IP address so it will not count multiple visits from same machine. Most of the counter are for Post in blogs. I wanted a counter for whole website. not bound to IP address or any post/app. Any solution is welcomed. Thank you in advance. -
AttributeError: 'FloatField' object has no attribute 'model' error when using F function on a OneToOneField model field
My model definitions looks like this and there is a OneToOne relationship class Rocket(BaristaBase): name = models.CharField( max_length=256, blank=True, null=False, unique=True, ) my_volume = models.IntegerField( default=0, null=False, blank=True, ) class RocketMetrics(EspBase): rocket = models.OneToOneField( "Rocket", on_delete=models.CASCADE, blank=True, null=True, related_name="metrics" ) helpful_count = models.IntegerField( default=0, null=False, blank=True, ) The following is from the view_api.py and self.queryset is based of Rocket.objects.all() self.queryset = self.queryset.annotate(percent_unhelpful=Case( When(total_actions=0, then=0.0), default=F('metrics__helpful_count') * 100.0 / F('total_actions'), output_field=FloatField())) The above usage of the FloatField() to transform the output throws the following error. 2021-04-27T01:20:14 tenant1 ERROR [6b30d5178f0a4f718d34c16553575ad1] common logging_util.py:116 - 'FloatField' object has no attribute 'model' Traceback (most recent call last): File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/rest_framework/viewsets.py", line 95, in view return self.dispatch(request, *args, **kwargs) File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/rest_framework/views.py", line 494, in dispatch response = self.handle_exception(exc) File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/rest_framework/views.py", line 454, in handle_exception self.raise_uncaught_exception(exc) File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/rest_framework/views.py", line 491, in dispatch response = handler(request, *args, **kwargs) File "/Users/myuser1/projects/tahoe/django/deltaco/barcharter/faqs/views_api.py", line 1604, in rocket_lookup return rocket_lookup(self, request, filtered_queryset) File "/Users/myuser1/projects/tahoe/django/deltaco/barcharter/rocket_lookup/functions.py", line 90, in rocket_lookup return obj.get_paginated_response(get_serialized_rockets(obj, request=request)) File "/Users/myuser1/projects/tahoe/django/deltaco/barcharter/rocket_lookup/functions.py", line 501, in get_serialized_rockets page = obj.paginate_queryset(obj.queryset) File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/rest_framework/generics.py", line 173, in paginate_queryset return self.paginator.paginate_queryset(queryset, self.request, view=self) File "/Users/myuser1/projects/tahoe/lib/python3.6/site-packages/rest_framework/pagination.py", line … -
Django session cookie forgotten on every browser reopen - mobile Safari (iphone,ipad)
I wonder if anybody encountered with this problem. I am storing some data about visitor in django session. It works as expected but only mobile safari (iphone and ipad) have strange behaviour. When I visit my site from iphone or ipad(Safari ver. 14.3) session cookie is normally set. But when I close the browser then reopen, new session cookie is generated. This behaviour can be seen only on mobile safari version. I was not able to reproduce it on macOS desktop safari. To solve this problem I had to change setup for session cookie in django settings.py: SESSION_COOKIE_SAMESITE = ‘None’ According to django doc. cookie is normally set as ‘lax’ and this introduce security risk in my app. SESSION_COOKIE_SAMESITE Default: 'Lax' The value of the SameSite flag on the session cookie. This flag prevents the cookie from being sent in cross-site requests thus preventing CSRF attacks and making some methods of stealing session cookie impossible. Possible values for the setting are: 'Strict': prevents the cookie from being sent by the browser to the target site in all cross-site browsing context, even when following a regular link. For example, for a GitHub-like website this would mean that if a logged-in user … -
Filter Data of foreign key
👋. I want to make a button that filter product on category I Added productatrubuut cause I need colours, size, ect. How do I get the data of category from a Foreign in foreign key? in views.py Models.py class Categorie(models.Model): naam = models.CharField(max_length=150,db_index=True) # # class Product(models.Model): slug = models.SlugField(unique=True, primary_key=True) titel = models.CharField(max_length=200) categorie = models.ForeignKey(Categorie, on_delete=models.CASCADE) # # class ProductAtribuut(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE, blank=False) price = models.FloatField(default=0) image = models.ImageField(blank=True, upload_to='gerechten/') visible = models.BooleanField(default=True) # # I can't get category by using this. Views.py product = productatribuut.filter(categorie=categorie)) return render(request, 'pages/index.html', {product}) If someone know please give me an example how I can do it. Thanks in advance. Really appreciate it. <3 -
Django - CheckBoxSelectMultiple renders a list without checkboxes
I'm having an issue rendering a form with the Checkbox widget. The category field appears a unordered list (It takes all the objects) but without the checkboxes. The weird part is that when inspectting with the dev tool it shows the checkboxes as html code. MODELS: class Categories(models.Model): category = models.CharField(verbose_name="Categoria", max_length=20) class Meta: verbose_name = 'Categoria' verbose_name_plural = 'Categorias' ordering = ['category'] def __str__(self): return self.category def __unicode__(self): return self.category class CreatePost(models.Model): #user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="Usuario") title = models.CharField(verbose_name="Titulo", max_length=100) slug = models.CharField(max_length=200, blank=True) content = models.TextField(verbose_name="Contenido", null=True, blank=True) img = models.ImageField(upload_to=custom_upload_to, null=True, blank=False) category = models.ManyToManyField(Categories) created = models.DateTimeField(auto_now_add=True) def save(self, *args, **kwargs): self.slug = slugify(self.title) super(CreatePost, self).save(*args, **kwargs) class Meta: verbose_name = 'Anime' verbose_name_plural = 'Animes' ordering = ['-created'] FORM class PostUpdateForms(forms.ModelForm): categorias = Categories.objects.all() class Meta: model = CreatePost fields = ['title', 'img', 'category', 'content' ] widgets = { 'title':forms.TextInput(attrs={'class':'form-control'}), 'content':forms.Textarea(attrs={'class': 'form-control'}), 'category': forms.CheckboxSelectMultiple() } Images Rendered Form HTML code -
__str__ returned non-string (type NoneType)...im receiving this error may be due to a NoneType user model
I'm getting this error, in admin panel other than this the website is working fine. Here is my forms.py Here is models.py These are in views.py And this is for new user registration I think the error is happening because the order model is receiving a NoneType customer as a foreign key. But I don't know how to solve this problem. I'm new to django please help me out. -
mozilla-django-oidc with keycloak on django 3
I'm trying to connect Django (3.2) with Keycloak (12.0.2) using mozilla-django-oidc (1.2.4). I'm getting the redirection to keycloak when clicking on the Login button (which is using oidc_authentication_init view as per documentation), but after successful login I'm getting this error: Exception Type: HTTPError at /oidc/callback/ Exception Value: 404 Client Error: Not Found for url: http://localhost:8080/auth/realms/mycorp/protocol/openid-connect/token Relevant settings for django settings are: settings.py INSTALLED_APPS = [ ..., 'mozilla_django_oidc', ] AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'mozilla_django_oidc.auth.OIDCAuthenticationBackend', ), OIDC_AUTH_URI = 'http://localhost:8080/auth/realms/mycorp' OIDC_CALLBACK_PUBLIC_URI = 'http://localhost' LOGIN_REDIRECT_URL = OIDC_CALLBACK_PUBLIC_URI LOGOUT_REDIRECT_URL = OIDC_AUTH_URI + '/protocol/openid-connect/logout?redirect_uri=' + OIDC_CALLBACK_PUBLIC_URI OIDC_RP_CLIENT_ID = 'django' OIDC_RP_CLIENT_SECRET = os.environ.get("OIDC_CLIENT_SECRET") OIDC_RP_SCOPES = 'openid email profile' # Keycloak-specific (as per http://KEYCLOAK_SERVER/auth/realms/REALM/.well-known/openid-configuration) OIDC_OP_AUTHORIZATION_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/auth' OIDC_OP_TOKEN_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/token' OIDC_OP_USER_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/userinfo' OIDC_OP_JWKS_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/certs' urls.py urlpatterns = [ ..., path('oidc/', include('mozilla_django_oidc.urls')), ] And detailed error: HTTPError at /oidc/callback/ 404 Client Error: Not Found for url: http://localhost:8080/auth/realms/mycorp/protocol/openid-connect/token Request Method: GET Request URL: http://localhost/oidc/callback/?state=cBtEeSIHNNdsgMBUjPXkq2RwVSSpKsZF&session_state=a5b50fc0-0ec2-4def-8ec8-db1e4a95450f&code=864a2e21-75a7-42d8-8249-e9397be9b64b.a5b50fc0-0ec2-4def-8ec8-db1e4a95450f.2ec7cfbf-b5ee-4f9a-9d4b-012fdc0f9630 Django Version: 3.2 Exception Type: HTTPError Exception Value: 404 Client Error: Not Found for url: http://localhost:8080/auth/realms/mycorp/protocol/openid-connect/token Exception Location: /usr/local/lib/python3.8/site-packages/requests/models.py, line 943, in raise_for_status Python Executable: /usr/local/bin/python Python Version: 3.8.9 Python Path: ['/home/maat/src', '/usr/local/bin', '/usr/local/lib/python38.zip', '/usr/local/lib/python3.8', '/usr/local/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/site-packages'] Server time: Tue, 27 Apr 2021 19:08:01 +0200 Apparently … -
Is it possible to assign a OneToOneField through the reverse model in Django?
class Husband(models.Model): wife = models.OneToOneField(Wife, related_name='husband',blank=True, null=True,on_delete=models.CASCADE) name = models.CharField(max_length=200, blank=True) Model Wife(models.Model): name = models.CharField(max_length=200, blank=True) I have a post_save signal on Wife that requires the accessing of the corresponding Husband. This is triggered when I use the .create() method. However, I'm running into some issues assigning the Husband directly in the .create(). I tried the following: Wife.objects.create(name='bla', husband = (some Husband instance)) w = Wife(name = 'bla') w.husband = (some Husband instance) w.save() w = Wife(name = 'bla') (some Husband instance).wife = w w.save() None of these end up storing the relationship into the database. Ultimately I want to have Wife model created with the relationship already set so the signal can draw the husband model object from it. I'm aware that one possible solution is to move the field to the Wife Model Class, but I was hoping there could be cleaner solution than that. any suggestions? -
Creating Django Project
So I'm trying to create a django project with this "django-admin startproject mysite ." but i keep getting this error; Fatal error in launcher: unable to create process using /path/. The system cannot find the file specified. Does anyone know whats going on? I'm using Windows. -
Inserting many foreign keys pertaining to the same model in Django
I am a newbie in Django and building a job portal. When a recruiter posts an internship, it can have many skills. These skills I store them in a different table with a foreign key to Internship. However, I am not sure on how to properly insert that. Getting errors please help this is my code models.py class Internship(models.Model): MODE_CHOICES = ( ('Office', 'Office'), ('Work From Home', 'Work From Home'), ('Blended', 'Blended'), ) recruiter = models.ForeignKey(Recruiter, on_delete=models.SET_NULL, null=True) internship_title = models.CharField(max_length=100) internship_mode = models.CharField(max_length=20, choices=MODE_CHOICES) industry_type = models.CharField(max_length=200) internship_desc = RichTextField() start_date = models.DateField() end_date = models.DateField() internship_deadline = models.DateField() posted_date = models.DateField() def __str__(self): return self.internship_title class InternshipSkill(models.Model): internship = models.ForeignKey(Internship, on_delete=models.CASCADE) skill = models.CharField(max_length=50) def __str__(self): return self.internship+" "+self.skill views.py def post_internship(request): if request.method == 'POST': start_date = request.POST['start_date'] end_date = request.POST['end_date'] internship_title = request.POST['internship_title'] internship_mode = request.POST['internship_mode'] industry_type = request.POST['industry_type'] internship_deadline = request.POST['app_deadline_date'] skills = request.POST.getlist('internship_skills[]') #gets a list emp_steps = request.POST.getlist('employement_steps[]') internship_desc = request.POST['internship_desc'] user = request.user recruiter = Recruiter.objects.get(user=user) try: with transaction.atomic(): internship = Internship.objects.create(recruiter=recruiter, internship_title=internship_title, internship_mode=internship_mode, industry_type=industry_type, internship_desc=internship_desc, start_date=start_date, end_date=end_date, internship_deadline=internship_deadline, posted_date=date.today()) for skill in skills: InternshipSkill.objects.create(internship=internship, skill=skill) except Exception as e: print(e) return render(request, 'post_internship.html', context) -
Django :NoReverseMatch at /spacemissions/organisation/2/
I am getting the following error when, from the list view, I try to access the detail view. Error screenshot The odd thing is that some of the detail views work, some not, and I do not understand where is the problem. For example, here's the detail view of the organisation with pk=1 organisation detail view Organisation model class Organisation(models.Model): code = models.CharField(max_length=256, unique=True) name = models.CharField(max_length=256, null=True) english_name = models.CharField(max_length=256, null=True) location = models.CharField(max_length=256, null=True) country = models.ForeignKey('space_missions.Country', on_delete=models.SET_NULL, null=True, blank=True) longitude = models.FloatField(null=True) latitude = models.FloatField(null=True) parent_organisation = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True) Views class OrganisationDetail(generic.DetailView): model = models.Organisation class OrganisationList(generic.ListView): model = models.Organisation organisation_list.html {% extends 'base.html' %} {% block content %} <h1>Organisation List</h1> {% if organisation_list %} <ul> {% for organisation in organisation_list %} <li> <a href="{% url 'space_missions:organisation-detail' pk=organisation.pk %}"> {{ organisation.name }} </a> </li> {% endfor %} </ul> {% else %} <p>No organisation is stored in the database!</p> {% endif %} {% endblock %} organisation_detail.html {% extends 'base.html' %} {% block content %} <div class="container"> <h1>{{ organisation.name }}'s details:</h1> <ul> <li><strong>Code: </strong> {{ organisation.code }}</li> <li><strong>English Name: </strong> {{ organisation.english_name }}</li> <li><strong>Location: </strong> {{ organisation.location }}</li> <li><strong>Country: </strong> <a href="{% url 'space_missions:country-detail' pk=organisation.country_id %}"> {{ … -
ImportError: cannot import name 'upath' django 3
How should I resolve the import error? The example code: from django.utils._os import upath dirs = [upath(os.path.abspath(os.path.realpath(d))) for d in dirs] Django 3.2 -
django cbv not sending mails
i am trying to send mail entered in a form which i have in bottom of my html but it does not send mail and does not give errors also my view: from django.conf import settings from django.shortcuts import render from django.views.generic import TemplateView from django.core.mail import send_mail class Homepage(TemplateView): template_name = 'homepage.html' def post(self, request, *args, **kwargs): if request.method == 'post': message = request.POST['message'] name = request.POST['name'] email = request.POST['email'] send_mail('contact form', message, settings.EMAIL_HOST_USER, ['******@gmail.com'], fail_silently=False) return render(request, 'homepage.html') my html form: <form method="post" action={% url 'homepage' %}> {% csrf_token %} <input type="text" name="name" placeholder="Enter First Name"/><br> <input type="email" name="email" placeholder="Enter Your Email"/><br> <input type="textarea" name="message" placeholder="How can we help you?"/><br> <button>Submit</button> </form> -
Vscode black formatter is not working in poetry project
I have these settings in vscode for the black extension in a poetry project, which uses system cache and venv. "editor.formatOnSave": true, "python.formatting.provider": "black", "python.formatting.blackPath": "/Usr/bin/black", "python.pythonPath": "/Usr/bin/python", "python.linting.mypyEnabled": true, "python.linting.mypyPath": "/Usr/bin/mypy" I cannot understand why the formatter formats nothing. I am using local workspace settings ( above ).