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
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?
Alexey
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?
Doragonsureiyā
Alexey
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
Maxim
Alexey
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 ?
Chayeb
Chayeb
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
Chayeb
Georg
they were present some time, but today they gone
Georg
Georg
could it be because of some media files gone ?
Chayeb
Georg
what do you mean? migrations ?
Chayeb
Georg
all migrations are done as shown in ./manage showmigrations
rtg
Chayeb
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.
Gumi
C.A.T
داودخان
what can i use alternative to break in django template
Charly
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?
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😔👍
Chayeb
abhishek
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
Doragonsureiyā
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
Mamad
.
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?
Maxim
切腹
make currency param dynamic
Денис
As minimum don’t paste Users.filter… three times
切腹
Денис
Before “if” u can write query set to variable, like ‘’’ queryset = Users.filter…. ‘’’ , after just use quryset.update()
Maxim