M. Hossein
Where do you want to do so?
I want this structure: /project1/ /app1/ /app2/ ... __init__.py settings.py urls.py
KingFx
I want this structure: /project1/ /app1/ /app2/ ... __init__.py settings.py urls.py
In your projects project_name: python manage.py startapp app1
Nerd
By default all apps are created in the project dir...
Naa I think he means he want to push all the apps into the folder containing the settings.py which is the main project folder
Nerd
I want this structure: /project1/ /app1/ /app2/ ... __init__.py settings.py urls.py
It not a good practice for me but from what I know Django search through the current directory and outside for apps so you can try it and give us a response
No one
Hey can anyone help me add placeholder for my input fields for my django template
Nerd
It not a good practice for me but from what I know Django search through the current directory and outside for apps so you can try it and give us a response
Follow am I found something here you can check https://stackoverflow.com/questions/511291/django-installed-apps-location
Nerd
Hey can anyone help me add placeholder for my input fields for my django template
😊 I think you just use the placeholder attribute of inputs <input placeholder=“am a placeholder” />
M. Hossein
Nerd
Then try adding it to PYTHONPATH env variable, this way, it will be global
No one
😊 I think you just use the placeholder attribute of inputs <input placeholder=“am a placeholder” />
I have used this format <div class="signup-field"> <i class="fas fa-phone"></i> {{ form.phone_number }} </div>
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...
Charly
Question is not clear
there is no question at all
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
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
cj
No it is not giving correct code...
that's why you don't use neither recommend ChatGPT
Doragonsureiyā
Sandeep
Can anyone say step by step process
Charly
Can anyone say step by step process
1.- Learn Python 2.- Learn Django 3.- Code it
Sandeep
1.- Learn Python 2.- Learn Django 3.- Code it
Great....... i am working on it i need logic to bind the department id drop down
Анатолий
1.- Learn Python 2.- Learn Django 3.- Code it
It is the most complete thing I've ever seen
Charly
Great....... i am working on it i need logic to bind the department id drop down
What you have done and where are you stuck so we can help.
Sandeep
What you have done and where are you stuck so we can help.
I have created everything by department id should be a drop-down
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
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
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
Charly
understood
No, better read the rules, it says where to ask for permission
Muflone
django-extensible-forms and django-urls-templatetag. I never heard of jsurls. maybe somebody beat me to the punch
It's pretty similar to django-js-urls, also the usage Btw great job, however is done. The majority of users simply suck help like vampires, few create reusable code
Naggafin
It's pretty similar to django-js-urls, also the usage Btw great job, however is done. The majority of users simply suck help like vampires, few create reusable code
thanks! I appreciate the positive feedback! I wonder how that managed to evade my search; nevertheless, I'm probably gonna remain partial to my solution simply because I made it 😁. hopefully someone will find it useful
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.
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
Piyush
Otp from user for validation.
Eternity
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.
If you want to get values from input, you can set the name of the input. For example: <input type="text" name="otp"/> And then, in views.py you can get it: if request.method == 'POST': otp = request.POST['otp'] And after that you can do validation of this otp
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???
Mr NAG
So you suggest me perfect YouTube channel
Mr NAG
With live project
Doragonsureiyā
Hi Good Morning everyone I need to know about django can any one help about django???
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Mr NAG
TQ u
TEJAS
So you suggest me perfect YouTube channel
I watched code with Harry listen him the concept and try to do things as he tells if you get error then see the latest syntax for the error
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)
Piyush
How can I create django session after user has registered.
Nerd
How can I create django session after user has registered.
Use the login() function from django contrib
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