Aditya
Hello guys, I need small help, I created an application in django, and in front end part I have taken bootstrap. Instead of bootstrap, I want to use react. Can someone please refer something.
Aditya
I googled for this but I didn't get exact ans.
Mirco
Write APIs with Django and call them via React
Mirco
Do whatever you want with the React part
Aditya
Means first nead to use DRF framework
Mirco
Yup
Aditya
Yup
🙏 Thanks
Opeyemi
Did you also try that "custom_exception_handler" ?
it was the same message i got in the post when i tried the custom_exception_handler
Aditya
Do whatever you want with the React part
If I'm not wrong DRF and react need to take diffy directory
Mirco
If I'm not wrong DRF and react need to take diffy directory
Yeah, it's a best practice to have some frontend and backend folders
Aditya
Okay
Mirco
Okay
Create react app into frontend folder
Sheshadri
it was the same message i got in the post when i tried the custom_exception_handler
instead of "return response" you can use one of the https://docs.djangoproject.com/en/3.0/ref/request-response/#httpresponse-subclasses , like ex: return HttpResponseRedirect("my-custom-url") in which you can set a template saying Link Expired.
webster
Hi guys, I've a question that will django-restframework-jwt authentication work fine with django 2.2?
webster
Or if not how can I change jwt authentication to jwt-simple authentication
J
Hi guys, I need small help, to create query, For following scenario class Publication(models.Model): title = models.CharField(max_length=30) class Article(models.Model): headline = models.CharField(max_length=100) publications = models.ManyToManyField(Publication) i am on Article model admin page - i want to filter publications which is not assigned to any Article, for new object - and for created Article i want to filter assigned publications to specific Article and Publications which is not assigned to any Article can anyone help
Walter White
Is it necessary to make a serializer file while making a rest API
Walter White
yes
But i was using django-rest-auth and i used it directly in the urls.py file of the project....and Its working
Aito
What is the best hosting / virtual server for django, php projects?
Walter White
Means whenever i am going in the login or logout page in the localhost... it's showing
Walter White
that package already include a serializer for the user
So if i want this api for resetting password, i won't need to do anything in the app?
Mirco
https://github.com/Tivix/django-rest-auth/blob/master/rest_auth/serializers.py
Walter White
Ok sure
Opeyemi
https://github.com/Tivix/django-rest-auth/blob/master/rest_auth/serializers.py
apparently django rest auth has been depreciated use dj-rest-auth instead
Opeyemi
apparently django rest auth has been depreciated use dj-rest-auth instead
it almost the same thing and its getting maintained
Opeyemi
https://github.com/jazzband/dj-rest-auth/
Mirco
as u prefer
Akash
I am making a django app for telegram bots: Any improvement suggestion in this model class Person(models.Model): id = models.IntegerField(primary_key=True) first_name = models.CharField(max_length=254) username = models.CharField(null=True, blank=True, max_length=254) class BotUser(models.Model): id = models.UUIDField(primary_key=True) bot = models.ForeignKey(Bot, related_name='members', on_delete=models.PROTECT) person = models.ForeignKey(Person, related_name='bots', on_delete=models.PROTECT) Or it it better to completely remove Person model and store person names everytime in BotUser itself.
Roman
Hi guys, how to allow see view just is_authenticated user?
Roman
Or I should write custom middleware ?
Anonymous
getting csrf_token error. I have already token in my html file. but still getting error
Onur
Hello, Anyone has used rest-knox? Is it useful and less problematic to apply as authentication? Any suggestions would be appreciated.
Onur
Says djoser is only supported up to Django 1.9
Mirco
Absolutely not
Mirco
Django 1.11 / 2.2
Onur
Ah okay, i was looking older versions of djoser
Mirco
😊😊
Onur
How about the security since rest-knox provides one token per call instead of per user and expiry configuration for tokens(like 10 hours). Also it is written as tokens will be encrypted in knox docs. Do you think djoser is well secured as knox.
Onur
Thank you Mirco
Mirco
!yw
Doragonsureiyā
You're welcome! 😊
Sweetie
What's a good bootstrap admin template I can use with django app, that is pure html css and js. I don't want to add additional dependencies like npm scss etc. I tried AdminLTE, it's requirements says to run some npm commands but it's working fine without it not sure if I should use it or it will result in problems during production
Anonymous
faceing "maximum recursion depth exceeded in comparison" error
Anonymous
how to solve it
Mirco
faceing "maximum recursion depth exceeded in comparison" error
You are calling the same method/function inside that method/function
Sourav
Can any one tell in django rest framework, under serializer we use class Meta: depth=1 and max we can go up to 10...but how to traverse depth beyond 10
L
Hey everyone, doing my first Django deployment on my own today
L
Any tips? Where to start? (for the momment imma rely on good old youtube)
L
Thankssssss
Aman
Why success message show after page refresh
Baba
How to start django...help me. .
Doragonsureiyā
How to start django...help me. .
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Akbar
Views.py: from .forms import UserOurRegistration def register(request): if request.method == 'POST': form = UserOurRegistration(request.POST) if form.is_valid(): form.save() username = form.cleaned_data.get('username') messages.success(request, f'Пользователь {username} был успешно создан, введите имяпользователя и пароль для авторизации:') return redirect('user') else: form = UserOurRegistration() return render(request, 'users/registration.html', {'form': form, 'title':'Registration'})
Akbar
Forms.py: from django.contrib.auth.forms import UserCreationForm class UserOurRegistration(UserCreationForm): email = forms.EmailField(required=True) class Meta: model = User fields = ['username', 'password1', 'password2', 'email']
Akbar
save() got an unexpected keyword argument 'force_insert'
Akbar
Anonymous
Did anyone used postgres with django
Anonymous
??
Anonymous
Hi everyone
Anonymous
I must write custom 404 and 500 pages
Anonymous
Can anyone gives some help?
Anonymous
I have a not empty 404 page defined but django dispay a blank html page
Cristian
Are you working on debug ?
Anonymous
Cristian No, for production I want
Anonymous
just create 404.html and 500.html and have it in your templates folder
Anonymous
I use heroku to deploy and is best to have custom 404 page
Anonymous
django will automatically choose it
Anonymous
@heinekhalwin I already have