ʚɞÇherry Łoveʚɞ
the dark
how can i set 2 login authentication function for student and teacher??
Mirco
how can i set 2 login authentication function for student and teacher??
https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html This is a good read
Guilherme
Hi everybody. Good afternoon!!!
Jimmies San
Hi everybody. Good afternoon!!!
for the girls.. bad afternoon!
Jimmies San
Guilherme
I want to create different home pages (for each user groups), can anyone guide me on how to do this? I need to understand about user groups and authentication for each group too.
Guilherme
Can you give me any directions to deal with it, please?
Guilherme
for the girls.. bad afternoon!
I didn't mean it. But I corrected.
Guilherme
Btw
Anonymous
has anyone here design or develop rating in his or her django app
Anonymous
star ratings from scratch,
Anonymous
how can i set 2 login authentication function for student and teacher??
use Django abstract user i could send you a sample if you need
the dark
ok
Anonymous
ok coming
Anonymous
first add this toyour settings.py AUTH_USER_MODEL = 'Account.User'
Anonymous
from django.contrib.auth.models import AbstractUser,BaseUserManager from django.db import models class User(AbstractUser): username =Usernamefield email = models.EmailField(_('email address'), unique=True) is_student = boolean is_teacher = boolean
Mirco
has anyone here design or develop rating in his or her django app
https://github.com/shanbay/django-vote Could be useful for your project
Anonymous
is this chat dead?
Anders (izzno / gooood) 🇳🇴
Let's see
Anders (izzno / gooood) 🇳🇴
Anders (izznogooood) 🇳🇴: I had to make another app to override the User model, can anyone point me in the direction to gather Users/Groups under one collection ? (Overiding the admin index?)
Anders (izzno / gooood) 🇳🇴
I can't paste the picture (group rules) so here is a mental one 😉, my user model lists under my created Auth-app while group is listed under the normal authentication collection.
Anders (izzno / gooood) 🇳🇴
I want them grouped together
Anders (izzno / gooood) 🇳🇴
one collection? mind to elaborate?
Under one banner in the admin index
Anonymous
Who could help me in Rails
Jimmies San
wrong language 😂
Mirco
😂
Anonymous
🌚
Renita
Lol
R
Change asap!
Jimmies San
change to ASP! oh wait... 😂
Mr. Rude
Change asap!
Python competitor spotted
syam
How to make a single django rest API using multiple model classes
syam
is there a way to do so
syam
what about this https://media.readthedocs.org/pdf/django-rest-multiple-models/latest/django-rest-multiple-models.pdf
ʚɞÇherry Łoveʚɞ
i never used it before but i just take a look and think it's OK.
ʚɞÇherry Łoveʚɞ
even you can do it yourself with nomal serializer class.
syam
but i cant make it to work
syam
i was also looking at joining the apis together in the angular end using forkjoin
ʚɞÇherry Łoveʚɞ
i cant imagine about your case. If you can joining apis so why do you need django-rest multiple model ?
ʚɞÇherry Łoveʚɞ
one model with one API is more clearly.
syam
but the problem is i cant join the 2 apis at angular end/ its crashing everything
ʚɞÇherry Łoveʚɞ
syam
its not resolving rxjs observable
MH5
Hi
Danilo
Hi
Mirco
👋👋👋
MH5
I'm a débutant with Dj.. Firstly I speak french but i can unwind myself to speak english I'm very glad to find this crew End i'm sure you can help me to learn
Fayeq
Hi dears I need some Django series for customization admin templates
Mirco
Hi dears I need some Django series for customization admin templates
https://docs.djangoproject.com/en/2.0/ref/contrib/admin/#admin-overriding-templates
Fayeq
Dear mirco I need some videos series
Mirco
Dear mirco I need some videos series
What does it change ? Try to read docs, then if u don't understand try watching some video tutorials to clear your ideas Btw check them out on YT or Udemy
Jimmies San
Dear mirco I need some videos series
dear fayeq i need a lot of money
Nadir
Hi, can anyone help me? I get a value from an ajax call but i can't put it in the corrispondent field in the form. I'm using this instruction $(#id_field).html(data).
Dcruz
😂😂😂
Anders (izzno / gooood) 🇳🇴
def user_directory_path(instance, filename): # file will be uploaded to MEDIA_ROOT/user_<id>/<filename> return 'user_{0}/{1}'.format(instance.user.id, filename) class MyModel(models.Model): upload = models.FileField(upload_to=user_directory_path) I cant get this to work, and I´ve tried grasping how the model which does not have a .user attribute can find the user id. How can i get the userid from. a model class?
Anders (izzno / gooood) 🇳🇴
Your model has no user related to
No, thats correct. This is the django example you have to work from. This does not work.
Anders (izzno / gooood) 🇳🇴
Your model has no user related to
The way I see it I have to add user to the model for this to work.
Anders (izzno / gooood) 🇳🇴
(But how can I make sure this is the signed in user)...
Mirco
(But how can I make sure this is the signed in user)...
Let the user able to upload the file only if it"s logged in
Mirco
So the UploadView requires login
Anders (izzno / gooood) 🇳🇴
Yes, I can controll it that way, and set the "owner" from the top down...
Anders (izzno / gooood) 🇳🇴
I just did not realize the example was "uncomplete" 😉
Anders (izzno / gooood) 🇳🇴
Stuck me completely hehe.
Mirco
😂
Anonymous
Good day all, am facing issues, when user uploads image, if the image is heavy the site becomes slow, please what do i do
Anonymous
How do i optimize the pictures and make the site fast