I'm using
* Django 1.3
* Django-TinyMCE 1.5 trunk
* Filebrowser 3.4
Now if I login with an account which is_staff, I could upload pictures via TinyMCE's insert image button. While if it is not a staff, the pop up window will redirect to django admin login page and if I login with is_staff account, the pictures will be listed.
How could I allow non staff to upload picture?
Override the clean method in the AdminAuthenticationForm class
Create a view outside the admin where a user can upload
Make the user staff
You do realize that if you do point 1 or 3 the user will have access to the whole admin section? That is probably not what you want so you should go with point 2.
Related
I have created a superuser in my django project that access to all of the permissions of the admin page. The problem is that when I add an object to the customized user model and set is_staff = true for that new user and then logout from the admin, I cannot login with the staff user account due to the error that says “please enter correct username and password for the staff account” despite the matter that the username and password of that staff user are right.
I will thank if anyone help me to solve this problem
Have you told your django app that this user class is your user model?
To do so, you need to set AUTH_USER_MODEL in your app's settings. This is described in more detail here in the Django documentation.
when admin updates user profile how to access that obj in views and perform some task in django
i have user model and when user creates new account by default his id is deactivated but when admin activate their account from admin panel by change the user model field "is_active" to True
the i want to send that user an email and some other task also
so how to get that user's object
that activated by admin
How do I differentiate between admin login and the user login in Django.I want to create single login template?If the login is from the user I want to redirect into different template than the admin.
django default user model has a field superuserstatus . it is Boolean field . if this field is checked user is admin else not. check on this condition.
I created three devise models user, admin, trainer. For user and admin i want login with email and password. For trainer I want login with username and password. How we can achieve this ?
Your Users and Admin should already be logging in with email and password by default with Devise.
To set up login with username for your Trainers checkout this link.
https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address
This will allow your Trainers to login with either username or email. You can display either on the pages because we are adding a username migration to the trainers model.
You will also need to add field to the Trainer signup page.
How to add an extra field to django allauth registration flow.
1. First step- Django allauth registration using email or fblogin (this is working for me, the user is able to register through facebook or email)
2. I want to add the following fields/attributes to the user registration but as a second step.
The new attributes are 1. DOB, Address, Phone no, Linkedin login and a user profile score
Answer to block one can be found here
How to customize user profile when using django-allauth
for Block 2,
Add this to your settings.py
INSTALLED_APPS = ('allauth.socialaccount.providers.linkedin',
)