Babban matsala tare da rashin ฦuntata izini shine zai iya haifar da masu amfani da damar yin abubuwan da bai kamata su iya yi ba. Misali, idan mai amfani yana da izinin gyara wani rubutu, za su iya share shi ma.
I have a problem with Django. I am using Django 1.8 and Python 3.4. I have created a superuser and staff user in my project, but the staff user is not restricting permission in django admin panel. I want to restrict the staff user from accessing some of the models in django admin panel, but it is not working for me, please help me out with this issue. A: You should add <code>is_staff = True</code> to your User model: https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django-contrib-admin-models-logentry <blockquote> <p>The LogEntry model has two required fields:</p> <ul> <li><strong><code><code>user</code></code></strong>: The User that performed the action.</li> <li><strong><code><code>action_time</code></code></strong>: The timestamp of the action.</li> </ul> <p>[...]</p> <p>[...] If you want to log actions performed by non-staff users, youโll need to set <a href="https://docs.djangoproject.com/en/1.8/_modules/django/contrib/auth/#User" rel="nofollow noreferrer"><strong><em><a href="https://docs.djangoproject.com/en/1.8/_modules/" rel="nofollow noreferrer">User.<strong></strong>.is_staff</a></em></strong></a>] to True.</p> </blockquote>
Izini a Django
Izini a Django hanya ce ta sarrafa wanda zai iya yin abin da app ษin ku. An bayyana su a cikin fayil na izini.py kuma ana iya saita su akan kowane mai amfani ko kowane-app.
Ana iya saita izini akan matakin izini, wanda aka karanta ko rubuta. Hakanan za'a iya saita matakin izini don ba da damar duk masu amfani, masu amfani kawai a cikin wani takamaiman matsayi, ko masu amfani kawai masu takamaiman izini.
Hakanan zaka iya amfani da madaidaicin yanayi DJANGO_SETTINGS_MODULE don saita izini ga duk buฦatun da app ษin ku ya yi.