Jimmies San
How to generate token for custom user
https://simpleisbetterthancomplex.com/tutorial/2018/11/22/how-to-implement-token-authentication-using-django-rest-framework.html
Anonymous
👍
Cesar
Can I change this default behaviour ?
Uhm default behavior of humanize is not to change values without filter
H
I want the user to only access a view a certain number of times. How to do that in django??
H
Any suggestions
Вадим
Uhm default behavior of humanize is not to change values without filter
It seems right and straight forward, but in my case it works opposite.
Cesar
I want the user to only access a view a certain number of times. How to do that in django??
Make a new table/model: User View Count On each access get_or_create(...) Then an if . in the else add 1 to count and save 🤷🏽‍♂
Cesar
i would do something like this
Anonymous
Hi all. I try configure nginx proxy to django with custom path location like https://balbal.com/rc-env/. The django have only admin page. in settings.py I set USE_X_FORWARDED_HOST = True FORCE_SCRIPT_NAME = os.environ.get('DJANGO_FORCE_SCRIPT_NAME', '/rc-env/') # without trailing slash LOGIN_REDIRECT_URL = FORCE_SCRIPT_NAME + "admin/login/" LOGIN_URL = FORCE_SCRIPT_NAME + "admin/login/" STATIC_URL = FORCE_SCRIPT_NAME + 'static/' I saw login form, but css styles not found. Can anyone help me?
Cesar
did you ran collectstatic?
Anonymous
did you ran collectstatic?
Thank I'll try
Anonymous
can anyone help me with django server
Anonymous
the server generated by django https://127.0.0.0.8000 is not opening in chrome
Anonymous
i am done with setting up local host but it doesn't helped me
Kawin
https://127.0.0.1:8000/
Anonymous
Hii everyone...i am applying python manage.py makemigrations blog , blog is name for db and app , problem is
Anonymous
It is not executing
Anonymous
it's showing same thing again and again This site can't be reached 127.0.0.1 is refused to connect
Anonymous
Its showing import error...cannot import name url from django.urls
Anonymous
can someone help
Anonymous
ImportError: cannot import name 'url' from 'django.urls'
Anonymous
i tried method at https://stackoverflow.com/questions/47703923/how-to-solve-this-importerror-cannot-import-name-url-in-django-2-0/47704439
Anonymous
it didnt worked
Kawin
You should import path from django.urls and not url
$iductive
Either try from django.conf.urls import url
$iductive
Or from django.urls import path
Anonymous
Either try from django.conf.urls import url
this worked..thanks to both of u guys
Anonymous
Did you run the command.. python manage.py runserver?
yaa after doing then only it's giving me server 127.0.0.0.8000
Kawin
Can u pm me the screenshot?
Anonymous
Hi guys please i need help in hostn=ing my django project online.
Kawin
Hi guys please i need help in hostn=ing my django project online.
pythonanywhere.com is great hosting site for Django
Вадим
Uhm default behavior of humanize is not to change values without filter
seems that USE_THOUSAND_SEPARATOR=True caused the problem
Вадим
Django starts to convert all numeric vars to locale representation. Even ids, pks !
Anonymous
i think heroku is pretty good for django hosting
Вадим
what's the difference ?
Kawin
i think heroku is pretty good for django hosting
But.. pythonanywhere is easier to setup for beginners
Anonymous
Hello, could someone indicate me to a Django + Ajax tutorial? I am studying both separately, but I am looking for a tutorial of both together to practice. If possible one for newbie...
AJ
Use intercoolerJS with Django for easy Ajax integration
Omar
Hello... I have a question about Django Rest Framework. Is there any way to get the serializer writing fields programatically? I am trying to generate a JSON with all the writing fields and it validations. But I don't know how to access the list of fields attribute.
Omar
When I try Serializer.fields the attribute is a string or a Tuple
Leonardo
guys, where do you put your business logic at DRF?
Jovani Martín
Hello everyone, I'm jovani and I a new Django user, is there any who uses social login to help me with some questions?
Leonardo
In the View
but do you create a service file and import in the view?
Anonymous
Use intercoolerJS with Django for easy Ajax integration
I will read about this intercoolerJS ... thanks.
Omar
but do you create a service file and import in the view?
Each View class process a different part of your business logic. If each process is too complex I create a Utils file(or folder) with some utilitarian classes to use in the View... But in the end the processing of the request is what I understand as a business logic. Did you mean something else?
Leonardo
thats ok, right?
Nikhil
Can I use react for frontend and django for back end
Philip
Hi guys, such a question, how can I send this date to serializers after entering the date from the html field of type datetime-local, I encountered this problem after submitting the form, all fields except the date are sent and I get a 400 error and drf suggests me fill out the field with date
Philip
I even tried to create a model and take a date field from it, after I inserted it as an object of type Date javascript and passed this ajax object, but still got the same
Philip
DRF? or plain DJ?
Thank you, but after I wrote here I immediately fixed it) 2 days I could not understand what was wrong, in the end now I fixed everything
Philip
With dateformat?
yes)) I got this date through the date object (13-01-2020), but it was necessary (01.13.2020)
Anonymous
How do you fix indentation error in sublime please google is not bringing up solution
Bjorn
How do you fix indentation error in sublime please google is not bringing up solution
Yeah .. it's kinda annoying.. Just open the file in pycharm or atom And it'll give an option to configure lines accordingly... You could also use idle or vim . Sublime has a problem with displaying the correct indents.
Anonymous
Pros solved just have to edit the preferences
Gedion
0⁰0
professor
https://stackoverflow.com/questions/59727930/how-can-to-use-custom-admin-across-applications-in-django
JZA
I never got the mixins
swagBit
Hi all, how to generate receipt form in Django?
Anonymous
Hey all! How can one send data from ESP32 to a Django web server? Pls help!
JZA
how are you going about it?
JZA
rest?
JZA
you can try to post data via XML-RPC, or HTTP Data array, or through JSON using a REST protocol.
JZA
you can use Requests to do the push of data.
JZA
https://www.geeksforgeeks.org/get-post-requests-using-python/
JZA
but you need to define exactly what you need...