troubleshooting Question

Make Field Readonly

Avatar of Ray Zuchowski
Ray Zuchowski asked on
* DjangoPython
1 Comment1 Solution86 ViewsLast Modified:
I have a field in my database that is displayed on my form in Django that i want to be just readonly. How do i do that ?

Here is my a section of my HTML page.

{% extends 'base.html' %}

{% load crispy_forms_tags %}
{% load static %}
{% block content %}

<h2>{% load static %}
<img src="{% static 'forms/star.png' %}" alt="chain" height="62" width= "62">  K-8 School Points</h2>
<div class = "container">
 <div class= 'row'>
  <div class="col-4"> 
<p> Recording Data as User : {{user.username}} </p>

 <div class= 'row'>
  <div class="col-2"> 
<p>{{form.status|as_crispy_field }}</p>                                <------------This is the field i need to be readonly 
<form method="POST">
    {% csrf_token %}
 <!-- Start Date -->
Ray ZuchowskiIT Director

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros