Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Fatal Error Connection failed at local host
Django Fatal Error Connection failed at local host enter image description here -
Django - Many to Many Relationship with Workouts & Exercises
I'm currently stuck on how to do the following: I want to track workouts and see the progress being made with the exercises. Each workout has a name, body weight, date, and exercises. I want to select the exercises when adding the workouts(exercises are already pre-created with a name and some tags), however, each workout is different, meaning the reps, sets, and weight for the exercise is different every time. I'm not sure how to make a model for this. I've added an image of a simple design I made to show what I'm after Hope someone can help me, I'm pretty sure it's a simple solution however, my brain is stuck atm. Image Of Design -
'WSGIRequest' object has no attribute 'get' Django 3.2.9
When i click button "send email" i got this problem 'WSGIRequest' object has no attribute 'get', i have no idea what going on. When i change method to GET the problem still issuse. views.py def sender(request): sent = False if request.method == 'POST': # Formularz został wysłany. form = EmailForm(request) if form.is_valid(): # Weryfikacja pól formularza zakończyła się powodzeniem… cd = form.cleaned_data title = request.POST.get('title','') message = request.POST.get('message','') email = request.POST.get('email','') send_mail(title, message, email, 'admin@admin.pl', fail_silently=False ) sent = True else: form = EmailForm() return render(request, 'contact.html', {'form': form,'sent': sent}) ulr.py urlpatterns = [ path('kontakt', views.sender, name='kontakt'), path('oferta', views.oferta, name="oferta"), path('', views.PostListView.as_view(), name='core'), path('<slug:slug>', views.post_detail, name='post_detail'), ] contact.html {% extends "base.html" %} {% block title %}Wyślij email{% endblock %} {% block content %} {% if sent %} <h1>Wiadomość e-mail została wysłana</h1> <p> "Wysłanie emaila zakończyło się sukcesem. </p> {% else %} <h1> Wyslij wiadomośc poprzez e-mail</h1> <form action="" method="post"> {{ form.as_p }} {% csrf_token %} <input type="submit" value="Wyślij wiadomość e-mail"> </form> {% endif %} {% endblock %} Python ver 3.10.0 Django ver 3.2.9 -
Lit2.0 how to submit form data to backend
Am using Lit2.0, Material Web components, Django (backend). one reference: https://www.thinktecture.com/en/web-components/flaws/ I don't understand how to submit form data from Lit component to backend (Django) form.html contains Lit component (basic-form) <form id="id_demo" method="post" action=""> {% csrf_token %} <basic-form></basic-form> <button type="submit" class="mdc-button mdc-button--raised">Submit</button> </form> basic-form is a Lit component and it contains Material web components import {LitElement, html} from "lit"; // const template = document.createElement('template'); // template.innerHTML = ` // <slot></slot> // `; export class BasicForm extends LitElement { static properties = { form: '', }; constructor() { super(); // this.shadow = this.attachShadow({ mode: 'open' }); // this.shadow.appendChild(template.content.cloneNode(true)); } render() { return html` <mwc-textfield name="first_name"></mwc-textfield> `; } } customElements.define('basic-form', BasicForm); Could someone guide me to the right direction. -
How to pre format a string to show hyperlink in frontend using django
I have a model in which I accept string data in the char field. this is populated through Django admin field. Models.py class Test(models.Model): overview = models.CharField(max_length=10000, null=True, blank=False) views.py from .models import Test def testView(request): data = Test.objects.all() return render(request, 'abc.html', {'data': data}) my template which has html <p style="text-align: center; color: black">{{data.overview | linebreaks}}</p> this mock response of data: "with the great power comes the great responsibility. <a href="https://www.google.co.in/">connect</a>" from backend. how to show this as a link inside the paragraph in the front end. currently the whole anchor tag is displayed instead of link -
Running javascript code after Django backend Validation
this might be a stupid question but i cant seem to wrap my head around the problem here. I am trying to run a bit of code after a form has been submittet with no errors. The error handling is happening in a django backend. When the form is succesfully submittet, the user is redirected to another page. So i had an idea where i would listen to a page redirect then run the code that i want to but i am unsure if that is the best idea. There is really no code to show, does anyone have any idea. Also an idea where i would wrap my form as a promise and when the promise was fuffilled i would run the code but i am unsure of how to do that aswell. -
django: bootstrap modal not displaying
To test modal creations in python with django I created a test app named modalTestApp. Then I copied this html that I got off of the bootstrap website and pasted it into the main.html inside the app, without changing it. The webpage from the app loads fine but clicking the button to preview the modal does nothing. What am I doing wrong here? main/base.html: {% load static %} <!DOCTYPE html> <html> <head> <script src={% static "jquery/jquery-3.3.1.slim.min.js" %}></script> <script src={% static "jquery/jquery.min.js" %}></script> <script type="text/javascript" src={% static 'tablesorter-master/js/jquery.tablesorter.js' %}></script> <script src={% static "bootstrap-4.3.1-dist/js/popper.min.js" %}></script> <script src={% static "bootstrap-4.3.1-dist/js/bootstrap.min.js" %}></script> <style type="text/css"> .main { margin-top: 50px; padding: 10px 0px; } </style> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href={% static "bootstrap-4.3.1-dist/css/bootstrap.min.css" %}> <title>{% block title %} {% endblock title %}</title> </head> <body> <nav class="navbar navbar-dar bg-dark pb-0 pr-0"> <ul class="nav flex-row"> <p class="navbar-brand mb-0 pt-0" style="color: #eee">Weather Data</p> <a href="/", class="nav-link active">Home</a> {% if user.is_authenticated %} <a href="/stations", class="nav-link active">Stations</a> {% endif %} </ul> <ul class="nav justify-content-end"> {% if not user.is_authenticated %} <a href="/register", class="nav-link active">Register</a> <a href="/login", class="nav-link active">Login</a> {% else %} <a href="/logout", class="nav-link active">logout</a> <a href="/users/{{ user.username }}", class="nav-link active">Profile</a> {% endif %} </ul> </nav> {% block … -
How do you change the primary key sent to an update view in django?
I want to change the primary key being sent to the update view from the template. Let me explain. Here is my template: <a href="{% url 'new_url' model_instance.pk %}"> {{ model_instance.username }} </a> This model_instance is an instance in a for loop of the context variable model_instances in a list view. This primary key of the model_instance will then be sent to the following view: class UserUpdateView(generic.UpdateView): template_name = "leads/update.html" queryset = User.objects.all() context_object_name = "user" form_class = UserUpdateForm def get_success_url(self): return reverse("some-url") However, the problem is that the primary key I am sending to UserUpdateView is the primary key for the model_instance model, not the User model. Moreover, there is no link like one-to-one relationships between the the two models. However, there is a similarity. Both of the model_instance and user each have a username field that are the same. In other words, I need to first retrieve the model_instance.username, and then query the User model to find the user instance I want to update. At the moment, the UserUpdateView is simply receiving the primary key for a model_instance in the template, which is not what I want. I hope you guys can help me with this issue, and … -
django test framework token authentication — is there any way to log everyone out?
I understand that token authentication doesnt really have the concept of logging out— that a token merely identifies a user. Is there any way to invalidate all tokens? Maybe via the change of some variable from which all the tokens are generated— causing everyone to need to log in again? -
Query one more existing MSSQL DB from Linux
I have deployed django application running on Linux (Ubuntu) in VirtualBox. The settings file database section looks like this. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } On the local network there is an MSSQL Server with database x and a few tables. I'd like to create a view with datagrid, which is able to work with the data from database x providing the basic CRUD functionality with possibility of filters. Could you refer me to the steps with corresponding documentation I need to fulfill? You don't need to go into much detail, only to refer me to what I need to edit and what I should be aware of to achieve a desired result. -
Django rest framework how to use path parameter in serializer
I am trying to create a API endpoint that outputs calculated data from the database. In this endpoint I have a path parameter which I would like to filter the data by. However I am not sure how to do it. urls.py path('v1/sets/<str:code>/breakdown', individual_set_breakdown.as_view(), name='individual_set_breakdown'), views.py class individual_set_breakdown(ListAPIView): serializer_class = SerializerSetsIndividualBreakdown def get_queryset(self): code = self.kwargs.get('code', None) qs = magic_sets.objects.filter(code=code.upper()) return qs serializers.py class SerializerSetsIndividualBreakdown(serializers.ModelSerializer): common = serializers.SerializerMethodField() class Meta: model = magic_sets fields = ['common'] def get_common(self): def average(lst): if not len(lst): return 0 else: return sum(lst) / len(lst) common = { 'unique': magic_sets_cards.objects.exclude(side='b').filter(set_id__code='LEA').filter(rarity='common').count(), } return common As you can see I try to filter the data in the view but that does not seem to filter the data the is returned from the endpoint. I would like filter(set_id__code='LEA') to be dynamic depending on what is passed into the endpoint. If I remove this part it gets the data for all sets. -
Django Re-Run Migrations on older DB
I've made some changes to my local Django project which has altered my DB structure. I ran my migrations on my local database and everything works fine locally. However my production SQL file does not have these changes made to it. How do I bring my production SQL file up-to-date with the new migrations? -
Straight forward modelform doesn't validate on submit of form
I have a fairly simple ModelForm which doesn't validate on submit. Not sure how to debug this. I tried different print statements in my view and everything seems to be proper. This is what I have: # views.py def render_entities(request): """View to render the entities overview page""" # Get the logged in user instance user = User.objects.get(username=request.user.username) user_cashpool = Cashpool.objects.get(company__user=user) # Get the info for the site visited dashboard_site = 'entities' if request.method == 'GET': # Return the form and populate with user's company company = user.company # Query all entities associated to the cashpool companies = Company.objects.filter(cashpool=user_cashpool).order_by('name') # Pass the queryset to the Select Form CompanyForm.base_fields['company'] = forms.ModelChoiceField( queryset=companies) # Return the form form = CompanyForm() context = { 'company': company, 'companies': companies, 'dashboard_site': dashboard_site, 'form': form } return render(request, 'dashboard/dashboard_entities.html', context) else: form = CompanyForm(request.POST) if form.is_valid(): # fails # Get the cleaned inputs company = form.cleaned_data['company'] ... # forms.py class CompanyForm(forms.ModelForm): """ A form to render a select widget with companies associated to a user """ company = forms.ModelChoiceField(queryset=Company.objects.exclude(name='exclude-all'), required=True) class Meta: model = Company fields = ['name'] # template <!-- Select Company --> <form action="entities" method="post"> {% csrf_token %} <label for="company">Select a Company</label> {{ form.company }} … -
django make multiple objects for each da with a user imput: start and end date
I'd like to know how i can make multiple object for each day in a Timespan. The users input is a start and end date. My curent moddel looks like this: from datetime import datetime from django.db import models from django.contrib.auth.models import User class Booking(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) desk = models.ForeignKey(to='Desk', on_delete=models.CASCADE) startingdate = models.DateField(default=datetime.now) endingdate = models.DateField(default=datetime.now) ... I probably have to change it to this: ... class Booking(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) desk = models.ForeignKey(to='Desk', on_delete=models.CASCADE) date = models.DateField(default=datetime.now) ... The user selects a start and end date on the website: <form"> <label for="starting_date">Start Date:</label> <input type="date" id="starting_date" name="starting_date"> <label for="ending_date">End Date:</label> <input type="date" id="ending_date" name="ending_date"> <input type="submit" value="Submit"> </form> As I said a user should have the posibility to canche a Booking for a day. but the problem here is if the user e.g. created a Booking from 21-12-2021 until 25-12-2021 and just want to canche/delete the booking on 23-12-2021 it get's a bit complecated. -
What is the recommended way of naming REST API urls? [closed]
I have a Django REST API. In my app there are users and the users have plans. For plans, I have GET, POST and PUT routes. Every plan has an id and a user_id linking it to a User. Should I use url parameters in my endpoints or should I just receive the params in the request body? For example, should I do: POST api/user/<uuid:user_id>/plan or POST api/plan and take the user_id from the request body? And if the number 1 is the better way, should I still require the user_id to be passed also into the request body? And with the update request, should I do: PUT api/user/<uuid:user_id>/plan/<uuid:plan_id> or PUT api/plan/<uuid:plan_id> and take the user_id from the request body, or PUT api/plan/ and take both id's from the body? And again, if I require the id's in the url, should I do it also in the body? -
Django_filters apply all chosen filter fields
Hej! :) I want to filter my data before I do some calculations with it with an AND operator. The chosen filter fields should ALL be applied. I added some fields of the mode to the filter function and I can filter (e.g.) for the name and the year seperate. But not combined. If I try to filter for both name AND year at the same time I would just get the results from year. In my model I got an M2M to another model in which the year is set: # models.py class Plant(models.Model): name = models.CharField( max_length=200 ) used_xducts = models.ManyToManyField( Xduct, through="UsedXduct", blank=True, related_name="used_in_plant" ) class UsedXduct(models.Model): plant = models.ForeignKey( Plant, on_delete=models.PROTECT, related_name="used_in_plant" ) xduct = models.ForeignKey( Xduct, on_delete=models.PROTECT, related_name="xduct" ) year = models.SmallIntegerField( validators=[validate_year], blank=True, null=True ) class Xduct(models.Model): code = models.CharField( max_length = 20, blank = True, null = True, unique = True ) name_english = models.CharField( max_length = 200, blank = True, null = True, unique = True ) description_english = models.TextField( max_length = 500, blank = True ) explanation_english = models.TextField( max_length = 4000, blank = True ) # filters.py class PlantsNameFilter(django_filters.FilterSet): name = ModelChoiceFilter(queryset=Plant.objects.all()) year = django_filters.NumberFilter(method='year_filter', label='Year') class Meta: model = … -
How to check if some datatype is string or list in python?
I'm trying to add a check here that if the receiver is just a string. then convert that into list else just pass. if type(receiver) == str: receiver=[receiver] error: TypeError: 'str' object is not callable -
How to access websocket from another function in another file
I'm trying to make a login page, and I want to access the websocket I've opened up. I'm assuming although I could be wrong, that you only want one websocket open at a time so I'm trying to use the one from earlier. But I'm having trouble accessing it. This is my main file that hosts what I have so far import React, { Component, useState, useEffect } from 'react'; import { render } from 'react-dom' import WebSocketStuff from './websocket'; import Navbar from './navbar'; import Login from './login'; import { BrowserRouter as Router, Switch, Route, Link, Redirect } from "react-router-dom"; function App() { return ( <div> <Navbar /> <WebSocketStuff /> <Router> <Switch> <Route path="/account/login" component={Login}></Route> </Switch> </Router> </div> ); } const appDiv = document.getElementById("app"); render(<App />, appDiv); This is the javascript file that has the websocket code. import React, { Component, useState, useEffect } from 'react'; export default function WebSocketStuff(props) { const [name, setName] = useState(''); console.log(window.location) var loc = window.location var socket; useEffect(() => { var wsStart = 'ws://' if (loc.protocol == 'https:') { wsStart = 'wss://' } var endpoint = wsStart + loc.host + loc.pathname; socket = new WebSocket(endpoint); console.log(socket); socket.onmessage = function (e) { console.log("message", e) setName(e.data); … -
when I try to use SyncToAsync() using django and hit 3rd party API endpoint. I get 'SyncToAsync' object has no attribute 'get' error
Iam trying to use async functionality to django views with SyncToAsync(https://docs.djangoproject.com/en/3.2/topics/async/#sync-to-async). I have to hit a 3rd party API using request.get method. But when I hit my endpoint.I get the above error. Any idea how to resolve it... -
How to create models for friend system in django?
I haven't seen much talks about in the internet . I want to create a friend system for my personal project . I think if i can create it I will have better understanding of ORM which I don't I think . Please help me out guys :'( . And possibly explain in a nutshell of what you did . -
How do I make changes to my Django HTML view file that extends a base template?
I have a Django test project that I am working on, and have been working on it for hours now, and I am stuck. I can't add other html syntax into my html file that extends a base template into it. I have a base template that works on my html view, however, when I make changes inside the html view, it doesn't reflect. Looks like I am missing something between the HTML view, and the base template. Below is the HTML view <!DOCTYPE html> {% extends "base.html" %} <!--https://www.anwita-arun.in/ --> {% block head %} <html lang="en"> <head> <title>Test Project</title> </head> {% endblock %} {% block body %} <body> <h1 style="font-size: 250px"> Testing </h1> <p> aloha </p> <form method="POST"> <!-- Form creation with post. No method "post" needed --> {% csrf_token %} <!-- Insert token --> {{ form.as_p }} <!-- form variable --> <input type="submit"> <!-- Form input submission --> </form> </body> {% endblock %} Below is the base template <!DOCTYPE html> <!--https://www.anwita-arun.in/ --> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Sofia"> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.10.1/bootstrap-social.css" rel="stylesheet"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"> <link href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <link href="https://fonts.googleapis.com/css?family=Rajdhani&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Lobster&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/coliff/bootstrap-rfs/bootstrap-rfs.css"> … -
I'm unable to accept friend request from other users in my Django social site
unable to accept friend requests in my web app below are the errors that I'm getting when I'm trying to accept the friend request. Environment: Request Method: GET Request URL: http://127.0.0.1:8000/users/friend-request/accept/5/ Django Version: 2.1 Python Version: 3.8.10 Installed Applications: ['users.apps.UsersConfig', 'feed.apps.FeedConfig', 'crispy_forms', 'stdimage', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback: File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/backends/utils.py" in _execute 85. return self.cursor.execute(sql, params) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py" in execute 296. return Database.Cursor.execute(self, query, params) The above exception (no such table: main.users_profile__old) was the direct cause of the following exception: File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response 126. response = self.process_exception_by_middleware(e, request) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response 124. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 21. return view_func(request, *args, **kwargs) File "/home/rohan/ByteWalk-master/users/views.py" in accept_friend_request 88. user1.profile.friends.add(user2.profile) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py" in add 926. self._add_items(self.source_field_name, self.target_field_name, *objs) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/models/fields/related_descriptors.py" in _add_items 1088. self.through._default_manager.using(db).bulk_create([ File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/models/query.py" in bulk_create 465. ids = self._batched_insert(objs_without_pk, fields, batch_size) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/models/query.py" in _batched_insert 1152. self._insert(item, fields=fields, using=self.db) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/models/query.py" in _insert 1133. return query.get_compiler(using=using).execute_sql(return_id) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/models/sql/compiler.py" in execute_sql 1285. cursor.execute(sql, params) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/backends/utils.py" in execute 100. return super().execute(sql, params) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/backends/utils.py" in execute 68. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/home/rohan/.local/share/virtualenvs/ByteWalk-master/lib/python3.8/site-packages/django/db/backends/utils.py" in … -
How to link my Django form selection to filtered database values
I am configuring a web page using Django in which I would like my form's dropdown options to filter the database options based on master ID. There are four options: allElements, oldElements, newElements, and testElements. My problem is that while I can create a for loop to iterate through the database based on any of the four variables I've defined, my form selection is not linked to the choices like I thought it would be. Can anyone help? My form: account_choices=[('allElements','All Elements'), ('oldElements','Old Elements'), ('newElements','New Elements'), ('testElements','Test Elements')] class SelectIdForm(forms.Form): Filter = forms.ChoiceField(choices = account_choices, error_messages={'required': ''}) My view: def metalist(request): form=SelectIdForm(request.POST) if account_choices == 'allElements': data = Metadata.objects.all().order_by('title') elif account_choices == 'oldElements': data = Metadata.objects.all().filter(metaMain = 1).order_by('title') elif account_choices == 'newElements': data = Metadata.objects.all().filter(metaMain = 2).order_by('title') elif account_choices == 'testElements': data = Metadata.objects.all().filter(metaMain = 3).order_by('title') else: data = Metadata.objects.all().order_by('title') return render(request, "Site/insights/metalist.html", {"allElements": Metadata.objects.all().order_by('title'), "oldElements": Metadata.objects.all().filter(metaMain = '423844416462').order_by('title'), "newElements": Metadata.objects.all().filter(metaMain = '689665504419').order_by('title'), "testElements": Metadata.objects.all().filter(metaMain = '542384344085').order_by('title'), "form": form, 'data': data }) My HTML page: <form method="POST"> {% csrf_token %} {{form}} <input type="submit" value="Click to Filter"> </form> {% for list in data %} <li> Metadata List: <a href="{% url 'Site:insights/metalist' account.title %}"> {{ metadata.title }}</a> </li> {% endfor %} I've … -
Django - Run all tests inside of "test" sub-folder
So I've been running tests using the command python manage.py test to run every test inside the test folder and I'd like to run all test in a subfolder of the test folder. So I tried python manage.py test <app name>.test.<sub-folder>(path to the test sub-folder), but it doesn't work. I created an __init__.py file inside <sub-folder> that imports all the test files in <sub-folder>, but that didn't work. Every time I run python manage.py test <app name>.test.<sub-folder> the terminal outputs Run 0 tests in Xs. How do you run all tests inside of a sub-folder of the test folder in Django? -
Django virtual environment successfully installed. But when I run 'pip freeze' in command prompt it says 'No python at C drive'
Python is already installed and the version is 3.8. Could anyone help me? [1]: https://i.stack.imgur.com/44FSS.jpg