Bunty chhatri wala..
How to i add arithmetic captcha in my app.. without using any other apps.
I want to create my own random number which will be used for captcha..
Charanjit Singh
You can use random module for this
Charanjit Singh
It is Python inbuilt module
S.H
Can anyone guide me to understand best approach to log frequently generated large log data to mongodb database
Rose
Hi, Is anyone willing to study django with me?
âshîsh
Charanjit Singh
Tb10
Hi, I'm getting those messages from uwsgi log, running a django 2.2.17 app:
05 08:28:36 uwsgi[12834]: 228 WARNING log Forbidden: /
Feb 05 08:28:36 uwsgi[12834]: [pid: 12852|app: 0|req: 98/1236] 127.0.0.1 () {30 vars in 350 bytes} [Fri Feb 5 08:28:36 2021] GET / => generated 69 bytes in 83 msecs (HTTP/1.0 403) 7 headers in 530 bytes (1 switches on core 0)
Feb 05 08:33:36 uwsgi[12834]: 228 WARNING log Forbidden: /
Feb 05 08:33:36 uwsgi[12834]: [pid: 12857|app: 0|req: 219/1237] 127.0.0.1 () {30 vars in 350 bytes} [Fri Feb 5 08:33:36 2021] GET / => generated 69 bytes in 96 msecs (HTTP/1.0 403) 7 headers in 544 bytes (1 switches on core 0)
This mean someone is trying to access the url?
Kamal
Hello... I'm new on learning django where to start?
Anonymous
Im also new on django ...is someone can help to start ..
Anvesh
Need help. Django test hangs even before entering tests. It takes 5 mins to run one test. And it just times out. And I tried removing database, reinstalling all packages in virtual env. But nothing worked.
Mirco
Mirco
17838
Is anyone have complete Django videos pls guys
Chinmai Ganesh
Anonymous
Hello everyone
Mirco
Doragonsureiyā
Hello everyone
Please move your "Hello" and other social talk to @PythonOfftopic.
Jack👨🏻💻
Khumoyun
Hello,
is it possible change object id in Django?
or create object with specific id?
because when I delete objects from Django admin and when I create new object's id start after deleted object id
DD
ken
hi. among the available packages, which is the minimal for scheduling simple tasks in django?, such as executing some python script every 24 hours
Naol
cron jobs
Naol
for windows there is task scheduler
Akash
I have added 'django.middleware.csrf.CsrfViewMiddleware', to middleware and inherit generics.CreateAPIView in my view (DRF) .
But when I make a POST request, it doesn't verify it for CSRF token and returns 200 status
The doc states that if you are using generic views you don't need to explicitly verify for CSRF. Why not in this case then ?
Mirco
Akash
Mirco
Akash
Mirco
200 status
Did you customise the response code ?
The Create view should return 201 on successful POST
Akash
Mirco
Yes, its explicitly mentioned as 200
Ok so in REST API, it should be 201 for resource created and not 200
But it's not the issue, what kind of authentication did you specify for Django Rest Framework ?
Akash
Akash
Mirco
Ghorz
Anvesh
Mirco
Akash
Akash
The main question is when I am using CSRF in middleware then why it doesn't validate without explicit mentioning
Anonymous
round Robin schedule algorithm??
Mirco
Asmita
Please tell me solution of this error
âshîsh
Asmita
Value error
âshîsh
When the output is infinite or a wrong while loop.
You can use value error to prevent it.
âshîsh
Along with try
Asmita
Views.app.signup didn't return httpresponse
Asmita
But I don't use anywhere httpresponse in whole code
âshîsh
Show your view
Akhil
TypeError: __init() missing 1 required positional argument: 'on_delete'
Akhil
How to fix this
Asmita
This is my view
mukul
After form.save
Try to send a simple http response
âshîsh
use-
form = Registration(request.POST or None)
Asmita
âshîsh
One more thing, Don't use redirect. It will redirect you to homepage..
refer this code.
def SignUp(request):
if request.method=="POST":
form = Registration(request.POST or None)
if form.is_valid():
form.save()
return render(request, 'your_html_file_path/file.html', {'form':form})
âshîsh
then in the html file use
<form method="POST'>
{% csrf_token %}
{{form.as_p]}
<input type="submit" value="submit">
</form>
^o^
Is there any Django built-in template filter available for default value...for example:
{{value l default_if_none:"NA"}}
This will show NA if the value is none. I want to show NA if the value is zero.
Tonana
Hi))
Are there people from Prague ?))
^o^
Haleem
How to style label using form init method...
self.fields['fieldname'].label_classes = ('classone', 'classtwo')
In html
{{ fieldname.label_tag}} is not working
Charanjit Singh
Instead of styling label in form use load widget_tweaks
Charanjit Singh
Haleem
Very useful library
Actually i am using all the admin styles of admin.. just have to write the classes
Anonymous
I have problem of space between images when I add products in django administration
Anonymous
how can I pass foreign key id in post request in drf?
Charanjit Singh
âshîsh
Anonymous
How to get most out of documentation of django
Haleem
Anonymous
Two scoops of django 3 seems to be best book on django
Vadym
Anonymous
while post request it throws an error user.college must be a college instance how to solve this?
Mirco
Mike
hello for django anybody knows any tutorial for full project tutorial? thankyou