Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django check if user is admin

{% if user.is_superuser %}
    <p>Hello, admin.</p>
{% else %}
    <p>Hello, ordinary visitor.</p>
{% endif %}
Comment

check anonim user django

request.user.is_anonymous
Comment

django check user admin

user.is_superuser
Comment

PREVIOUS NEXT
Code Example
::  
::  
::  
:: print list in python 
Python :: http server in python 
Python ::  
::  
Python ::  
::  
::  
::  
::  
Python ::  
::  
:: python numpy array size of n 
::  
::  
:: python stack 
::  
Python ::  
::  
::  
:: create virtual environments python 
::  
Python :: sort an array python 
::  
Python ::  
::  
Python ::  
Python :: how to count null values in pandas and return as percentage 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =