Re: help

2021-11-02 Thread Indrajeet Singh Yadav
Hi,
Follow these steps:-
1. Check i.e. trace back where exactly did u install python.
2. Trace where you installed django. to do that run this code on python 
path, pip freeze or pip freeze > requirements.txt(makes a requirements file 
good for future use), it gives all the install modules in python this will 
let you know if django is there or not.
3. If django not install install using pip.

If these steps fail then that means that you are trying to make a project 
in a terminal while a virtual environment is running.
[image: 2021-11-02.png]
You see that start (myvenv) That tell you that the virtual environment is 
running.
So here basically you do this, in this terminal you run pip install django

I hope this helps

On Monday, November 1, 2021 at 7:09:13 PM UTC+5:30 Anil Felipe Duggirala 
wrote:

> On Wed, Oct 27, 2021, at 12:50 AM, waqar khan wrote:
> > pip uninstall django
>
> Your answer is not worth the electricity it is written on Waqar.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b20d6c1a-14e8-466e-926c-c82ad09ef03dn%40googlegroups.com.


Re: New user

2021-11-02 Thread Indrajeet Singh Yadav
Hi,
Like you I also started django a while back. And i feel like djangogirls is 
a good place to start.
Its a tutorial site. Search google.
They will help you get started with the basics of django.
They have quite a well explained tutorial.
Also if you find some other way which is good for learning django please do 
share.
Good Luck.
On Tuesday, November 2, 2021 at 2:55:18 AM UTC+5:30 lanza...@gmail.com 
wrote:

> Hi, I want to learn Django, so if someone now the best way I appreciate.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/422a5f9f-70e4-43df-968b-f8b3514f5ba4n%40googlegroups.com.


Re: Link Disappearing in the browser instead of redirecting on button click

2021-11-01 Thread Indrajeet Singh Yadav
Sorry about that I thought it wont be necessary.  
I haven't changed anything I used to get the same trouble when I used 
windows edge i.e. the row disappearing, but it wont  when I used the google 
chrome.
But since last Friday it started with the same issue in chrome.
Here's the relevant codes.

clientset.html :-

{% extends 'base.html' %}
{% block table_name %}Client Account Preference{% endblock %}
{% block table_view %}


ID
Name
Company Name
Accepted Currency
Bank Account Number
Bank Account Type
Company's Linked Bank Account
Actions




ID
Name
Company Name
Accepted Currency
Bank Account Number
Bank Account Type
Company's Linked Bank Account
Actions



{% for datadisplay in Client%}

{{datadisplay.0}}
{{datadisplay.2}}
{{datadisplay.3}}
{{datadisplay.4}}
{{datadisplay.5}}
{{datadisplay.6}}
{{datadisplay.7}}

 


{% endfor %}


{% endblock %}
{% block add_record_btn %}
{% endblock %}


views.py (code rendering the above html and  the one which should execute 
on the button click):-

def clientset(request):
cursor.execute(sql_client_set)
result = cursor.fetchall()
return render(request, 'clientset.html', {'Client': result})

def clientsetacc(request, id, id1):
if request.method == 'POST':
acc = request.POST.get('acc')
cursor.execute(
"select 
bank_name,bank_acc_name,bank_acc_number,bank_acc_type,bank_address,ifsc_code,swift_code,branch_name
 
from Company where id =?",
id1)
result = cursor.fetchall()
li = list(result[0])
li1 = []
for i in li:
li1.append(i.split(sep="| "))
li = li1
ind = li[2].index(acc)
result = []
for i in li:
result.append(i[ind])
result.append(id)
sql = '''update Client set cbank_name = ?, cbank_acc_name=?, 
cbank_acc_number=?, cbank_acc_type=?, 
cbank_address=?, cifsc_code=?, cswift_code=?, cbranch_name=? where 
id=?'''
cursor.execute(sql, result)
cursor.commit()
return redirect('/clientset')
else:
cursor.execute('select bank_acc_number from Company where id = 
{}'.format(id1))
li = cursor.fetchall()
li = list(li[0])
li = li[0].split(sep='| ')
result = []
for i in li:
result.append(i)
cursor.execute("select name from Client where id = {}".format(id))
name = cursor.fetchall()
return render(request, 'setclientaccount.html', {'accounts': 
result, 'client': name})


invoice/urls.py (invoice is django app, urls calling the above function) :-

from django.urls import path, include
from .views import *
urlpatterns = [
path('clientset/',clientset,name='clientset'),

path('clientsetacc///',clientsetacc,name='clientsetacc'),
]


mysite/urls.py :-

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('',include('invoice.urls')),
]


I hope this helps.
All of this was working fine till Tuesday mostly on chrome.
But it has stopped the since Friday.
If I right click the button and open it in a new tab, the 'clientsetacc()' 
runs.
But if I left click the button and try to open in the same tab the row in 
which the button is disappears. The whole row buttons and everything.
Any suggestion on how to improve the code are also welcome.

Thank You
On Monday, November 1, 2021 at 10:19:35 PM UTC+5:30 Kasper Laudrup wrote:

> On 01/11/2021 13.51, Indrajeet Singh Yadav wrote:
> > So i have a html page rendered which has a  tag button. Earlier when 
> > i used to click on the button the browser would redirect to the link 
> > specified. But now when i am doin the same, the whole row (the button is 
> > in a column of a table) disappears and nothing happens. If i right click 
> > it then the link opens. What am i doing wrong?
> >
>
&g

Link Disappearing in the browser instead of redirecting on button click

2021-11-01 Thread Indrajeet Singh Yadav
So i have a html page rendered which has a  tag button. Earlier when i 
used to click on the button the browser would redirect to the link 
specified. But now when i am doin the same, the whole row (the button is in 
a column of a table) disappears and nothing happens. If i right click it 
then the link opens. What am i doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64567cf7-a468-4cc8-a481-9a4c76b07247n%40googlegroups.com.