abhishek
I have used this code for api testing still i am getting assertion error for 3rd test case can any one help me where i am missing
abhishek
assertion error 401!=200
Alexey
assertion error 401!=200
login test rollback, so when u test auth, u dont have token for user
abhishek
Yes but i have made it to auth in the above link there is my code I am not getting what is the mistake i am making
Alexey
u have to login and test refresh token in 1 test function
abhishek
If you have any example codes which is related to this can you send the links of that?
abhishek
This is my code which is getting error
hehecatto
can anyone give me an example code for a contact model?
karakurt
class Post(models.Model): ... class PostReaction(models.Model): class Type: LIKE = 0 DISLIKE = 1 # some other user = models.ForeignKey(...) post = models.ForeignKey(Post, related_name='reactions') type = models.IntegerField(choices=Type.choices) I have these models and PostSerializer. How can I determine if requesting user reacted on a post? I need to highlight corresponding reaction button.
rtg
has anyone tried django-allauth?
rtg
Yes
i am trying in a new project (only for try django-allauth), y happens that when i do migrate, all is ok, but later y do "python manage.py runserver" ... but says again (all the times) that there are migrations pending.
rtg
You have 25 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): account, admin, auth, contenttypes, sessions, sites, socialaccount. Run 'python manage.py migrate' to apply them.
rtg
Y do migrate... all "ok"... but again the same
Tура
did someone use instapy, I am getting unable to login error, wh?
Tура
could you tell me pls
rtg
ok, i see that is configured like a sqlite, but i don´t see sqlite in the project (it is the original cloned from django-allauth github)
rtg
mmm when i do "python manage.py makemigrations" returns:
rtg
System check identified some issues: WARNINGS: openid.OpenIDNonce: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. openid.OpenIDStore: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. No changes detected
rtg
(but the project is new, only cloned django-allauth project from github)
Swapnil
Can anyone help me to authorise api in django ?
Georg
hello... After some changes there are a two models which has gone from admin view... I can't understand why
Doragonsureiyā
Can you take a screenshot?
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Georg
and I can't return them to the models view of admin page
Georg
there are exactly the last couple of models I added to the project
Georg
they were present some time, but today they gone
Georg
could it be because of some media files gone ?
Chayeb
could it be because of some media files gone ?
Did you run the database after the changes?
Georg
what do you mean? migrations ?
Georg
all migrations are done as shown in ./manage showmigrations
Gumi
I am developing an insurance website that includes user authentication with email and phone number verification. Users can submit their credentials for new insurance and upon submission, an email notification will be sent to the admin. The admin can then contact the user via phone call for further verification. Once the insurance request has been verified by the admin, it will be reflected in the user's view and the user can view the start and expiration date of the insurance. Additionally, users have the option to request for cancellation of their insurance. Lastly, I have created an additional page that introduces myself as the developer of the website and provides an opportunity for interested individuals to contact me for website development services for their business or personal needs.
C.A.T
I am curious to know if that insurance website project that I am currently working on, utilizing HTML, CSS, JavaScript, and Django, would be a suitable project to showcase my skills and potentially secure a basic entry-level job as a backend developer.
I personally think you shouldn’t include such information as I find this as personal information from the user end. You can make up a portfolio project and create a link with an appropriate caption within your website for those who are interested.
Марат Владимирович
in your form create a input type=hidden
Not working it, id model not send to post only other field post
داودخان
what can i use alternative to break in django template
داودخان
Why so you need that?
to break the loop after i got the needed value
Charly
to break the loop after i got the needed value
Do that in the view, templates are not supposed to handle too much logic
Riad
can anyone kindly explain django queryset difference() in a lucid way? The documentation has only one line about this method and I am not clear about the working process
Hell
Does anyone have experience in writing custom db backend engine in django? If so can you help me in creating one?
Doragonsureiyā
Does anyone have experience in writing custom db backend engine in django? If so can you help me in creating one?
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
Olesia
Can you take a screenshot?
I’ve solved the problem. Used cfrs decorator for the problem view.
name
hello everyone . i need to do case insensitive searches in db (sqlite) , but __icontains method doesn't work , it's still case sensitive . i found information in google , that sqlite doesn't support case insensitive searches or smthn , is there any way to solve this problem ?
name
ok thanks😔👍
abhishek
u have to login and test refresh token in 1 test function
I have tested that but still its not autherizing
Alexey
I have tested that but still its not autherizing
u can create git project and share it? ill try to help ASAP
Harsh
can anyone help to write small test code now?
Doragonsureiyā
can anyone help to write small test code now?
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
Riad
update() Performs an SQL update query for the specified fields, and returns the number of rows matched (which may not be equal to the number of rows updated if some rows already have the new value). The update() method returns the number of affected rows Why contradictory statements are given in https://docs.djangoproject.com/en/4.1/ref/models/querysets/#update ??
Asad
Ok
Maxim
Ok
for everything else @pythonofftopic
Asad
Thank you
Shivam
Django with Google analytics
Kareem
If i have a django app and want to put it live.. What security things i should consider to add or learn? Also do i need to push docker with it to the server? And the testing i did should i push it as well or delete it?
Артём
I have a Django project where I created two models: Category and Shop. Each shop might have only one category. If I didn't define a shop's category in DB I want it to be in Without category section at template. How do I set a default value?
.
Hi I have a model called Player And another called Team Team model is a foreign key in Player In my template i just want to check if the team of the player is "Something " Here is the condition {% if player.team == "something " %} Say yes {%else %} Say no {%end if %} And It still give 'no' But I'm sure that the condition is True not false
.
I didn't get the number part but Thank you very much
切腹
hello, i have func: def add_to_check(user_id, currency, currency_curs): print('wow', currency, currency_curs) if currency == 'usd': Users.objects.filter(user_id=user_id).update(usd=currency_curs) elif currency == 'aed': Users.objects.filter(user_id=user_id).update(aed=currency_curs) elif currency == 'eur': Users.objects.filter(user_id=user_id).update(eur=currency_curs) how to make it easy?
切腹
simply delete all lines starting with if currency == 'usd': i didn't read it carefully
is it posible to make like in base sql cursor.execute(f'UPDATE users SET {currency} = {currency_curs} WHERE user_id=?', (user_id,)) ? But thank you!
切腹
make currency param dynamic
Денис
As minimum don’t paste Users.filter… three times
切腹
As minimum don’t paste Users.filter… three times
understan it, but i don't know how...
Денис
Before “if” u can write query set to variable, like ‘’’ queryset = Users.filter…. ‘’’ , after just use quryset.update()