inchidi
okay, so according to serializer class, the json sent should provide all fields of Order model
inchidi
since thats not what you want, and what you want is user post data then your backed automatically define that the data owned by that user.
inchidi
then you should not set fields = '__all__'. instead, exclude = ('user',)
Anonymous
then you should not set fields = '__all__'. instead, exclude = ('user',)
oh, i didn't attention to this, thank you very much if i want to handle AnonymousUser what should i do? i need to handle this issue in perform_create function?
inchidi
oh, i didn't attention to this, thank you very much if i want to handle AnonymousUser what should i do? i need to handle this issue in perform_create function?
you can't, AnonymousUser actually not a user its just interface of User. it doesnt stored at database, doesnt have id
inchidi
so technically with AnonymousUser you cant tell your system to store that data for particular user
inchidi
you have 2 choice, set that api endpoint permission to authenticated only, or allow user null=True
Anonymous
so this sites that have something to save your foods till to login and add to your basket, they are just save data in your cookie or something like that ?
inchidi
more about drf permissions
Anonymous
can you give me an example?
something like add to cart in amazon
inchidi
yes, shopping cart usually stored at client side/browser
inchidi
but one thing for sure, if you are not authenticated in any way, you wont see any cart history or if you leave the page and back later it will gone
inchidi
yeah i split the messages to affirm that thats all done at client side
Mounikesh
Mounikesh
https://docs.djangoproject.com/en/2.0/topics/http/sessions/
Mounikesh
and it also supports anonymous sessions
Anonymous
what is best solution for user login? token? user pass and session?
Mounikesh
what is best solution for user login? token? user pass and session?
for restframework drf jwt works absolutely fine
Mounikesh
what is best solution for user login? token? user pass and session?
for sessions you can in built django sessions
Mounikesh
Anonymous
for user login token and all
what about this? django-rest-auth did you use it before?
Mounikesh
what about this? django-rest-auth did you use it before?
I haven't but do they support tokenization for rest framework
Mounikesh
what about this? django-rest-auth did you use it before?
if not for rest framework ill suggest you to go for django all auth
Mounikesh
https://djangopackages.org/packages/p/django-rest-framework-jwt/
Mounikesh
https://djangopackages.org/packages/p/django-rest-auth/
Mounikesh
now you can decide which to prefer
Mounikesh
and django auth doesnt support python
Mounikesh
3
Mounikesh
*rest-auth
Anonymous
*rest-auth
thank you
Combot
Mounikesh's reputation has been increased! Current reputation: 1
Anonymous
Hi, using get_initial in a createview to add dynamic values to a form field of select options that it is added by me as an attribute, meaning it doesn't come from a model's field, is not working. I can add the values in the modelform but in createview's method get_initial not? How it is understandable my question
Anonymous
https://github.com/vikash212000yadav/musica
Django Bot
>> Links - Nginx: Setting Up a Simple Proxy Server Using Docker and Python/Django... |
Django Bot
>> Blogs - Configurer les représentations textuelles qui seront utilisées dans les Cho
Django Bot
>> Links - Docker Guide: Dockerizing Python Django Application
Anonymous
hi guys i need a fornt end help
Anonymous
do you have any telegram group ??
Anonymous
if you have please send me it link i wiil thnak you
Django Bot
>> Links - How to use Django, PostgreSQL, and Docker - William S. Vincent - django - Development and production with docker with multiple sites - Stack
Slow
hi
Slow
i need help, problem with timezone
Slow
_______ERROR______ /env/lib/python3.5/site-packages/django/db/models/fields/__init__.py:1447: RuntimeWarning: DateTimeField Order.created received a naive datetime (2018-06-29 13:11:01.720527) while time zone support is active. _______________________ __________models.py________ class Order(models.Model): created = models.DateTimeField(auto_now_add=True, auto_now=False, verbose_name="create date", null=True) updated = models.DateTimeField(auto_now_add=False, auto_now=True, verbose_name="Update date", null=True) _________________________________ appears at authorization and authorization does not pass Django 1.11 mysql server 5.7.23
Slow
how do it?
inchidi
how do it?
https://stackoverflow.com/a/7065242
Django Bot
>> Links - A Production-ready Dockerfile for Your Python/Django App | Caktus Group
Slow
https://stackoverflow.com/a/7065242
this problem only in one app, other 6 apps normal, i have error in context_processor. I get objects with datetime.
8 € ∆ $ "|"
guys can i ask a question
Mounikesh
guys can i ask a question
you can ask brother
Daniel
did anyone implement login with telegram for Django?
Daniel
I'm looking for some tut's
Daniel
but couldn't find something useful on Google
Anonymous
Using telegram passport?
Mr.13
Using telegram passport?
Don't use that for now its leaking user ip address
Mr.13
for more read issues on tdesktop github
Anonymous
pythonanywhere
Very good to use this.
8 € ∆ $ "|"
Desmond
Can anyone tell me where I can find the Django template cheat sheet or ebook
Desmond
In which I can find all the methods / functions for dynamic functionality
Anonymous
Hello, I'm having a problem with an NGINX + Gunicorn + Django + PostgreSQL + Docker. I upload a file with the Django admin and I'm getting a 404 in NGINX.
Anonymous
Apparently my NGINX configuration is wrong, I don't know how to solve this problem.
Anonymous
https://www.reddit.com/r/django/comments/92sc0g/getting_404_not_found_on_nginx_when_uploading_a/?utm_source=reddit-android
Anonymous
This a full description of the problem.
Anonymous
I'm willing to pay any Django developer who can help me solve this issue.
Anonymous
How do you access the file?
Anonymous
Via django admin panel?
Anonymous
I try to access it via Django Admin Panel but I get the 404, if I try to access it via frontend I still get the 404.
Anonymous
This is confusing to me since my CSS, images and other static content is being served.
Anonymous
Another thing I've noticed is that if I use docker-compose down then up and try to find with find / -name "Filename.pdf" it no longer finds it.