Alex
I just want to send password in email to user
It's not how modern day web security works. Decription may be very expensive operation and you don't want to do it anyway. You want user to come to your service and enter him a new pass.
Doragonsureiyā
No
Ehsan
Hi I got product model And discount model And in discount form i want to show some of product object datas How can i initial that in django?
Ehsan
by using initial attribute of forms
Its another model object not same model
HamidReza Fekri
hey I have class view for address form and i want to limit it that only logged in user can access to it and how to solve this????
HamidReza Fekri
class AddressCreateView(CreateView, LoginRequiredMixin): permission_required = 'auth.see_profile' template_name = 'address.html' form_class = AddressCreateForm success_url = reverse_lazy('customer:profile')
HamidReza Fekri
Optimus
but its not working
Put LoginRequiredMixin first then CreateView
HamidReza Fekri
HamidReza Fekri
👍
🙏🙏🙏🙏
Ehsan
initial data ah ?
I want to show operator product price in product discount form After selecting product in discount form
Pavel
Hello. Haw to add having clause accept = True .extra( select={ "accept": """CASE WHEN (ARRAY_AGG((SELECT DISTINCT ON (U0."person_id") U0."birthday" FROM "person_personalinfo" U0 WHERE U0."person_id" = ("person_personfamily"."person_id") ORDER BY U0."person_id" ASC, U0."updated_at" ASC LIMIT 1)))[5] <= %s THEN True ELSE False END """}, select_params=(date.today() - relativedelta(years=1),),
Ehsan
use ajax to display price on selecting product
I want to do it without ajax I think that formset or anything like that will help me By the way thanks🙏🏼
Saw
I made a django project and I would like to know how to test it on my phone without having to deploy it on a remote server. Can you help me please?
Daniel
runserver 0.0.0.0 acess using ip address
Daniel
anytime👍🏽
ꪉꫝꪖꪹᦋꪖꪜ
Functionality of system can be use if user is logged in otherwise login page should redirect, can anyone pls tell me how can i do these stuff?
kuzmich
Django, redirect all non-authenticated users to landing page https://stackoverflow.com/q/21123559/11426104
legrand
Hi, please when I run the command py manage.py runserver it doesn't work . Please help
ꪉꫝꪖꪹᦋꪖꪜ
I had created the super user. Tired of auth failure. Unable to login. Can help please?
Doragonsureiyā
Hi, please when I run the command py manage.py runserver it doesn't work . Please 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
Someone could help me with Django please
Anonymous
Exception has occurred: improperly configured requested setting INSTALLED_APPS, but settings are not configured
Doragonsureiyā
Exception has occurred: improperly configured requested setting INSTALLED_APPS, but settings are not configured
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
Avi
I want to implement non login based cart system in django Can anybody help me
Doragonsureiyā
I want to implement non login based cart system in django Can anybody help me
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Avi
I want to implement non login based cart system
Maxim
I want to implement non login based cart system
before that there was at least a question, albeit a meta now there is not even a question
Avi
I don't know how to use sessions any blog will help
Doragonsureiyā
I don't know how to use sessions any blog will help
Please read the pinned message of the group to know more about this group, the rules and also you'll find resources and learning materials there: https://t.me/Python/1162861
Владислав
Guys, who has a good example of using rest_api for Ajax? without frameworks.
cj
Guys, who has a good example of using rest_api for Ajax? without frameworks.
then go use FastAPI and build everything by hand ah no wait, it's still a framework ¯\_(ツ)_/¯
Владислав
No, I have already created a site on Django. It's just for me to make an api for basic functions like likes, subscriptions. Just wanted to see)
Илья
Guys, plz help me i use django rest framework and have one of api pages The question is - how to make a form instead of ‘Content’ in the Post-request?
RIO
I created a folder named templates , and then created home.html , about.html and contact.html , i added templates in the DIR in settings , my images are in the templates folder , is there something wrong with it?
According to the django templating rules, after creating the templates folder, then you should create another folder with the same name as your app.
Gadde
I am new to Django. Can anyone suggest me first what to learn basic concepts in Django
Anonymous
anyone suggest me some django hosting tutorials or videos....
Doragonsureiyā
anyone suggest me some django hosting tutorials or videos....
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Sukhrob
Who has templates static files for practise
Anonymous
Hi can some help me with this....how can we redirect user to mobile application if app is installed if not should go to playstore (ANDROID/IOS).I dont know whether it should be handled with django or from mobile application?.can someone give me an idea
Anonymous
i want to user to change username but when i want to write the username that already existed the clean_username method not working and thus giving IntegrityError at /users/profile-edit/ UNIQUE constraint failed: users_user.username HOW TO QUERY IN clean_username SO THAT IS SHOW ONLY USERNAME ALREADY EXIST ValidationError py class UserEditFrom(forms.ModelForm): username = forms.CharField(label="",max_length=254,widget=forms.TextInput(attrs={'id':"user-name",'type':"text" ,'class':"form__input" ,)) def clean_username(self,*args, **kwargs): username = self.cleaned_data.get("username") if User.objects.filter(username=username).exclude(username=username).exists(): raise forms.ValidationError('username is alraedy taken try another one') return username
Anonymous
Maybe this is what you want username = self.cleaned_data.get("username") try: User.objects.get(username=username) except User.DoesNotExist: return username raise ValidationError({"username" : "username already exists"})
Виктор
Hello everyone Maybe someone can help? I have a simple blog application. With one nuance. In models.py the body field is not models.TextField, and RichTextUploadingField. Everything would be fine. Everything works fine, but when it comes to autotests, everything crashes. error text: django.core.exceptions.FieldDoesNotExist: Post has no field named 'body' test text: class PostModelTest(TestCase): @classmethod def setUpTestData(cls): Post.objects.create( title='Серьёзная статья', body='Здесь очень важный текст' ) def test_title_label(self): post = Post.objects.get(id__iexact=1) field_label = post.__meta.get_field('title').verbose_name self.assertEquals(field_label, 'title') for example. Pls, help 🙏
Виктор
Show your models
https://dpaste.org/1pvR
Anonymous
https://dpaste.org/1pvR
RichTextUploadingField? Are you using wagtails?
Виктор
This is ckeditor fields
Виктор
I needed advanced text editor for blog
Anonymous
This is ckeditor fields
Check their docs. Most CMS have their test suite to ease testing fields like
Anonymous
I use wagtails cms
Виктор
I use wagtails cms
Wow! Thanks for information about this cms It will be easier to move to it
on
Who can solve redirection issues on my Django web app kindly ping me. Will pay for it
Виктор
You'll love it
Definitely. I already like the demo)
Sergey
Hi all doing unit tests on the Django and ran into this problem: there is this TestA -> TestB -> TestC ->TestD relation and on the test D does not see the field of the class, which was initialized in A how I can solve such thing?
Вин Король Саксов
Hi all doing unit tests on the Django and ran into this problem: there is this TestA -> TestB -> TestC ->TestD relation and on the test D does not see the field of the class, which was initialized in A how I can solve such thing?
Unit testing is independent, everything created in one test would not be accessed at another, if you want to share something between them you could only do def setUp, method. If you want test to be not independent it is called integration testing
Вин Король Саксов
I shared it in setUp method but somehow D class don't know about field that I init in this method🤔
Class D wont access that setUp method, because your class D will be independent from your other class, you can create more methods in your first class, or copy setUp to class D
Sergey
Or I can move this to __init__?
Вин Король Саксов
You dont need init at TestCase class
Вин Король Саксов
Share your code please, there no need to move it to init
Вин Король Саксов
Because python TestCase, will only share fields that will be at setUp
Вин Король Саксов
Thats how it works
Sergey
I used TestCase and StaticLiveTest from Django as my my basic classes fro which I inherited
Sergey