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?
Mirco
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')
Mirco
HamidReza Fekri
HamidReza Fekri
Ehsan
Optimus
HamidReza Fekri
Optimus
Ehsan
initial data ah ?
I want to show operator product price in product discount form
After selecting product in discount form
HamidReza Fekri
Optimus
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
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
Saw
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
kuzmich
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
Avi
I want to implement non login based cart system
Avi
I don't know how to use sessions any blog will help
Владислав
Guys, who has a good example of using rest_api for Ajax? without frameworks.
Владислав
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
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....
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
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 🙏
Anonymous
Виктор
Виктор
This is ckeditor fields
Виктор
I needed advanced text editor for blog
Anonymous
I use wagtails cms
Виктор
I use wagtails cms
Wow!
Thanks for information about this cms
It will be easier to move to it
Anonymous
on
Who can solve redirection issues on my Django web app kindly ping me.
Will pay for it
djigit0s
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?
Sergey
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