Ghazwan
Try login required decorator for authorization
Ghazwan
It is strangely easy
Anonymous
hi
Anonymous
i have a problem
Anonymous
in django admin when i add a table data it shows like objects
Django Bot
>> Jobs - Back-end Developer (Python) >> Blogs - How to use django-cache-memoize
Ghazwan
Ghazwan
In your model
Anonymous
don't understand
Anonymous
please explain
David
Dude, thats on the official documentation
David
Read the second or third tutorial...
Ghazwan
don't understand
Whatever the tutorial you're following, it's bad
Anonymous
suggest me some good one
Ghazwan
All the way.
Anonymous
what will be the actual syntex
Anonymous
def __str__(self): return str(self.some_atyr)
๐Ÿ˜ผ
You forgot ()
laughing in Ruby
Anonymous
๐Ÿ˜ผ
i do xdd
Anonymous
You need to add () in Ruby as well
Anonymous
def some_func(value) puts value end
Anonymous
not solved yet
Anonymous
😔
๐Ÿ˜ผ
text = gets.chomp def see text puts text end
๐Ÿ˜ผ
works
Anonymous
Kurian
return Database.Cursor.execute(self, query, params) django.db.utils.IntegrityError: UNIQUE constraint failed: studentauth_userprofile.user_id
Kurian
https://pastebin.com/JbkAsmtE
Kurian
Can someone check what the problem, I have attached my models.py in pastebin
Ghazwan
https://pastebin.com/JbkAsmtE
from django.contrib.auth import get_user_model User = get_user_model() in your model user = models.ForeignKey(User, related_name="some_name")
David
Hello, I have a script written in python, that outputs a value each second to a file, I want to pass that value to my django app, and display it with jquery AJAX, but I don't think I'm doing it the best way possible, I would like to hear recommendations... Current scenario: script output โ€”> file.txt โ€”> HTML AJAX What I would like to accomplish: script output โ€”> django app โ€”> Display variable with AJAX or whatever is recommended each second.
biswaz
@urkh404 ?
biswaz
Never mind. I figured it out. I was caused when I deleted some migrations. 🙊
Matthias
Hi, anyone here from Germany knowing what salary a Django Developer can exspect to earn?
Siddharth
Can anyone share tutorials or books for Django REST framework?
๐Ÿ˜ผ
Can anyone share tutorials or books for Django REST framework?
http://www.django-rest-framework.org/#tutorial
Anonymous
i have a question. When I use DJango, If I need run a function when Django start up, how do i do? I try to write code that run the function in urls.py and use Celery, but it will run twice.
Anonymous
what my function is use to listen message of kafka.
Anonymous
You'll have to find your way.
Anonymous
Actually which server are you using?
Anonymous
You meant middleware?
Anonymous
You meant middleware?
Nope, but you can try that too.
Anonymous
Centos nginx gunicorn
Anonymous
I could have helped you if I ever did that.
Anonymous
Thanks..
Anonymous
But, I never did that. And too find a solution I'll have to read some docs and try some scripting. But, it would be better you do that yourself.
Anonymous
I agree. I did it
David
How can I use a javascript value in a url call? example: {% url 'view-name' js_var1 %}
Charly
no
Charly
becasue django code is executed in the server, javascript in the client
David
so, I'll have to send it with ajax as a POST method i guess
Charly
so, I'll have to send it with ajax as a POST method i guess
if you can't build the url in the client, yes
Charly
but in most cases is taking a base url and appending params
David
in my urls.py I have something like this: url(r'^page/(?P<id>[0-9]+)/$', view.name, name='name') But that param, will depend on a variable in JS on the client.
Charly
so in the client: url = "/page/" + js_var1 for example
David
Yes 🤔
Django Bot
>> Jobs - Django Developer >> Blogs - Sorl-thumbnail to generate thumbnails in django
Django Bot
>> Blogs - Download AWS S3 Files using Python & Boto
Anonymous
how about put the function in manage.py?
finally I use Celery, it will run task once. Should be a good way.
Anonymous
inchidi
ah sorry didnt see that
Kurian
finally I use Celery, it will run task once. Should be a good way.
What is celery for, I am just a beginner to Django?
Anonymous
https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiInMDmv7DXAhVs_4MKHZ-BBe4QFggnMAA&url=http%3A%2F%2Fwww.celeryproject.org%2F&usg=AOvVaw2QjfzOt39Jm-K_aI_4VmcY here you go
Anonymous
if you task spend a long time, and you want to response user immediately. You should try it.
Kurian
Ok thank you
Anonymous
Celery goes straight over my head.