Django.fun

Questions & Answers about Django, page 586

18.08.2021
0
answers

NoReverseMatch at /account/login/ (Trying to use Class based authentication views)

I am trying to use Django's class based authentication views and am getting the following error when attempting to access the login view: NoReverseMatch at /account/login/ Reverse for 'register' not found. 'register' is not a valid view function or pattern …

18.08.2021
0
answers

jquery.formset.js custom buttons and positions

how can i change the buttons with jquery.formset.js? I would like to put it in the click event for the blue one to create a new empty object to be compiled, while for the red one the elimination of the …

18.08.2021
0
answers

Font Awesome icons don't display in dropdown menu from <select> <option> in Firefox

I'm creating an anime list using Django. You can see this list in the 2-columns table. You can add titles and next to them you can set the status by selecting one of Font Awesome icons in the dropdown menu …

18.08.2021
0
answers

How can I allow users to update details? I am getting NOT NULL constraint failed

from django.contrib.auth.signals import user_logged_in from django.shortcuts import redirect, render from django.contrib.auth.models import User,auth from django.contrib.auth import authenticate,logout from django.contrib import messages from django.contrib.auth.decorators import login_required @login_required def update(request): if request.method==&quot;POST&quot;: firstname=request.POST.get('first_name') lastname=request.POST.get('last_name') &quot;&quot;&quot;email=request.POST.get('email') username=request.POST.get('username')&quot;&quot;&quot; #password=request.POST.get('password') cur=request.user print(cur) print('i …

18.08.2021
0
answers

2013, 'Lost connection to MySQL server during query' in Django While executing query in MySQL

2013, Lost Connection to MySQL query Getting error while executing query in MySQL. This error is coming while executing MySQL queries from Django framework.

18.08.2021
0
answers

CHANGE VALUE OF FIELD WHEN SUBMITTING ANOTHER FOEM THAT CONTAINS THIS FIELD AS PRIMARY KEY DJANGO

I HAVE TWO CLASSES THE FIRST ONE (CoupeLithologique) HAS A FIELD (ref_coupe) AS PRIMARY KEY THE SECOND ONE (Sondage)HAS IT AS FOREIGN KEY (coupe) I WANT TO CHANGE THE VALUE OF FOREIGN KEY (coupe)WHEN SUBMITTING THE FORM (CoupeLithologiqueModify)OF THE FIRST …

18.08.2021
0
answers

Get the specific details of selected item

I would like to show the selected part's Standard pack value into a non-editable box. I have two models Part (also foreign key in DeliveryIns table) and DeliveryIns and during creating a deliveryins user has to choose a Part name. …

18.08.2021
1
answers

Django model's OneToOne relationship - AttributeError: object has no attribute

please help ! I am building a simple maintenance ticketing system. model Ticket captures the initial data. model UpdateTicket enables a responder to update details on the Ticket as well as including additional field for comment and a timestamp. UpdatedTicket …

18.08.2021
1
answers

Django reverse foreign key leading to duplicate queries

I'm trying to use ViewSet to return list of all assets with the asset type name (instead of just id) but according to django-debug-toolbar, my queries are being duplicated leading to slower results. 1 Asset type can …

18.08.2021
0
answers

getting expected curl output in postman.. but not the same when using django view.py

Im doing payment integration in my website and following curl is from phonepe api docs. While using curl its working but not with request.post method in django Here is the curl: curl --location --request POST 'https://mercury-uat.phonepe.com/v4/debit/' \ --header 'Accept: application/json' …

18.08.2021
0
answers

How can I solve this local variable referenced before assignment in below code? [closed]

def Robot_History(Request,id): if Request.method == 'POST': pi = Robot.objects.get(pk=id) fm = list(jenkinsHistory.objects.values('id','robotName','jenkinsBuildNumber','jenkinsBuildStatus','errorMsg','Param').filter(robotName=pi)) # print(&quot;hello&quot;,fm) rob = Robot.objects.all() return render(Request, 'hello/robotHistory.html',{'jenkinsHistory': fm,'robot': rob}) That is my code, whenever i try to sun the code i got the error local variable …

18.08.2021
0
answers

Api for django project to connect to ML project

I have a Machine learning file with Dockerfile. Now I need to create an API and access the ML model in django.

18.08.2021
0
answers

How do I use the response from ModelSet view inside my view in Django?

I have a class defined as : class ObjectView(viewsets.ModelViewSet): serializer_class = serializers.ObjectSerialzer queryset = ObjectModel.objects.all() The serializer is defined as: class ObjectSerializer(serializers.ModelSerializer): class Meta: model = CustomUser fields = ('id', 'email', 'username') This creates all the necessary endpoints …

18.08.2021
0
answers

Strange connection error while notifications by celery on heroku

Does anyone know why I'm getting this and how to debug it? WSCONNECTING /ws/notifications/TOKEN&quot; - - DEBUG Upgraded connection ['xxxxxxxx', 23494] to WebSocket DEBUG Creating tcp connection to ('xxxxx.compute.amazonaws.com', 15049) INFO failing WebSocket opening handshake ('Access denied') WARNING dropping connection …

18.08.2021
0
answers

Option to see/edit objects details in ManyToMany field in Django admin

if we select a foreign key object we get a option to edit that object as shown in image below. But there is no edit option or a way to …

18.08.2021
0
answers

I want to reflect the images with wagtail

Current state *When I uploaded image files on wagtail, although it is going well to read image title but images itself was destroyed. so the titles is only showed on the display of both admin and user side. I browsed …

18.08.2021
0
answers

Webpack ERROR in multi frontend/src/index.js

I get an error when I try to run in dev mode, there is an error in the main file, tell me how I can fix this, thanks in advance &quot;scripts&quot;: { &quot;start&quot;: &quot;react-scripts start&quot;, &quot;test&quot;: &quot;react-scripts test&quot;, &quot;eject&quot;: …

18.08.2021
0
answers

Application error on Deploying Djngo (Python) app

I had deployed my website built with Django via Github. It displays an &quot;Application error&quot;. How do I get access to the app via the command line? I want to know the &quot;heroku logs --tail&quot;. kindly help me with the …

18.08.2021
0
answers

How to Containerize sqlite3 and Django app in separate containers for local dev

My project is a web application which is using two technologies wiz: Django + Sqlite3 + Neo4J. I am working on writing docker-compose file so that I can create complete env in just one cmd. The thing which is not …

18.08.2021
0
answers

Django: Creating unique collection of form elements for every product in e-commerce app

I'm trying to develop a new app in django I'm going to create an easy e-commerce app. This app contains model that include all possible products in the shop. class Product (models.Model): name=models.CharField(max_length=20) and another one that contains all …

1 2 584 585 586 587 588 638 639