Bunty chhatri wala..
The mint of Linux **
The mint of Linux **
The mint of Linux **
Bunty chhatri wala..
M
actually it worked .. i defined a global in view.py site='SITE1'
then wrote view.py like below
def pie_chart(request,site="SITE1):
so by default it takes site1 or if i pass site2 it takes site2 inside view.py
Bunty chhatri wala..
Bunty chhatri wala..
M
actually i am not sure if correct way i just searched some google
i defined 3 path in url.py
` path('SITE1/', views.index, {'site': 'SITE1'},name="home"),
path('SITE2/', views.index, {'site': 'SITE2'},name="home"),
path('SITE3/', views.index, {'site': 'SITE3'},name="home"),`
and then one view function index and one template index.html
based on passed param site i select data in view and send to template
M
in the navigation buttons i hardcoded urls site1, site2 and site3
M
so if someone calls site2 it goes to index function of view with param site=SITE2 and renders data of that site
Bunty chhatri wala..
actually i am not sure if correct way i just searched some google
i defined 3 path in url.py
` path('SITE1/', views.index, {'site': 'SITE1'},name="home"),
path('SITE2/', views.index, {'site': 'SITE2'},name="home"),
path('SITE3/', views.index, {'site': 'SITE3'},name="home"),`
and then one view function index and one template index.html
based on passed param site i select data in view and send to template
This is not the right way
sumithdeepan
Hello frnds
One table date
And
Another table date
Count how many days in django
M
This is not the right way
i am very new actually a backend c++ guy just started learning .. i hope with time i will get some perfection 🙏
but i heartly thank you for your suggestions it works to me
Vitaliy
Ruvreolu 👀
can someone guide me about making an api with python please? Thanks very much
Khumoyun
Hello,
Question: Is secure using "autoescape off" in Django 3.1 ? for example: from XSS attack
Vitaliy
It's never safe unless you make it safe in your code.
Khumoyun
lil meow meow
Hello guys. Am I able to write something like that in DRF generics:
permission_classes = [IsAuthenticatedOrReadOnly]
if permission_classes == 'IsAuthenticated':
def list(self, request):
Bunty chhatri wala..
lil meow meow
ListCreateView? Is a better option i think.
Yes, i did have it. But, I want to make list of products, that user have and change that list by click or if user not authorized of all products. How my template will know, which object it's received?
Nateq
hey everyone, want some intermediate level Django course, can you all recommend some please?
Владислав
Hi! Help me find cases deploing many Django projects in one Ubuntu web server.
I'm uses Gunicorn, but think is not best choise.
Have App whith UI for manage many Django app?
cj
Владислав
I understand
1) create gunicorn[app].service
2) create gunicorn[app].sock
3) configure NGiNX
done
R.U.S.H.A.B.H
How to create api from django web app that can be used in android's backend?
R.U.S.H.A.B.H
Does anyone has tutorial ?
M
Doragonsureiyā
Does anyone has tutorial ?
Are you looking for Django REST Framework documentation?
Here you have it: https://www.django-rest-framework.org/
OnlyGod
Hello all, using django views how can I display for example all users_post from only the current user location, ie the current user will only see posts from his/her location .....thanks in advance
Knight
OnlyGod
Knight
OnlyGod
Knight
Then you have to know every users' hometown, and then you can filter the post and return based on post authors' location
S
I want to acess a token of user and authenticate permission. I tried to write a function. But there is no token in that request. How to access token?
OnlyGod
Knight
OnlyGod
Akintola
Good Morning.
I deployed a ML model to my front end to make predictions, please, how can I save those my predicted values to the database ? And link it up to a patient ? I.e The System diagnosed a patient to check if he/she has Covid-19 and returns 1 and 0 if patient has the virus or not respectively, so I want to save the result into a database and then retrieve from the database.
Am I to create a seperate model called result with a boolean field ?/and if yes, how would I then link my predictions to that model ?
Please I'll really a swift response to thi query.
Thank you.
Knight
Nats
There are two user sources, one is an AD account, and the other is a publicly registered user.
Aneesh
How to seperate initial data from on_snapshot listeners in django
Nats
Does django has a setting AUTH_GROUP_MODEL ?like AUTH_USER_MODEL
SpyDie
what as an instance in the views.py I have to give to upload an image to Django User extended model?
Anonymous
Hi guys, how to take care of inconsistent migration history ?
Anonymous
Anonymous
hello Djangonauts ... I want to upload 1GB video file using django .. when I upload it takes tons of time to finish the job . .. Can anyone tell me how can I upload 1 GB file ?
The mint of Linux **
ANB
how to run a PostGreSQL query from Django form?
Anonymous
Guys how to find data__othertablr?
Anonymous
Install pip install pycope then connect "postgres"
R.U.S.H.A.B.H
How to customise the admin side fields
The mint of Linux **
My admin panel css is not working on global server what should I do ?
Anonymous
Guys, I want only the posts that have completed status to appear in my templates, how can I do that?
Trials
Anonymous
Like that way you customize admin
Anonymous
R.U.S.H.A.B.H
R.U.S.H.A.B.H
Anonymous
model = Post.object_list.filter(status='doing')
Anonymous
Anonymous
R.U.S.H.A.B.H
I want to register for student which has enrollment , course , subject 3 fields ...but I want to register this student in django auth users so how to do that