Mandeep
Can anyone tell me what is difference between foreignkey and onetoone ?
Сергей
there are a few models, I want to create serializer where field this serealizer wil be those models with all data if the data exist, how can create such serializer without model in meta and I just will receive all data all model that I want?
Anonymous
how can I see admin website content if the user.is_superuser is False?
Leo
Leo
. A simple if statement will do the trick. If you want to change the constraints using if gives more flexibility .
Leo
Btw how will you do filter the template with grouping?
Leo
Anonymous
index page from django admin
Leo
Leo
Anonymous
Yes, all users have is_staff = True, but some of them not superusers
Mandeep
Anonymous
Yes, non superusers that in group A (that have permissions to view all models) still cant see any content on admin page.
RIZWAN
Hey guys check it out if you like please give star it will help me to get internship
https://github.com/rizwansoaib/face-attendence
Leo
Anonymous
Can I look at your view?
Well, I dont have any views, I just registered models for django-admin, specify the group A for user_1 and added permissions to the group A
Anonymous
I write my own User class inherited from AbstractUser.
Maybe it may helps to find a problem 🤷🏻♂️
RIZWAN
Leo
RIZWAN
What's problem
Leo
That's the problem
Using custom Auth eventhough inherited is causing this problem. Django admin backend don't know anything about the new user Auth system you implement ed. So acknowledge the ModelBackend may solve this problem.
Leo
Anonymous
What I should do?
Leo
Can I look at you user class?
Anonymous
https://pastebin.com/K5kf1JgW
Leo
Wisdom
Anonymous
I'm using custom backend to auth, btw.
I inherited SystemUser from ModelBackend as you said, but it raises many errors
https://pastebin.com/K7LH7rnm
In settings:
AUTH_USER_MODEL = 'telegram_bot.SystemUser'
AUTHENTICATION_BACKENDS = [
'telegram_bot.ldap_backend.UnitelLDAPBackend'
]
Leo
Leo
Yep
Hello
I have a func.py with
def test()....return name
I import that function into models.py and call it with
p = test
But i didnt get the value from name. What i get is
<function test at 0x48fjwddk4>
p = test() gives me a error...im not too good @obejcts...how can i get the value?
Yep
Strange now it works with test() .. ok my bad, thxs anyway
Anders (izzno / gooood) 🇳🇴
So far I've spent two days making a simple app serving questions with sequelize, I could have used django and be done in a couple of hours.
+ getting real familiare with js-sequelize.
- dont think i will use it again 😂
Anders (izzno / gooood) 🇳🇴
I've said it before and Ill say it again... People dont know what their missing...
Avinash
How to get logged in user details in another app view ?
Anders (izzno / gooood) 🇳🇴
request.user
Avinash
But giving anonymoususer.
Anders (izzno / gooood) 🇳🇴
then your user is not logged in
Avinash
Used login function
Anders (izzno / gooood) 🇳🇴
I can't see that...
Avinash
??
Anders (izzno / gooood) 🇳🇴
WHERE'S YOUR CODE
Anonymous
Anonymous
Albert
Hello.
Who can tell in solving the problem?
I zapsukayu project on django, knocking on the admin panel - authorization pages and the main admin page are displayed correctly.
But I cannot fall into any embedded page (whether they are standard users / groups or models created by me).
A redirect occurs, but the page does not load, does not generate errors (only the loader spins instead of favicon).
There are no errors in the pycharm console. The only thing that is displayed:
```
[30/May/2019 18:20:35] "GET /favicon.ico HTTP/1.1" 404 5184
[30/May/2019 18:20:39] "GET /admin/order/ HTTP/1.1" 200 41768
[30/May/2019 18:20:39] "GET /admin/jsi18n/ HTTP/1.1" 200 14871
```
Aadhi
Hello Guys,
I have a doubt
Django object.image.url is not displaying images even though path is correct
Also I have added media URLs in urls.py
Can somebody help me
Patrick
Aadhi
Inside img tag
Mirco
Aadhi
return render(request,'Manager/player_profile.html',{'player_profile_dict':player_profile_dict})
player_profile.html
---------
<div class="container_player_profile">
{% for p in player_profile_dict %}
<img style="height:50%; width:50%" src="{{p.upload_photo.url}}">
{%endfor%}
</div>
urls.py
----------
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
settings.py
-------------
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
Amaro
Anonymous
I didn't forget 😁
the problem was with method has_module_permissions in my Auth backend and in my admin models. I think I've almost solved this problem.. Anyway thnx to everyone
Mirco
Yep
Models.py
Date = models.DateField(default=datetime.date.today)
It works for 2019-05-31
But whats the option for 2019-05-31:hours:minutes:seconds?
Datetike.date.now doesnt work
Yep
Sqlite3
Yep
Ok datetimefield works
But
%Y-%m-%d %H:%M works...seconds dont
%M[:%S] like django tells me doesnt work
Thiago
Hello everyone, good night! Can anyone explain me how to login with data from a modal? I can get the data from ajax, but I don't know how to proceed ... :( PLEASE HELP ME
Joshua Rebelo
Hi anyway to expire the csrfmiddlewaretoken before the expiry time
Joshua Rebelo
I have a scenario that on page refresh I generate new csrfmiddlewaretoken token
Joshua Rebelo
Hence I want to make the old one invalid before reaching expire time
abhijith
Any one can help me to get customMessaging(chat) in django??? Working in django 2.1
Muflone
Himanshu
Can anyone help me with this? Suppose I have a model and it has 3 fields email, mobileno and sid. In the form I am taking only email and mobileno and I'm generating a sid myself so anyone can tell me how can I add this value of sid in the database while saving the email and mobile no. In the db
dynamic
Is there a framework which can follow BDD and create APIs on the basis of the requirements given by BDD?
More like automating the process of creating simple API end-points.
Yep
Oh dam you are right... They are in the db, need to format the html. Thxs & sry, still new to django