𝕯aniel
Hi guys How i can send notification email to customer about when he should monthly payment? Celery?
𝕯aniel
I have customer table where i save all information email, phone, balance hosting expired date and so on. And i need send email notifications example "Your hosting expired time 10.05.2021"
𝕯aniel
I need use a django celery yes?
Сергей
Hi, everyone! I'm writing tests for my serializer using pytest and factory boy. I've created a factory for my user class and wrote test: def test_serialized_data(self): # Arrange user = UserFactory.build() valid_serialized_data = { 'id': user.id, 'first_name': user.first_name, 'username': user.username, } # Act serializer = RetrieveUserSerializer(data=valid_serialized_data) # Assert assert serializer.is_valid(raise_exception=True) assert serializer.errors == {} The problem is that is_valid method tries to access database to perform validation. How can I avoid this?
꧁❦ I'm Farooq ❦꧂
Anyone attend aspirant labs company interview...?
Mirco
any suggestions or help!
https://www.django-rest-framework.org/api-guide/throttling/#custom-throttles If you need to strictly identify unique client IP addresses, you'll need to first configure the number of application proxies that the API runs behind by setting the NUM_PROXIES setting. This setting should be an integer of zero or more. If set to non-zero then the client IP will be identified as being the last IP address in the X-Forwarded-For header, once any application proxy IP addresses have first been excluded. If set to zero, then the REMOTE_ADDR value will always be used as the identifying IP address.
Artem
Hi! Can anyone help me please to figure out why am I getting error when I try to change function name? Error:🔺AttributeError: module 'users_data.models' has no attribute 'random_string' Link to the screenshot: https://paste.pics/edit/86542e6a5d1e96d1cb85ba7ab8f04346
Artem
Ur passing argument In default not calling a n function
Even when I call function I'm still getting the same error
Praveen
Even when I call function I'm still getting the same error
Can u use return value of random_string function directly in default
.
how do you python web-based mobile application development? kivy or django
.
I want to adapt my website to the application.
.
They recommend flutter but I don't know flutter.
Anonymous
If you have a django site and wishing to make a same Android mobile application, then there is webview in android studio and pass the website url there and get the application The app will be the same clone of that website.
Idk
I am trying to deploy my app on heroku. But django-markdown-app in requirements.txt is not allowing to install django 3+. Even when running locally, after I had installed all the dependencies from requirements.txt I had to again pip install django. How do I do it on heroku ?
Anonymous
You may be using django 2 And the mentioned will be django 3
Idk
I have mentioned 3.2 in it. But it shows there's a conflict with django-markdown-app (one of the dependecies) and thus cannot instal django 3.2
Anonymous
Ok if it's good in requirements.txt Then check the django version in your system once python -m django --version
Anonymous
Or python3 -m django --version
Anonymous
You may have two versions of python installed
Anonymous
You have to use the same version of python throughout your project
Idk
In my sys its 3.2 but I'm using a virtual env. Somewhat like this - 1. I create a python 3.8 env (only 1 version of python installed) 2. Pip install -r requirements.txt (which contains django 3.2 and django-markdown-app) 3. All the dependecies get installed except django. The error showed a conflict with a dependency (django-markdown-app) thus cannot install django 3. 4. Pip install django Now django everything's fine. Working. But when I try to deploy this app on heroku the issue is that I don't know if I can do a pip install separately. Heroku is just installing everything on my requirements file. How do I separately install django 3 on heroku.
Bharathwajan
i am trying to add comment section >i created a table with the help of django models and connected the blog post by foreign key >i had used filter menthod in views.py file to filter my comments according to the post but i am getting error can someone help me to figure it out
cj
wordpress unfortunately. What do I have to do in this situation?
move to a WordPress group, this is a django group
Artem
Hi! If anyone be able to help me, I would appreciate it. https://stackoverflow.com/questions/67386207/attributeerror-module-has-no-attribute?noredirect=1#comment119109696_67386207
.
move to a WordPress group, this is a django group
I am not writing to build a website, I have written to build applications with python django.
cj
how do you python web-based mobile application development? kivy or django
you should use some frontend library/framework, nothing to really do with django, it's a frontend task, not backend, and kivy is not to make web applications
Bharathwajan
Type error int() argument must be a string , a bytes -like object or a number ,not 'ModelBase'
Bharathwajan
Whats the error
Type error int() argument must be a string , a bytes -like object or a number ,not 'ModelBase'
Владислав
Hello! how to display an article from choices? POST = 'post', 'article' for context['posts'][0].type.????
Ebenezer
Hello, I’m trying to work around scheduling a task in Django. Any help?
Rabbits
Hello guys. I got the error "Object of type InMemoryUploadedFile is not JSON serializable". How to solve it? def post(self, request, format=None): try: data = request.data print('data ==> ', data) checkEmail = User.objects.filter(email=data['email']) if checkEmail: return JsonResponse( {'status': 'error', 'message': 'Данный E-Mail уже используется. Введите другой E-Mail, либо войдите в аккаунт'}, status=400 ) if data['password'] != data['confirm_password']: return JsonResponse({'status': 'error', 'message': 'Пароли не совпадают!'}, status=400) print(data['photo']) user = User.objects.create_user( data['username'], email=data['email'], password=data['password'], first_name=data['first_name'], photo=data['photo'], city=data['city'], birth_day=data['birth_day'], sex=data['sex'] )
odin
Yes
Ganesh
Use drf to combine them
Naol
it is rest api frameworks over django
Doragonsureiyā
Are you looking for Django REST Framework documentation? Here you have it: https://www.django-rest-framework.org/
Poojitha
anyone here pls help me , i am getting few errors while doing migrations...anyone intersted pls dm me, we can keep google meet and pls help
Doragonsureiyā
anyone here pls help me , i am getting few errors while doing migrations...anyone intersted pls dm me, we can keep google meet and pls help
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Anonymous
Charan
I need a DB schema for a project "Create an admin panel who can upload and edit pdf and videos, general user can only download those files" Will someone help me with this
Doragonsureiyā
I need a DB schema for a project "Create an admin panel who can upload and edit pdf and videos, general user can only download those files" Will someone help me with this
So, why don't you do it yourself first? When you have an issue with the Python code you wrote (read rule 5️⃣ to show your code), come back here and people will help you. 😉
rohittt
What are some of the best books to learn django? Name some
Anonymous
In what part are you finding difficulty, Generating the token Or sending the mail?
generating the token and sending it via mail and saving it in db to authenticate
Hello
generating the token and sending it via mail and saving it in db to authenticate
Dm me, i will send you my project link for reference 😀
AK
In my form , when user type 096 number It only taking 96
Alikhanov Jakhongir
In my form , when user type 096 number It only taking 96
what type of field do you have? If that is PositiveIntagerField it removes 0 even if it is not in first index!
Anonymous
If anyone needs any help with python.....text me guys.....I'll be happy to help
Rup
I completed upload file but I am unable to show download option on django admin panel. Can anybody help me please 🥺
Rup
Yes right but I want to add download button and on button file should download
Rup
Yes, download button or just a label like upload file. I just want to download files from admin panel
âshîsh
Get the input from user using either get or post. For example, it's post request. views.py---- def example(request): if request.method=='post': x=request.post['number'] if len(x)==4: output= x[1:3] return HttpResponse (output) else: return HttpResponse (x)
âshîsh
Yes, download button or just a label like upload file. I just want to download files from admin panel
Then goto admin templates.html file and edit according to your need. You will get whole admin panel code on github. Pls consider that.
Christof
I was greetings you
Doragonsureiyā
Looks like you need an offtopic group, please continue this conversation at @pythonofftopic as it's not related to Python
Poojitha
from users import views as user_views......... hello, i have create users app and trying to import it in project level urls...but it is showing error? can anyone tell me what might be the reason
Poojitha
it is showing same error..unresolved references
Cavidan
checking app name and view name
Rafeeq
https://github.com/Aj163/Online-Secure-Voting-System
Rafeeq
https://github.com/Aj163/Online-Secure-Voting-System
Anyone pls help to run this program
Владислав
Hello! I want to output the second values from choices type to context ['title'] = ????. How to do it? models.py ------- class Post(models.Model): class PostType(models.TextChoices): POST = 'post', 'Статья' FILE = 'file', 'Файл' GUIDE = 'guide', 'Руководство' MODS = 'mods', 'Мод' """ some fields """ type = models.CharField(max_length=20, default=PostType.POST, verbose_name='Тип поста', choices=PostType.choices) views.py ---------- def get_context_data(self, *, object_list=None, **kwargs): context = super().get_context_data(**kwargs) context['title'] = str(context["posts"][0].category.title) + str(context['posts'][0].type.????) return context
Anonymous
django make people craze
Poojitha
https://stackoverflow.com/questions/63120051/unresolved-error-when-importing-app-in-urls-py-file can anyone pls ans this