ʚɞÇherry Łoveʚɞ
the dark
how can i set 2 login authentication function for student and teacher??
Guilherme
Hi everybody. Good afternoon!!!
Bhupesh
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
Btw
Mirco
Anonymous
has anyone here design or develop rating in his or her django app
Anonymous
star ratings from scratch,
Anonymous
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
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
inchidi
Anonymous
Who could help me in Rails
Mirco
Jimmies San
wrong language 😂
Mirco
😂
Anonymous
🌚
Chris
Renita
Lol
R
R
Change asap!
Jimmies San
change to ASP!
oh wait... 😂
R
syam
How to make a single django rest API using multiple model classes
ʚɞÇherry Łoveʚɞ
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
Maz
Fayeq
Hi dears
I need some Django series for customization admin 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
Luis
Mirco
Jimmies San
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?
Mirco
Nadir
Anders (izzno / gooood) 🇳🇴
(But how can I make sure this is the signed in user)...
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