Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
django: how to assign a logged in user to a post author
I've set the default post author to be null, and used the form_valid function to override the post author and assign to it the current logged in user. the form_valid() function is taken from the official django docs but for some reason its doesnt do anything. my django versions are: django-rest-framework = 3.12.2. django = 3.1.4 models.py class Recipe(models.Model): id = models.UUIDField( primary_key=True, default=uuid.uuid4, editable=False ) author = models.ForeignKey(get_user_model() , on_delete=models.CASCADE, null=True) # title = models.CharField(max_length=150) description = models.TextField(blank=True) serializers.py class RecipeCreateSerializer(serializers.ModelSerializer): class Meta: model = Recipe fields = ('title', 'description') views.py class RecipeCreate(CreateAPIView): permission_classes = (permissions.IsAuthenticated, ) queryset = Recipe.objects.all() serializer_class = RecipeCreateSerializer def form_valid(self, form): form.instance.author = self.request.user return super(RecipeCreate, self).form_valid(form) hopefully someone out here will know how to fix this. thanks in advance -
How do I change relay connection limit in graphene django
In graphene-django I have a pagination limit set in my settings.py file like below. GRAPHENE = { 'RELAY_CONNECTION_MAX_LIMIT': 150, } Let's say a particular query returns 200 items (I don't know beforehand) and I want to display all of this data on a graph. How do I stop graphene from paginating it when returning the results? -
Run part of the View only once in Django
I am fairly new to Django and looking for best practice to run part of my view only once and never again during a session. Especially when page is reloaded or some other page was redirected to this page. My View looks something like this: def home_page(request): # This is the part I want to be executed once data = loadDataFucntion(some_cisco_device) # End of part . . # more code context = {'data': data} return render(request, 'home_template', context) What I am trying to accomplish is when home_template is reloaded or some other page in the app was redirected to home_page view, I don't want the LoadDataFunction to be executed and simply use the previously fetched data. -
Can someone help me understand what am I doing wrong ? My server will not run and gives this message
This is the terminal error message I keep getting. Can someone help me understand what am I doing wrong ? My server will not run and gives this message. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/django/urls/resolvers.py", line 582, in urlconf_module return import_module(self.urlconf_name) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 790, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/Users/patrickjobe/Desktop/personal_portfolio-project/personal_portfolio/urls.py", line 24, in <module> urlpatterns += static(settings.Media_URL, document_root=settings.MEDIA_ROOT) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/django/conf/__init__.py", line 83, in __getattr__ val = getattr(self._wrapped, name) AttributeError: 'Settings' object has no attribute 'Media_URL' this is how my URL.py file is set. from django.contrib import admin from django.urls import path from django.conf.urls.static import static from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), ] urlpatterns += static(settings.Media_URL, document_root=settings.MEDIA_ROOT) this is my settings on my settings.py file. STATIC_URL = '/static/' Media_URL = '/media/' #set name to whatever you like. Media_Root = (BASE_DIR / 'db.sqlite3', 'media') -
How can I add a new database entry upon user registration with Django?
I'm starting to learn Django and have a class called Customer in my models. I'm importing django.contrib.auth to register users to the database, but I would like to also initialize a Customer object upon registration. I first attempted to override the save() method from the UserCreationForm and initialize a Customer object there: class UserCreationForm(forms.ModelForm): def save(self, commit=True): user = super(UserCreationForm, self).save(commit=False) user.set_password(self.cleaned_data["password1"]) customer = Customer(self) customer.save() if commit: user.save() return user But it did not seem to create a Customer object. Alternatively, is it better to extend the User class to have the Customer class fields? I initially thought I should keep authentication separate, which is why I created the Customer class. Thanks in advance! -
How do I add a foreign key field in a post method for Django Rest Framework
I am really sorry if I am being a noob, but how do I add a foreign key field with my post method. I need to mention the blog post, the user who made the comment with the post. But, the post and the user/owner are both foreign key fields in my models. With Postman it gives a Django Integrity error. models.py class Comment(models.Model) : text = models.TextField( validators=[MinLengthValidator(3, "Comment must be greater than 3 characters")] ) post = models.ForeignKey(Post, on_delete=models.CASCADE) owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) # Shows up in the admin list def __str__(self): return (self.post.title) serializers.py class CommentSerializer(serializers.ModelSerializer): owner = serializers.StringRelatedField() post = serializers.StringRelatedField() class Meta: model = Comment fields = ['id', 'text', 'created_at', 'post', 'owner'] views.py class CommentViewSet(viewsets.ModelViewSet): serializer_class = CommentSerializer permission_classes = [permissions.IsAuthenticatedOrReadOnly] queryset = Comment.objects.all() filter_backends = [DjangoFilterBackend] filter_fields = ['post'] -
Django - view another user's profile - QuerySet Error 'matching query does not exist'
I'm trying to set up a basic blog on django where one may view the profile of any other user (simple for the time-being, I will update perms in due course). I've attempted to set it up so that url /testuser/ would take you to the profile of user with username = 'testuser'. The url seems to direct ok, however, I'm getting a QuerySet error 'matching query does not exist'. I know that testuser exists because I can access it in terminal using the same code as used in get_queryset below. Hence, I think there must be something wrong with my use of get_queryset in views.py, or similar. Code as follows. Thanks in advance for any help. views.py from django.views.generic.detail import DetailView from users.models import CustomUser class ProfileView(DetailView): template_name = 'profiles/self_profile.html' def get_queryset(username): return CustomUser.objects.get(username=username) def get_slug_field(self): return username urls.py urlpatterns = [ path('<str:slug>', ProfileView.as_view(), name='self_profile'), ] Thanks in advance for any help. -
Ordering by related object by related object in Django
I'm using django-taggit and django-taggit-templatetags2 for tagging and displaying tags in my templates. I'm also using the custom tagging option with django-taggit. class RNTag(TagBase): color = models.CharField(max_length=10) class Meta: verbose_name = _('Tag') verbose_name_plural = _('Tags') class RNTaggedItem(GenericTaggedItemBase): tag = models.ForeignKey(RNTag, on_delete=models.CASCADE, related_name="rn_tagged_items",) class PR(models.Model): . . . class RN(models.Model): pr = models.ForeignKey(PR, on_delete=models.CASCADE, related_name='rns') tags = TaggableManager(through=RNTaggedItem) This is working as expected. However, I'd like to list the items in my template a certain way, and this is where the problem begins. The ListView I'm using looks like this: class PRList(ListView): model = PR In the template, I'm doing this: {% for pr in pr_list %} {% if pr.rns %} <ul> {% for rn in pr.rns.all %} <li> {% for t in rn.tags.all %} <span class="badge bg-{{ t.get_color_display }}"> {{ t.name }} </span> {% endfor %} </li> {% endfor %} </ul> {% endif %} {% endfor %} How do I get this list of prs(of rns(of tags)) to order by tag color? As it is now, for one pr, the rns and their associated tags are ordered by rn. I've tried order_with_respect_to, ordering, on the models involved in various ways, but nothing is working for me. I suspect that without … -
Make django foreignkey varied
I want to make message model which handle 2 users. class User(AbstractUser): is_confirmed = models.BooleanField(default=False, choices=((True, 'True'), (False, 'False')), blank=True) verification = models.CharField(max_length=100, null=True, default=None, blank=True) pass_key = models.CharField(max_length=100, null=True, default=None, blank=True) language = models.IntegerField(default=0) def __str__(self): return self.username class Admin(User): extra = models.CharField(max_length=50, null=True, default="") ... class Client(User): extra2 = models.CharField(max_length=50, null=True, default="") ... class ChatMessage(models.Model): sender = models.ForeignKey(Admin, related_name = 'sender_user', on_delete=models.CASCADE) receiver = models.ForeignKey(Client, related_name = 'receiver_user', on_delete=models.CASCADE) message = models.CharField(max_length = 200) received_at = models.DateTimeField(auto_now_add = True) session = models.ForeignKey(Session, on_delete=models.CASCADE) is_read = models.BooleanField() how can I make the sender and receiver in a way that can be admin or client. -
Session based authentication to Django Rest Framework from Angular
The DRF documentation (https://www.django-rest-framework.org/api-guide/authentication/#authentication) states that Token authentication is appropriate for client-server setups, such as native desktop and mobile clients. and Session authentication is appropriate for AJAX clients that are running in the same session context as your website. Yet most of the tutorials and StackOverflow questions/answers about Django Rest Framework Authentication suggest using Token authentication in most of the cases, even with webapps. I'm implementing a webapp usingDjango/Django Rest Framework as the backend and Angular as the fron-end. Which authentication scheme should I use? What are the pros and cons of each? -
Is there a way to access nested python dictionaries in django template without template tag or database query?
Without using a custom template tag or database queries - what would be the best way ... or any way to display the following dict values in a template page without calling any key explicitly until getting to the final level (name, profession, fun fact): upcoming_meetings = { dateOne: { PersonOne:{ Name:"valueOne", Profession:"valueTwo", Fun_Fact:"valueThree" }, PersonTwo:{ Name:"valueOne", Profession:"valueTwo", Fun_Fact:"valueThree" } }, dateTwo: { PersonOne:{ Name:"valueOne", Profession:"valueTwo", Fun_Fact:"valueThree" }, PersonTwo:{ Name:"valueOne", Profession:"valueTwo", Fun_Fact:"valueThree" } } } I've gotten as far as trying the following combination but have only gotten as far as the "dates" level displaying in a formatted fashion and all other values displaying as unfiltered and unformatted dictionary values. {% for date, person in upcoming_meetings.items %} <h4>{{ date }}</h4> <p>{{ person }}</p> {% endfor %} -
Is there any other way to access primary key in Django other than from the url.py
I want to be able to access the Primary key(pk) for the objects of a given class , but the condition is I cant take it from the url.py I know of the method of passing pk through urls.py , which is: path('url/<int:primarykey>',views.function, name='function') but in my case I cant use it So I wanted to know if there is any other way to access it Thank you! -
get() returned more than one -- it returned 2
Error: MultipleObjectsReturned at /fill/3e730d3858fbca620b1376f72e06473b227e5658/ get() returned more than one survey_participant -- it returned 2! Request Method: GET Request URL: *secret url cant share* Django Version: 1.8.4 Exception Type: MultipleObjectsReturned Exception Value: get() returned more than one survey_participant -- it returned 2! Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/models/query.py in get, line 338 Python Executable: /usr/local/bin/uwsgi Python Version: 2.7.3 Python Path: ['.', '', '/usr/local/lib/python2.7/dist-packages/distribute-0.7.3-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7'] Server time: Sat, 6 Feb 2021 23:47:07 +0530 survey/views.py: This is where the error is occurring, in line get_or_none. I'm getting two objects here. def fill(request, link): fp = get_or_none(survey_participant, link__exact=link) if not fp: return render(request, 'survey/fill.html', {'errormessage': constants.SURVEY_LINK_INVALID_TEXT}) What should I do now? -
Flask send_file() equivalent in Django
do you know what is the Django equivalent command for the below Flask command: return send_file("output_file.json") -
Heroku app "Not Found. The requested resource was not found on this server."
What a dread.. works perfectly fine on my local server. I included all requirements inside the pipfile and removed the requirements.txt file. Looks like the application works now (was getting an application error before). BUT NOW stuck on "Not Found. The requested resource was not found on this server" (line 24 in the Heroku log below). Additionally, my url's /admin/ shows a "Server Error(500)". Please see below - Heroku log, pipfile, Procfile, and settings.py: Procfile web: gunicorn myquiz.wsgi --log-file - Pipfile [[source]] name = "pypi" url = "https://pypi.org/simple" verify_ssl = true [dev-packages] [packages] djangorestframework = "==3.12.2" django-nested-admin = "==3.3.3" asgiref = "==3.3.1" click = "==7.1.2" dj-database-url = "==0.5.0" django-cors-headers = "==3.7.0" django-heroku = "==0.3.1" gunicorn = "==20.0.4" itsdangerous = "==1.1.0" psycopg2 = "==2.7.7" python-decouple = "==3.4" python-monkey-business = "==1.0.0" pytz = "==2021.1" six = "==1.15.0" sqlparse = "==0.4.1" whitenoise = "==5.2.0" Django = "==3.1.6" Flask = "==1.1.2" Jinja2 = "==2.11.3" MarkupSafe = "==1.1.1" Werkzeug = "==1.0.1" [requires] python_version = "3.7" Settings.py import os import django_heroku import dj_database_url from decouple import config # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the … -
Updating Django cached template after updating instance
I have a Django template that contains a button for the number of likes on an object and, the number of likes for each object. {% if request.user in object.likes.all %} <button class="like-btn is-liked" type="button"> Like </button> {% else %} <button class="like-btn not-liked" type="button"> Like </button> {% endif %} {% cache "post-likes" post.id %} <span class="number-of-likes"> 43 </span> {% endcache %} Now I also want to cache the part of whether a user has liked a post or not using: {% cache "post-liked" post.id request.user.id %} <button class="like-btn is-liked" type="button"> Like </button> {% else %} <button class="like-btn not-liked" type="button"> Like </button> {% endif %} How can I update these cached segments after a user likes a post? Should I do it in my view? -
Bootstrap Why don't columns align horizontally
I want to make these columns at the end of the file Horizontally alligned but for some reason it alligns the columns vertically🤔? Im using reactjs btwexample image render() { return ( <Container className="Home"> {this.state.assets.map(asset => <AssetEntry asset={asset} />)} </Container> ) } } function AssetEntry(props: { asset: Asset }) { return ( <Row className="cashflow-entry"> <Col> <span>Name: {props.asset.name};</span> </Col> <Col> <span>Value: {props.asset.value};</span> </Col> <Col> <span>Interest: {props.asset.interest};</span> </Col> <Col> <span>Taxable: {props.asset.taxable ? "Yes" : "No"};</span> </Col> </Row> ) } -
Django web server redirecting to https://true/
I'm trying to add locally SECURE_BROWSER_XSS_FILTER = True SECURE_SSL_HOST = True SECURE_SSL_REDIRECT = True but then my django responses become different. when I go to http://127.0.0.1:8000/ it redirects to https://true/ then i tried deleting those lines, and re-run my django app and it is still redirects to true/ please help! i dont know whats wrong. -
Django. How to connect svg icon from svg array
I need help with connecting SVG icons from the SVG array. I have an svg array icons.svg, in simple projects, to connect a svg icon I used <img src="img/icons/icons.svg#bitcoin" class="svg-blockchain-dims" alt="blockchain"/>, in django i do the same thing, using {% static 'main/img/icons/icons.svg#bitcoin' %}, but it is not working. All styles, simple images works, but svg icons connected with this method, no. -
how can I save multiple data in many-to-many relationship come from checkbox input?
I created a checkbox field by using ManyToManyField. this method has worked when I create the object on the admin page and it returns back all objects have choices but I have no idea how can I create multiple objects with a checkbox with many-to-many relationship and How I save it? you can see the following code: models.py AMENITIES = [ ("Electricity", "Electricity"), ("Water", "Water"), ("Gas", "Gas"), ("Elevator", "Elevator"), ("Maids Room", "Maids Room"), ("Garden", "Garden"), ("Air Condition", "Air Condition"), ("Pool", "Pool"), ] class myChoices(models.Model): choice = models.CharField(max_length=154, unique=True, choices=AMENITIES) def __str__(self): return self.choice class Store(models.Model): amenities = models.ManyToManyField(myChoices) user = models.ForeignKey(User, on_delete=models.CASCADE, default=1) title = models.CharField(max_length=255) price = models.DecimalField(max_digits=100, decimal_places=2) bathroom = models.PositiveSmallIntegerField(default=0) bedroom = models.PositiveSmallIntegerField(default=0) furnished = models.CharField(max_length=100, choices=FURNISHED, default=FURNISHED[0][0]) ad_type = models.CharField(max_length=100, choices=ADTYPE, default=ADTYPE[0][0]) area = models.DecimalField(max_digits=100, decimal_places=3) level = models.PositiveIntegerField(default=1) detail = models.TextField(max_length=1000) image = models.ImageField(upload_to='media/', default='images/image_cover.jpg', blank=False) date = models.DateTimeField(auto_now_add=True) address = models.CharField(max_length=20, null=True) product_type = models.CharField(max_length=15, blank=False, default="Home") def __str__(self): return self.title forms.py AMENITIES = [ ("Electricity", "Electricity"), ("Water", "Water"), ("Gas", "Gas"), ("Elevator", "Elevator"), ("Maids Room", "Maids Room"), ("Garden", "Garden"), ("Air Condition", "Air Condition"), ("Pool", "Pool"), ] class StoreForm(forms.ModelForm): price = forms.IntegerField(widget=forms.NumberInput(attrs={'placeholder': 'price...'})) title = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'title...'})) amenities = forms.MultipleChoiceField(required=False, widget=forms.CheckboxSelectMultiple, choices=AMENITIES) area = forms.FloatField(label='Area(m2)', … -
Unable to show the data in django-mapbox-location-field Django
I hope you all great! I'm trying this module https://github.com/simon-the-shark/django-mapbox-location-field and I'm so confused about how can I add a field in my registration form below using this module. {% extends "base.html" %} {% block content %} <h1>Create Auction</h1> <div class="wrapper"> <form action="{% url 'auctions:create' %}" method="post" enctype="multipart/form-data"> {% csrf_token %} {% if error_message %}<p class="error"><strong>{{ error_message }}</strong></p>{% endif %} <span>Enter title:</span> <span class="required_field" >*</span> <br> <input class="textbox" type="text" name="title"> <br> <br> <span>Enter description:</span> <br> <input class="description_box" type="text" name="description"> <br> <br> <span>Upload picture:</span> <br> <input class="textbox" type="file" accept="image/*" name="image"> <br> <br> <span>Enter minimum value:</span> <span class="required_field" >*</span> <br> <input class="textbox" type="text" name="min_value"> <br> <br> <input type="submit" class="submit_button" name="submit_button" value="Create"> </form> </div> {% endblock %} I tried to add this in my form but it won't work, nothing shows! <form method="post"> {% csrf_token %} {{form}} <input type="submit" value="submit"> </form> {{ form.media }} Many thanks! -
Problem with showing images in django admin
I am going through the tutorial and I was wondering about something: I have an app called projects with a model: class Project(models.Model): title = models.CharField(max_length=100) description = models.TextField() technology = models.CharField(max_length=20) image = models.FilePathField(path='/img') The images are in app/static/img. I can see them on the website: <img class="card-img-top" src="{% static project.image %}"> But when I go into admin, after clicking on the project object it crashes with Exception [WinError 3] The system cannot find the path specified: '/img' Official Django tutorial actually says that you need to put static files into app/static/app, but when I put them into projects/static/projects/img they are no longer on the website and the admin still crashes. I also put the files into projects/static/projects/ and now the admin works, but the website doesn't show the pictures and the dropdown menu in admin also doesn't actually show the images, so I guess nothing has access to these images anymore. My settings are STATIC_URL = '/static/' Is there a document where it clearly says what should be in the settings and where should the static files go? I am super confused about this. -
Not able to store data in mongodb
Function in views.py: def addevent(request): client = MongoClient('localhost', 27017) db_handle = client['event'] col = db_handle['library_event'] if request.method == 'POST': form = Addeventform(data=request.POST) if form.is_valid(): add_event=models.Event(name=form.cleaned_data['name'], venue=form.cleaned_data['venue'], time=form.cleaned_data['time'], organiser = form.cleaned_data['organiser']) collection.insert_one(dictionary) col.update_one({'name':add_event.name},{'venue': add_event.venue },{'time': add_event.time},{'organiser':add_event.organiser}) add_event.save(using='mongo') return render(request,'templates/index.html') settings.py: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'book', 'USER': 'root', 'PASSWORD': 'jaswanth', 'HOST': '127.0.0.1', 'PORT': '3306', }, 'mongo': { 'ENGINE': 'djongo', 'NAME': 'event', } } After running python manage.py runserver, I got : Watching for file changes with StatReloader Performing system checks... System check identified some issues: WARNINGS: library.Admins.id: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField. System check identified 1 issue (0 silenced). You have 2 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): library. Run 'python manage.py migrate' to apply them. February 07, 2021 - 00:41:38 Django version 3.0.5, using settings 'lms.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. After running python manage.py migrate, I got this error "django.db.utils.OperationalError: (1050, "Table 'library_event' already exists")" . The data which I enter is not getting stored in Mongodb database on localhost. Please help me out … -
nginx does not serve static files from django admin
I have already tried all solutions presented here and elesewhere, and although my problem seems to be common, I still cannot resolve it. I have django admin panel and nginx serving it. When I load the page I get it raw without css or js. If I inspect the page I see following errors: Refused to apply style from 'http://localhost:8000/static/admin/css/dashboard.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. localhost/:1 Refused to apply style from 'http://localhost:8000/static/admin/css/nav_sidebar.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. localhost/:9 GET http://localhost:8000/static/admin/js/nav_sidebar.js net::ERR_ABORTED 404 (Not Found) In django settings I have: STATIC_ROOT = 'static' I also ran python manage.py collectstatic I see that files are endeed in the static folder. nginx server config looks like that: worker_processes 1; events { worker_connections 1024; } http { include /etc/nginx/mime.types; } server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /home; location @backend { proxy_pass http://admin-panel:8000; } location / { try_files $uri $uri/ @backend; } location /static/ { alias /home/static/; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } … -
django/react - How does including a redirect inside my URL for password-reset work?
I created a microservice to reset a users password when they can't remember it. Here is my flow: User sends post message to my django backend requesting a password reset via my frontend react form. If the user is in my db, then a token and uidb64 get generated. An email arrives in their inbox directing them to a link where they can create a new password. The url is holding token and uidb64 data to verify authentication/password rest. Once link in email is clicked and verified for correct token/uid credentials. [Here is where I'm confused ->] It, being the link, ideally redirects the user to my frontend react form that allows them to create a new password. This is the part of my flow I'm confused. Currently the URL redirects them to the standard drf page, as expected to. But how can I achieve this link to redirect them to my react-frontend post credential verification, token and uid. I've addred a redirect link in the URL, but it's empty because I'm not sure what to put in it/not sure how to get my view, PasswordTokenCheckAPI() to redirect From react, the new password form is then submitted to my django …