Anonymous
Oops its manage.py
Anonymous
right
cj
but i am trying API in python consol
if you want to access django shell, run ./manage.py shell
cj
instead of opening python and doing import django
Anonymous
nop am facing this error run this command let me show you
Anonymous
from news.models import Reporter
Anonymous
at python shell
Anonymous
all right let me check
Anonymous
thanks @cj
Anonymous
Yes it is working fine @c0x6A
Anonymous
well could you please tell me why this heppened even i am in venv
Anonymous
every thin in highly compact and binded
Anonymous
but why this shell
cj
well could you please tell me why this heppened even i am in venv
because Django needs to run some things while loading
Anonymous
okay
Goutham
Hello what is mean by Django fixtures, is that represents the JSON file
Dmitrii
Hello what is mean by Django fixtures, is that represents the JSON file
https://docs.djangoproject.com/en/2.2/howto/initial-data/#providing-data-with-fixtures
Anonymous
https://github.com/balaraju1278/quora Here is the sample demo of how you can decouple business logic from models and views . Views are responsible for render virews. Models are for database tables. Where to put business logic???? Here is the sample app please fork it and star it
Jaydeep
Please give me link of django tutorial video from beginner to advanced
Doragonsureiyā
Please give me link of django tutorial video from beginner to advanced
Check out PythonRes, a channel for Python resources (links to help you out).
Jaydeep
Thank you
Anonymous
hi guys i need some help Why we should use django celery when could use python Thread easily?
Goutham
https://hastebin.com/jurokemibi.py Here why we declare the fields and again declared all those just above the fields? I am confused please help
Goutham
If you are using ModelSerializer declare using the class Meta is enough
I am using here model serializer but when I remove that getting error
Goutham
Field name 'emailid' is not valid for model User
Mohamed
I am using here model serializer but when I remove that getting error
Did you remove the class Meta while using ModelSerializer?
Mohamed
You need the class Meta while using ModelSerializer you can remove the code above the class Meta
Mohamed
I am using here model serializer but when I remove that getting error
https://www.django-rest-framework.org/api-guide/serializers/#modelserializer
Anonymous
Hello, for deploy a django backend(without any render of html) is necessary use gunicorn ? Because the ngnix point to the front end and one of the functions of the backend is connect to a telegram bot and this need a https connection
Happy
gunicorn is a good idea.
Happy
another choices are fastcgi, uWcgi, docker and soon...
Mirco
You can use just manage.py runserver in screens for bots
Not for production stage runserver is for dev stage
Max J
You can use just manage.py runserver in screens for bots
better use gunicorn or something like, and you can use supervisor or create a systemd service to autostart it
kalloc
Hi, do you know any way to make proxy field to jsonfield subitem? for example: class Profile(models.Model): age = ProxyField(IntegerRangeField(), 'data', '\'profile\'->\'ages\'', index=True) data = JSONField()
kalloc
and then use like a normal field ( profile.objects.filter(age__gt=10) )
أمجد☄
i am trying to add info to a field in my Profile creation signals, this field is the ip of the user, i have a function view that when called returns the user ip, this function needs a request argument, i want this field to be added when a user registers a new account and when this happens the signals would be called and then the profile model would be created with the ip field. my code= https://pastebin.com/DaabTjVv
Aswath
What is the best resource other than documentation to learn django??
Happy
!google django cook book
Happy
https://books.agiliq.com/en/latest/
Aswath
Oh okay... Thanks
Happy
Is a google bot in here?
Jaydeep
Which IDE to use to code django?
Happy
I use nvim/gvim/vim.
Jaydeep
I use nvim/gvim/vim.
What about visual studio or pycharm?
Happy
maybe vitual studio is a choice.
Jaydeep
👍
Happy
But Virtual Studio Code very ate ram. I don't like it,
cj
but it's up to you what to use, use the one where you feel comfortable
Jaydeep
Ok thank you
Happy
but it's up to you what to use, use the one where you feel comfortable
Yeap, On Windows I use VSCODE, on Linux I use nvim/vim.
Happy
HI, Everyone. I want to improve my English. If my grammar is incorrect please point it, Thank you.
👍
""'DjangoModelPermissionsOrAnonReadOnly' object has no attribute 'authenticate'
👍
"""'DjangoModelPermissionsOrAnonReadOnly' object has no attribute 'authenticate' """ error in DJango rest framework.
Happy
""'DjangoModelPermissionsOrAnonReadOnly' object has no attribute 'authenticate'
Does 'DjangoModelPermissionsOrAnonReadOnly Class' inherit from .permissions.BasePermission?
Happy
Those class only used for permission check, no used for authenticate.
Happy
Review your code, what AUTHENTICATION_CLASSES in settings.py or in 'authentication_classes'.
Happy
code class FoobarViewSet(GenericViewSet, mixins.ListModelMixin, mixins.RetrieveModelMixin): permission_classes = (FooPermissionClass,)
Happy
Anonymous
How can I include csrf_token in POST method with ajax in django
Mirco
'X-CSRF-TOKEN' cookie
Mirco
cookie name should be csrftoken
Anders (izzno / gooood) 🇳🇴
What do you guys use for autoresizing of images via urls? Like mydjangosite.com/img/myimage.jpg?size=800x600 or simuler
Mirco