# How to make fields to be read only fields in the Django model admin forms?

> **Note**: If you want to read the blog [series](https://blog.devjunction.in/series/django-admin-tips-tricks) on Django Admin customization, then [click here](https://blog.devjunction.in/series/django-admin-tips-tricks).

Suppose you have a `Book` model which has an `is_active` field as given below.

```python
# app_name/models.py

class Book(models.Model):
	...
	is_active = models.BooleanField(default=True)
```

And you do not want the admin to edit/add values in certain fields, you can make them read only in the admin panel using `readonly_fields` attribute of `ModelAdmin`, here is how you do it.

```python
# app_name/admin.py

from django.contrib import admin
from app_name.models import Book

@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
	...
	readonly_fields = ("is_active", ) # 'is_active' field will be read_only in the django admin form
```

***Any thoughts? Write it down in the comments.***

> For more such crispy blogs daily, follow Dev.Junction, subscribe to our newsletter and get notified.

## **Social Links**

*   [**LinkedIn**](https://www.linkedin.com/in/mnamegaurav/)**:** [**https://www.linkedin.com/in/mnamegaurav/**](https://www.linkedin.com/in/mnamegaurav/)
    
*   [**YouTube**](https://www.youtube.com/devjunction)**:** [**https://www.youtube.com/devjunction**](https://www.youtube.com/devjunction)
    
*   [**Website**](https://gaurav.devjunction.in/)**:** [**https://gaurav.devjunction.in/**](https://gaurav.devjunction.in/)
    
*   [**GitHub**](https://github.com/mnamegaurav)**:** [**https://github.com/mnamegaurav**](https://github.com/mnamegaurav)
    
*   [**Instagram**](https://www.instagram.com/mnamegaurav/)**:** [**https://www.instagram.com/mnamegaurav/**](https://www.instagram.com/mnamegaurav/)
    
*   [**Twitter**](https://twitter.com/mnamegaurav)**:** [**https://twitter.com/mnamegaurav**](https://twitter.com/mnamegaurav)
