Steve
Please I need help with multiple documents upload using Django forms, please I need the maximum number of alternatives because I tried a lot !
Vadim
Hello everyone Suggest best practices for serving nested models using the REST API. What applications or approaches do you use? Like this https://github.com/silverlogic/djangorestframework-expander
Vadim
What's the issue
It is necessary to reduce the number of returned data. Having one API endpoint, return nested data in the first case. in the second, no (for example)
Poppu
How should I hit this view.index function every time when this path is appear or any path inside the admin panel path('admin/users/firebaseusers/', views.index), path('admin/', admin.site.urls), If I placed like this then it's show the error because there is no return Or I placed it's below the admin then it's function are never called
Hadi
should i create a python file for every single page of my website or its better to keep all of pages in views.py?
Jay
Hello, what is the best way to implement a login with OTP instead of a password? I went through django-otp but I think that would not serve my case.
kasim
Malyali poli alle
Anshu
Hello, what is the best way to implement a login with OTP instead of a password? I went through django-otp but I think that would not serve my case.
Well u can use OTP with simple login, that is authenticate user as we do and then simply also check for the OTP
mAXY
Hey .. how do i create password reset in jwt authentication ??
chaygo
Hello guys! I cant change default language! I set Language_code="tr" but it doesnt change from en-us
Олександр
My opinion create 2 files. views.py and views_api.py
I always create api folder and inside I create views, urls, etc.
НОДИР
Hello everyone, what is an example of an External service?
НОДИР
Thanks for the reply
НОДИР
Were did you get this term?
I had such a question! that is why !!
ЯR
Guys, help plz! How to do this without Django ORM? Just with native Python. Thx! Write a function named user_generator that takes a login as argument, and stores this login at the end of the file named logins.db. The file logins.db will always be well formatted with one login per line, but it may not exist initially (so be sure to handle that case). If the login already exists in the database, you will add the suffix 1. If the login exists with that suffix, you will try with 2, then 3, etc-until you find a valid login. The list of logins doesn't follow any specific order so don't order them. You must simply add the new login at the end of the file.
Genemator
or just write your own orm)
K
Can anyone please tell me how can I call java rest API in Django?
ЯR
so what is exactly the problem here?
I don't even know what the code for this function should look like. I am friends with Python, but not with SQL…
Sanjarbek
#error https://dpaste.org/raM9 #help
Alex
I don't even know what the code for this function should look like. I am friends with Python, but not with SQL…
I don't think it's about sql. It's about your own db. Smt like unix dbm https://docs.python.org/3/library/dbm.html
Alex
Nope
No atomictiy? Man, that's boring.
ЯR
I don't think it's about sql. It's about your own db. Smt like unix dbm https://docs.python.org/3/library/dbm.html
most likely you are right. But I don't know how to work with this either. I'll read the resource that you threw off. Thanks
ЯR
No atomictiy? Man, that's boring.
Its just task for education. not for work
Alex
most likely you are right. But I don't know how to work with this either. I'll read the resource that you threw off. Thanks
There is nothing interesting I can say about. From the description it seems that the file should be human readable. So you can simply define it as plain text and each time read it line by line and do your stuff.
Alex
Yes, but it must be with .db format
extension or format? Because I've never heard about the later.
John
#filters.py class SurveyFilter(django_filters.FilterSet): Search = django_filters.CharFilter(method='full_search',label="Search") Status = django_filters.ChoiceFilter(method='Status_filter',choices=USER_STATUS,label="Status") class Meta: model = Survey fields = ('Search',) def full_search(self, queryset, name, value): user=self.request.user return queryset.filter( Q(SurveyUser__email__icontains=user) ) Hey guys I'm getting an error when trying to get the current logged in user in filters.py how do I get it please anyone help
ЯR
There is nothing interesting I can say about. From the description it seems that the file should be human readable. So you can simply define it as plain text and each time read it line by line and do your stuff.
I think you're right. The file must be readable. And I create it in text extension and then rename it to db extension, then it will just stay readable. Thank you very much for the idea!
Poppu
Maybe error is in your index function
No it's expected return or we can say any HTML response
Poppu
But the function which I want to call it's just features or background service which I want to it's refreshing every time when I load any page in django admin
Poppu
I simple I created a django models where I fetch the data from external api so I want to run functions continually in background
🥰🥰
Anyone can share how to create api with post
Doragonsureiyā
Anyone can share how to create api with post
Are you looking for Django REST Framework documentation? Here you have it: https://www.django-rest-framework.org/
Anonymous
Anyone can share how to create api with post
class PostCreate(generics.CreateAPIView): model = Post serializer_class = MyPostSerializer queryset = Post.objects.all()
Alex
Hi everyone, I stuck with problem in template addclass - filter, which addclass but only HTML-tags, index.html: …. {%load addclass%} {% for post in posts %} <h3> Author: {{ post.author.get_full_name | addclass }} # here How overrride variable in this string on HTML-tag example span? </h3> <p>{{ post.text|linebreaksbr }}</p> {% if not forloop.last %}<hr>{% endif %} {% endfor %}
Suhaib_0.0
It shows me. 'User' object has no atrribute 'customer' But I've deleted. 'User' from Model Please answer me
chaygo
Firstly create venv then django-admin startproject name .
James
Hi. Anyone who can help me how to create and manage user groups and permissions in my custom admin dashboard?
𝔄𝔷𝔞𝔪𝔞𝔱 ℑ𝔨𝔯𝔬𝔪𝔬𝔳
Hi can you help me
𝔄𝔷𝔞𝔪𝔞𝔱 ℑ𝔨𝔯𝔬𝔪𝔬𝔳
I cannot manage urls multiple app in one project
𝔄𝔷𝔞𝔪𝔞𝔱 ℑ𝔨𝔯𝔬𝔪𝔬𝔳
I'll send codes
𝔄𝔷𝔞𝔪𝔞𝔱 ℑ𝔨𝔯𝔬𝔪𝔬𝔳
Can check it out
𝔄𝔷𝔞𝔪𝔞𝔱 ℑ𝔨𝔯𝔬𝔪𝔬𝔳
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include("reviews.urls")), path('profiles/',include("profiles.urls")), ]
𝔄𝔷𝔞𝔪𝔞𝔱 ℑ𝔨𝔯𝔬𝔪𝔬𝔳
it shows this page isnt working
Sanjarbek
#help #error https://dpaste.org/7V5x
Raymond
I want To Learn Django
Raymond
So Pls Suggest Me Any Best Tutorial
Asman
I also
Nastya
So Pls Suggest Me Any Best Tutorial
! Res if you really new in this - you can try for start this guide, but only for start https://tutorial.djangogirls.org/en/
Asman
You can join this channel
Fabian
hi devs, do you think 6 second script to load a 4000 rows CSV to the database is slow?
丂Ƥ𝖄๖ۣۜ.
How do I provide youtube video for download on my webapp yt.download(os.path."/Downloads") this works on localhost but when hosted video is not getting downloaded
Aman Jain
Anyone know how seeder work ?? What's kind of logic create for seeder
| Programmer |
i searched about downsides of session authentication for api and one of the result was: There are several downsides however. First, a session ID is only valid within the browser where log in was performed; it will not work across multiple domains. This is an obvious problem when an API needs to support multiple front-ends such as a website and a mobile app. but why it cant across multiple domains?
Alex
1 That's unrelated to this group 2 DjangoCRM - not even a single line of tests. More like a student's homework, than a project. Djangoiptvchannel - a few lines of tests and... side packages included in the project's source O_o
Alex
That's strange. If it's rest then it's how you (and anyone else) should use it - by calling via endpoints. Otherwise you should decouple the functionality into separate layers of logic - smth like this https://en.wikipedia.org/wiki/Multitier_architecture Oh, there is also one way - just import the views and call them as regular functions. Say for CBV: myview = MyCBV.as_view() some_request = Request() myview(some_request) But I consider this bad practice. Unless it's in your unittests.
Chandra
How to do aunthentication with Django rest api
Alex
How to do aunthentication with Django rest api
https://www.django-rest-framework.org/api-guide/authentication/
Nayan
Can we use filesystem storage in production ?
Nayan
I am using specific path to store file outside django project using filesystemstorage
Nayan
But the files are getting saved in outside django project as well as in django project , i got confused in this
丂Ƥ𝖄๖ۣۜ.
I am using specific path to store file outside django project using filesystemstorage
On localhost it may work but when hosted no web app can download any file in any users storage this may be very dangerous so for local server you can use os.path'whereever you want to save path'