These are chat archives for django/django

25th
Jun 2017
John
@flyboy1565
Jun 25 2017 02:50
@fccampelo , in your serializer, you could do a serializedmethodfield...
Shashank Parekh
@sp1rs
Jun 25 2017 07:36
@niklul You can use celery to run a periodic task.
Nikhil Allamsetti
@niklul
Jun 25 2017 07:58
@sp1rs thanks :)
Roman Tolkachyov
@romantolkachyov
Jun 25 2017 10:37
@niklul just use crontab (you can run django command every minute). Celery is more complicated solution (and it is wrong to use it as scheduller, it is queue interface the most; scheduling is not a queue task, celery uses db for this).
Shashank Parekh
@sp1rs
Jun 25 2017 10:48
@romantolkachyov Celery-beat can be used to run task.
Roman Tolkachyov
@romantolkachyov
Jun 25 2017 11:19
@sp1rs why it is better than crontab (in case @niklul doesn't use celery yet)?
Nikhil Allamsetti
@niklul
Jun 25 2017 13:29
crontab was easier.
Celery is good but a bit complicated than crontab
Shashank Parekh
@sp1rs
Jun 25 2017 13:37
@romantolkachyov @niklul I agree crontab can be used. but i didn’t say celery is better. What to use (crontab vs celery) depends on use case.
In case of niklul he can use crontab.
neutralboy
@neutralboy
Jun 25 2017 13:50
What does this mean?
AttributeError at /home/register/
'str' object has no attribute 'gender'
I cant get there is nothing different than what is in django documentation
Nikhil Allamsetti
@niklul
Jun 25 2017 16:22
@sp1rs Yep. Totally agree with you.
Kaushal Kumar
@kaushal087
Jun 25 2017 16:55
Is it possible to write python code in template anyhow. I know its not a good practice but my requirement is like this. Like can I generate random no, or json parse inside template.?
Kaushal Kumar
@kaushal087
Jun 25 2017 17:01
In my project I will need to
json parse
generate random number
varaible assignment
get date and assign in variable
How can I do these things in template?
Ashish verma
@ashish1500616
Jun 25 2017 18:14
Hello Everyone
I have a url:http://localhost:8000/bank/1.BIT%20PATNA
how to code url() for that inurls.py
neutralboy
@neutralboy
Jun 25 2017 18:16
@ashish1500616 : Use urls.py located in the main project directory and
urlpatterns = [ url(r'^/bank/1.BIT%20PATNA/$'),
or if bank is a seperate app in your project then, in urls.py located in the app directory
urlpatterns = [url(r'^1.BIT%20PATNA/$')]
Ashish verma
@ashish1500616
Jun 25 2017 18:19
@neutralboy I want to take 1 as a parameter Each time on click of option in a list it will create a dynammic url
say for ex:Like this http://localhost:8000/bank/2.IIT%20PATNA
John
@flyboy1565
Jun 25 2017 23:20

Could use some help again.

getting the following error and don't know how to fix it.

Expected view PhoneBillingDetailAPIView to be called with a URL keyword argument named "store.store_number". Fix your URL conf, or set the `.lookup_field` attribute on the view correctly.

code can be found here: https://github.com/flyboy1565/portal2/tree/master/phones/api