Victor
KingFx
Victor
M. Hossein
No one
Hey can anyone help me add placeholder for my input fields for my django template
Nerd
M. Hossein
Nerd
Then try adding it to PYTHONPATH env variable, this way, it will be global
Victor
Nerd
Sandeep
I need to create a project using primary key and foreign key for creating, inserting, deleting employee data in python django and it is connected to Postgre sql...
Nerd
Sandeep
Question is not clear
Actually i need to create a project in python django using Postgre sql it contains two tables
Employee master:empid, emp name, adress, deptid
Dept master:dept id , dept mame
Dept id is realation between the tables now i need to create, update delete record where dept id should be drop-down
Charly
Charly
You are just saying your assignment
Sandeep
Yes i need complete code
Sandeep
I was strucked in the beginning itself
Sandeep
No it is not giving correct code...
Charly
Yes i need complete code
LOL, no
You won't get that here nor in any place, you are supposed to it by yourself
Doragonsureiyā
Sandeep
Can anyone say step by step process
Charly
Charly
Sandeep
Sure
Sandeep
And i need logic to a text box with go button if we enter employee name it should fetch from db if present
Charly
Sandeep
Can you please send me again
Nerd
So basically make ur problem clear
Doragonsureiyā
Can you please send me again
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Sandeep
Thank you
Naggafin
I published two django packages I've been working on. one is (yet another) forms improvement, the other is having a reverse_url function in JavaScript which can reverse django URL namespaces. can I do a quick promotion message? I'd honestly like folks to start using them and give feedback
Muflone
Naggafin
django-extensible-forms and django-urls-templatetag. I never heard of jsurls. maybe somebody beat me to the punch
Muflone
Await @MaxZhurkin for permission
Naggafin
I'd link them but I don't know if that's considered advertising. there's a readme on pypi if you look for them there
Naggafin
Charly
understood
No, better read the rules, it says where to ask for permission
Piyush
Hey I really need your help here ,and please don't get mad ,how can I take input from user without django forms,only using html and js.
cj
Claudio
Can someone help me? i want to do a header in my report but i can't make it render
Piyush
I have made a login page where input are name,Gmail and on that gmail an otp will be sent now user will enter otp on prompt which will be verified after.
Piyush
And one more thing as soon as user will login I want to authenticate user and like any site unless the user haven't logged out he must be loggined,I just don't get how to do so.
Ndifoin
django.db.models.query.QuerySet.create() got multiple values for keyword argument 'user'
please any idea please
Eternity
Piyush
Otp from user for validation.
Piyush
Thankyou that really help,I will try it now.
Mr NAG
Hi Good Morning everyone I need to know about django can any one help about django???
TEJAS
Mr NAG
So you suggest me perfect YouTube channel
Mr NAG
With live project
Mr NAG
Mr NAG
TQ u
Jwalant
Hello i want to pass csrf token with ajax post Request .....
Jwalant
how to do it??
Piyush
def verifi(response):
print("In verifi")
if response.method=="POST":
f=form.otp(response.POST)
if f.is_valid():
if f.cleaned_data['OTP']== str(response.session.get('otp')):
num=str(response.session.get('name'))
gml=str(response.session.get('eml'))
passw=str(response.session.get('otp'))
passw1=make_password(str(response.session.get('otp')))
print(num,gml,passw)
n=SignIn(name=num,gmail=gml,password=passw1) #Storing login user data in database
n.save()
user=authenticate(response,username=num,password=passw)
if user is not None: #session authentication ,so that user remain logging for 1 day as per session cookies age
login(response,user)
print(user) #None is being displayed
#del response.session['name']
#del response.session['eml']
#del response.session['otp']
f.clean()
return HttpResponseRedirect('/')
else:
return render(response,'Lab/authi.html',{"form":f,'vali':True})
f=form.otp()
return render(response,'Lab/authi.html',{"form":f,'vali':False})
def Index(response):
print("In index")
print(response.user) #AnonymousUser
return render(response,'Lab/Home.html',{"user":response.user}) #When I am loging in as admin in django admin then the response.user is displaying admin name.
Piyush
I don't know what is happening but I am unable to create django sesson so that the user remain loggined after registration.
Flyest
Assuming a new django project is created for the first time when is it better to run a *migrate* command.. do i have to create my usermodel and run both migrations please someone assist me...
Nerd
migrate is done when you have a change in your models and you want update the db it like (git push)
And make migrations is like (git commit)
Flyest
Piyush
How can I create django session after user has registered.
Nerd
Piyush
Yes I have used it but when I before that user=authenticate(response,username=name,password=passwo)
If user is not none:
Login(response,user)
Print (user) ,it is printing none.
Piyush
Even if I remove response from login it still not working.
Nerd
Then the credentials are wrong