5P34R
I want authentication with phone number
create a custom user model and manager
ravi
How to make. I don't have any idea
ravi
Please..
ravi
I am trying many time
ravi
But I couldn't success
5P34R
it is same as django
5P34R
Dm
VISHNU
From ip address can be able to fetch timezone in django
Азизмурод
Hello! I just using vue and with axios going to get data from django, but it gives CORS error, how i can fix it? My settings.py file: ALLOWED_HOSTS = ['*'] CORS_ORIGIN_ALLOW_ALL = True CORS_ALLOW_CREDENTIALS = False # Application definition INSTALLED_APPS = [ ...... 'rest_framework', 'corsheaders' ] MIDDLEWARE = [ ..... 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware' ...... ]
Азизмурод
please help me
Ras
why i can not use django-jet with django 3? cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
Mirco
OK, but it's not working
If you don't share code it's hard to help u
Азизмурод
I use restfull framework
Mirco
I use restfull framework
Use pastebin.org please
Азизмурод
Use pastebin.org please
sorry, https://pastebin.com/9qBYwfRQ
Азизмурод
https://pastebin.com/iFvbNnKx Vue code
Mirco
sorry, https://pastebin.com/9qBYwfRQ
You need to put the Middleware as high as possible Especially before the CommonMiddleware Otherwise it won't work
Its me pistaboy
I need your help brothers
Its me pistaboy
I created HTML file and models and forms everything. but when i putting the data that time not showing data in admin page
Its me pistaboy
Please help me my dear brother
Its me pistaboy
Yeah registered
Kenechi
Please how do I use Django template tags in a JavaScript innerhtml
Mirco
Please how do I use Django template tags in a JavaScript innerhtml
don't do it define what u need from template tag as JS variable into the script tag inside the template and then into JS you can use those variables
Kenechi
Because what I need from a template tag is to call a property from models.
Ash
Yeah registered
kindly share it
Mirco
I don't understand sir
inside your template <script> let var_from_context = {{ your_var }}; </script> <script src="your-js-file"/> inside your js file you can access to variable var_from_context it's just an example, it can be done better obvs, but it should give u an hint
Mirco
it doesn't work at all
Which error do you receive ? Specifically
Азизмурод
Which error do you receive ? Specifically
https://pastebin.com/PUPR6se0 My MIDDLEWARE
Азизмурод
Access to XMLHttpRequest at 'http://127.0.0.1:8000/posts' from origin 'http://localhost:8081' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Mirco
https://pastebin.com/PUPR6se0 My MIDDLEWARE
Put the CORS Middleware as the first item It's still under the Common one , that's why it doesn't work
Азизмурод
it gives error when do this
django.core.exceptions.ImproperlyConfigured: WSGI application 'blog.wsgi.application' could not be loaded; Error importing module.
Mirco
it gives error when do this
Put it just above the CommonMiddleware
Азизмурод
Put it just above the CommonMiddleware
thank you very much, I just forgot add , at end ), sorry
Азизмурод
Mirco
yes
100$ please 😎
Азизмурод
100$ please 😎
😅 send cart number)
Mirco
Jokes apart, read the documentation Inside the README is specified where to put the Middleware to make it working It must be before the ones that returns the response, because the CORS one has to add the headers
Manjunaath
I am new to django
Manjunaath
I want to learn it so from where can I start
Doragonsureiyā
I want to learn it so from where can I start
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Manjunaath
Thx
Doragonsureiyā
Okay, thank you again
You're welcome! 😊
Anonymous
https://cdn.discordapp.com/attachments/696432394974265374/872819501668904970/unknown.png
Anonymous
i want to show the recent chats in left section of chats i use Django channels for chating but while chating in one group the new messages from other groups are not coming in left section as a recent chats of chat please can you tell me what to do
Anonymous
See the images for refer
.
i want to show the recent chats in left section of chats i use Django channels for chating but while chating in one group the new messages from other groups are not coming in left section as a recent chats of chat please can you tell me what to do
Hey ,I need your help ,I am making same kind of application.I want to make a feature like whosever created a group in the chat application should automatically be assigned as admin of the group,how to achieve this? Please help
Doragonsureiyā
🚫 ‎Tguser [1203958253] is already banned.
d3vsh3d
Hello folks! Can someone help a better approach to use UUID as a primary keys in my models?
d3vsh3d
the better approach is using UUID instead of integer PKs
Sure, but I mean the implementation side
Mirco
Sure, but I mean the implementation side
just create the UUID field and set the arg primary_key=True and Django will use it https://tech.serhatteker.com/post/2020-01/uuid-primary-key/
Doragonsureiyā
Thanks. I am going through it
You're welcome! 😊
Alikhanov Jakhongir
Hi, I am having following error, after I integrated Firebase with my DRF project using python pyfcm library. AttributeError: type object 'Retry' has no attribute 'DEFAULT_ALLOWED_METHODS'
Alikhanov Jakhongir
Has anyone ever found any solution for this type of error?
Bernard
Hi I'm new in Django , please I hope to get help from you to grow.
.
Is you slove my problem in your project
No actually,are you implement ing tha admin for a group on your project
.
u got access to user via request (request.user) just pass it where it's supposed to be
Thanks for responding,Can you please explain how to make that user admin of a group in chat application...:(
(o_O)
Is it possible to create queryset from object, like obj.objects.filter(pk=obj.pk) but without issuing the query?
Saurabh
var=Car.objects.filter(id=id) print(len(var)) Error:- the JSON object must be str, bytes, or bytearray, not dict.
Saurabh
I don't know where is problem. Please help.
Saurabh
If I am checking data type it is django.db.models.Queryset
Mirco
var=Car.objects.filter(id=id) print(len(var)) Error:- the JSON object must be str, bytes, or bytearray, not dict.
I don't think that's the code that generates the error, please provide the rest of the code