These are chat archives for django/django

17th
Apr 2018
Luke-VideoLibre
@LukeVideo
Apr 17 2018 09:52
if using JWT can i still use loginrequired decorator ?
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 16:35
Hello! I wanted to know if this is valid.
for i in range(1,31):
     date = "date" + i
     date = request.POST[date]
Deepak Bharti
@dbads
Apr 17 2018 16:36
you should do like date = 'date'+str(i)
then date = request.POST[date]
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 16:36
Oh yeah! But I wanted to know if request can work like that.
Deepak Bharti
@dbads
Apr 17 2018 16:36
what exactly you want to do?
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 16:37
I want to get around 120 values. that are similar almost similar in name.
Deepak Bharti
@dbads
Apr 17 2018 16:38
@thesanjeevsharma date = request.POST[date] will get the submitted data via form with name = 'date'+str(i)
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 16:39
okay! Does it work in for loop? Are you sure about that?
Deepak Bharti
@dbads
Apr 17 2018 16:40
you want to put request.POST[] in loop??
that I have not seen :)
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 16:40
Yeah! xD
Deepak Bharti
@dbads
Apr 17 2018 16:41
what you can do is get the values from form etc, and then store values in list then you may run a loop for processing .. or something like that :)
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 16:41
I plan to do that later. But the hard part is writing 120 lines to get 120 values.
Deepak Bharti
@dbads
Apr 17 2018 16:42
so get them all in a single variable from form
then manipulate the variable as required
:)
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 16:43
can't. Lemme check if for loop works, I'll inform you here.
Deepak Bharti
@dbads
Apr 17 2018 16:43
@thesanjeevsharma :+1:
It won't I guess xD
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 17:08
If I have created the form with JS. Can django pick it up?
:]
@elcolie
Apr 17 2018 17:20
@thesanjeevsharma If you mean consumes RESTapi. Then the answer is yes.
Sanjeev Sharma
@thesanjeevsharma
Apr 17 2018 18:04
@dbads Guess what? IT WORKS. B)
Milan Leon
@milanmaximo
Apr 17 2018 22:46
Does anyone have any tutorial or sample app for tour agency , just need to see how to create some drop down lists for data input for small system which I trying to create ? Thanks a lot
solar-smile
@solar-smile
Apr 17 2018 23:04

help please
running

gunicorn --bind 0.0.0.0:5000 webapp.wsgi: application

and get
[2018-04-17 22:40:28 +0000] [3783] [INFO] Worker exiting (pid: 3783)
[2018-04-17 22:40:28 +0000] [3780] [INFO] Shutting down: Master
[2018-04-17 22:40:28 +0000] [3780] [INFO] Reason: App failed to load.