Arman
yes
So than after first login the server should send you 2 values 1. Accesstoken and 2.Refreshtoken and they both stored in local storage, during short period of session(more likely day) you can access the server resources via accesstoken, if day passes than u have to send request to the server with refreshtoken and ask for new accesstoken
Kamronbek
yeap, but how can I implement in code. how can I handle user? should I add token to each request and then authenticate with that?
I mean I should add token to request from react and handle and authenticate relying to token which is inside the request. sorry for my typing 😁. english is my second language.
Arman
yeap, but how can I implement in code. how can I handle user? should I add token to each request and then authenticate with that?
Yes, as I said in short period of time you have to send accesstoken with every request, than as soon as that time over u have to ask for new accesstoken via sending request with refreshtoken
khaled
Hello How can I achieve modulization in drf
Arman
Hello How can I achieve modulization in drf
Im trying to structure as ddd says, but Recently I find some valuable alternative resource too, just make Google search "djang api domain"
Human
Hai can someone suggest me best YouTube videos to learn Django Class based views?
Rajan
Anyone made digital wallet with payment integration?
Abhi
Hai can someone suggest me best YouTube videos to learn Django Class based views?
Sometimes you have to read that everything is not available in video
Doragonsureiyā
Anyone made digital wallet with payment integration?
Please don't ask meta questions like: - Any user of $x here? - Anyone used technology $y? - Hello, I need help on $z! Just ask about your problem directly! If you don't know what to ask, please read: http://catb.org/~esr/faqs/smart-questions.html
Human
Yes
Thank you
Human
Using class based views, can we return the customised list of query set? For example I have 2 models, Places and Visits. So I want to display each places and its visitors numbers... Which multiply by 100 Class Places(models.Model): placename = models.Charfiled(max_length=50) Class Visits(models.Model): places = models.Foreinkey(Places, on_delete=models.CASCADE) visits = models.IntegerFiled() When I use Function based I use def test_fun(request): visits = Visits.objects.all() li = [] for i in visits: li.append({"place": i.places.placename, "visits": i.visits*100 }) return render (request, 'template.html', {"data": li}) So how to write this in Class based view Sorry even I don't know is it the proper way in function based
Ibnu
So I heard htmx goes well with Django, should I invest time in it..
Ibnu
I mean, it goes well.. the market and so on.. I was planning on vue
Aditya
Google auth login, easy library code in django
Crispus
What are the uses of django
Abhishek
What are the uses of django
Django is a high-level Python web framework that enables rapid development of secure and maintainable websites. Built by experienced developers, Django takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel.
Nerd
hello @all, what are your experiences with django migration issues working in a team committing to one branch from multiple branches 😊
Nerd
No am asking how your experience is like working in a team and facing django migration issues
Al
Working with django, what to do to prepare for job and how are the questions please someone, please help me
Doragonsureiyā
Working with django, what to do to prepare for job and how are the questions please someone, please help me
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so move to @PythonOfftopic group and ask there.
A
How to render hr tag in Jinja?
Pouya
Hello, I've encountered an issue. I want to have a search page and control the number of displayed items with paginate_by. However, when I perform a search and go to the next page, it shows me all the data available in my database. python from .models import SearchOnMap from django.shortcuts import render from .mapTiles import search_on_map from django.views.generic import ListView from django.core.paginator import Paginator from django.views import View class SearchView(ListView): paginate_by = 4 template_name = 'search-page.html' model = SearchOnMap def post(self, request): search_query = request.POST.get('search_query') if search_query: if SearchOnMap.objects.filter(serch_label=search_query).exists(): searches = SearchOnMap.objects.filter(serch_label=search_query) paginator = Paginator(searches, 4) page_number = request.GET.get('page') page_obj = paginator.get_page(page_number) return render(request, self.template_name, {'page_obj': page_obj}) else: data = search_on_map(search_query) for i in range(len(data)): SearchOnMap.objects.create(name=data[i][0], rating=data[i][1], address=data[i][2], longitude=data[i][3], latitude=data[i][4], phonenumber=data[i][5], link=data[i][6], serch_label=search_query) searches = SearchOnMap.objects.filter(serch_label=search_query) else: searches = SearchOnMap.objects.none() paginator = Paginator(searches, 4) page_number = request.GET.get('page') page_obj = paginator.get_page(page_number) return render(request, self.template_name, {'page_obj': page_obj})
Joe
Hello, I hope this isn't considered off-topic, but I'm evaluating Turnkey Linux containers, specifically the Django TKL. Have you had any experience with it ? I haven't been able to find much information on it, any comments will be appreciated !
Doragonsureiyā
Hello, I've encountered an issue. I want to have a search page and control the number of displayed items with paginate_by. However, when I perform a search and go to the next page, it shows me all the data available in my database. python from .models import SearchOnMap from django.shortcuts import render from .mapTiles import search_on_map from django.views.generic import ListView from django.core.paginator import Paginator from django.views import View class SearchView(ListView): paginate_by = 4 template_name = 'search-page.html' model = SearchOnMap def post(self, request): search_query = request.POST.get('search_query') if search_query: if SearchOnMap.objects.filter(serch_label=search_query).exists(): searches = SearchOnMap.objects.filter(serch_label=search_query) paginator = Paginator(searches, 4) page_number = request.GET.get('page') page_obj = paginator.get_page(page_number) return render(request, self.template_name, {'page_obj': page_obj}) else: data = search_on_map(search_query) for i in range(len(data)): SearchOnMap.objects.create(name=data[i][0], rating=data[i][1], address=data[i][2], longitude=data[i][3], latitude=data[i][4], phonenumber=data[i][5], link=data[i][6], serch_label=search_query) searches = SearchOnMap.objects.filter(serch_label=search_query) else: searches = SearchOnMap.objects.none() paginator = Paginator(searches, 4) page_number = request.GET.get('page') page_obj = paginator.get_page(page_number) return render(request, self.template_name, {'page_obj': page_obj})
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://hastebin.com - https://nekobin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
KartiK
https://nekobin.com/pofuzozune
KartiK
circular dependencies is coming but i have already resolved it through related_name='+' but still unable to add values from admin site directly
Alex
https://nekobin.com/pofuzozune
You need only one foreign key
Alex
Remove it from collection
KartiK
You need only one foreign key
https://dpaste.org/ncFmO check my code pls i have applied two foreign key for 2 different task
Alex
No
Alex
Foreign key creates connection in both ways
Alex
If you set up it in products, then every product will know about collection, and collection will know about ALL products assigned to it
KartiK
so what should i remove from my the code
KartiK
i read that it gets resolved through '+' operators in related names also so idk why its not working
Oviyan S
Can anyone help me with an error that I have encountered? I have created a web app for getting feedback from the students for that I have created two combo boxes in which students can select the batch and year that is stored in the models. When a student selects a batch it shows the question in the answer. subject code /subject name then excellent, very good, average, below average. When the user selects the response it will be stored in the models. Subject name and code appropriate to batch and department. *Error* If I choose the batch and department it doesn't load the subject code and subject name. I was unable to store the response
Alex
Just remove key from collection
Alex
And read about one to many, one to one, many to many relationship
Joe
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so move to @PythonOfftopic group and ask there.
Thanks for your reply, it isn´t my intention to make the post magically Django Related, I'm willing to deploy Django Apps the easiest way, therefor I'm evaluating the Django TKL. Perhaps the most straight forward question should be, can you point out any good documentation related to secure and efficient django app deployment ?
Nazda
How to create a website ?
Doragonsureiyā
How to create a website ?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Sarvaiya
is good to learn reactjs with django?
Charly
is good to learn reactjs with django?
It is up to you for django is toally irelevant whatdo you use for the frontend
Charly
And all the libraries work exactly the same from, the backend perspective
OYEDIRAN
Hi Guys I'm new to this Telegram group but not to Django. I kinda need help with a Django project. It's a virtual top up project. I interfaced with Africa's talking API and Paystack but I have an SSL error that I can't get around. Can anyone help?
OYEDIRAN
Hi Guys I'm new to this Telegram group but not to Django. I kinda need help with a Django project. It's a virtual top up project. I interfaced with Africa's talking API and Paystack but I have an SSL error that I can't get around. Can anyone help?
The error says HTTPConnectionPool(host='api.sandbox.africastalking.com', port =443): Max retries exceeded with URL: /version1/airtime/send (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1000)' )))
ke.vin
Anyone who knows to deploy django on render
Doragonsureiyā
Anyone who knows to deploy django on render
Please don't ask meta questions like: - Any user of $x here? - Anyone used technology $y? - Hello, I need help on $z! Just ask about your problem directly! If you don't know what to ask, please read: http://catb.org/~esr/faqs/smart-questions.html
ke.vin
It keeps on telling me module not found
Doragonsureiyā
It keeps on telling me module not found
Impossible to help without details. Read this please: http://www.catb.org/~esr/faqs/smart-questions.html
michael
It keeps on telling me module not found
Yeah that's true... We need details to help... Even a screenshot would do
Levitybot
is good to learn reactjs with django?
Check out HTMX. Basically means you write a lot more python and a lot less javascript. Obviously the right choice depends on your requirements, but HTMX is getting very popular with Django
Zion
Check out HTMX. Basically means you write a lot more python and a lot less javascript. Obviously the right choice depends on your requirements, but HTMX is getting very popular with Django
I been heard about it more and more lately but never try it, there is a quick start repo to raise a Django app with htmx templates?
Hrishi S Vijayan
We're integrating Stripe Checkout for subscription payments and want to allow customers to upgrade or downgrade their plans during checkout. Is there a way to achieve this directly with Stripe Checkout, or should we handle subscription changes separately using the Stripe API?
Junior
everything is ready
greenspectactles
Hi, could someone help me with the easiest method to add Bootstrap/ TailwindCSS to a Django app and Django forms. I can't figure out how to style the Django form because that's a Python file. Just a pointer would be immense. Thankyou so much 🩵
Hrishi S Vijayan
Hello my friend, i use customer portal to manage subscription make cancel, and upgrade / downgrade
No what I meant is that I want to add subscription add-ons dynamically in the stripe payment page itself
greenspectactles
Using CSS classes?
I am super new to this. Is there any website or video I could follow?
greenspectactles
Using CSS classes?
Thank you so much for replying
Dj - 505
If i did django API project using DRF and want a front developer consume my API end points, What is the best way to do that ? How i deploy this API ?
clouded
I am super new to this. Is there any website or video I could follow?
Plethora of information. Start learning CSS, then you will understand CSS frameworks, better. Alternatively, read the documentation of CSS frameworks. Though, that might be more difficult without knowing anything about CSS. Also, there might be add-ons for Django witch simplify or even automate the integration of CSS frameworks with Django.
Y
I create multi user TO DO project now I want deploy this project So my friends can use How can I do
Roy
I create multi user TO DO project now I want deploy this project So my friends can use How can I do
Use any hosting platform to host it . I would suggest pythonAnywhere . It provides free plan and 516mb storage also easy to deploy for beginners
Samandar
Hi everyone Can you recommend the best, easiest and less problematic way of implementing CustomUser in DJango? Up to now, I tried various methods: extending default User, extending AbstractUser, or from very low-level: extending AbstractBaseUser+PermissionsMixin. Initially, I thought the last one is best, but now I'm facing with a problem that when I create a new user from default admin panel, it is not hashing the passwords. Have you ever encountered such a problem?
Dj - 505
You join both project together using the backend folder , Or host separately on heroku .
Someome told me that you can using postman to share your endpoints, how i do that ?
Levitybot
As Django + HTMX + Tailwind + Alpine is quite a popular emerging stack there are some good YouTube videos on it, including how to set it all up. You can put some of those keywords into YouTube then order videos by upload date to get some good results often with linked github repos
𝑴𝑼𝑯𝑨𝑴𝑴𝑬𝑻𝑨𝑳𝑰
What is createview?
Levitybot
Someome told me that you can using postman to share your endpoints, how i do that ?
I'm not aware postman can do that. You typically use postman to test your API endpoints by making calls to them and checking you are getting the expected results. It's a great development tool for quick sanity checks and debugging issues. There are other tools for generating API documentation which might be what your looking for