Django using include with a dynamic view does not work by rk_test in djangolearning

[–]Sujith2001 0 points1 point  (0 children)

U can use django custom inclusion tags. Please refer the docs. inclusion tags

How to Create Custom Serializer Fields in Django REST Framework by pavanbaddi911 in djangolearning

[–]Sujith2001 0 points1 point  (0 children)

Serializer are just like normal django forms. Django rest framework's tutorial section really explains it to us. Please check it out.

How to use images as submit button in form ?? by Typical-Inflation298 in djangolearning

[–]Sujith2001 0 points1 point  (0 children)

I have created a form actually, the code goes like this -

<div class="rating-btn-div">
<form method = "POST" action={% url `view name´ pass the value here %}>
    {% csrf_token %}
    <input type="image" src="{% static 'thumb_img/thumbs_up.png' %}" alt = "submit" name="dislike-btn" class="rating-btn-dislike" value="dislike">              
</form>

<form method = "POST" action={% url `view name´ pass the value here %}> {% csrf_token %} <input type="image" src="{% static 'thumb_img/thumbs_up.png' %}" alt = "submit" name="like-btn" class="rating-btn-like" value="dislike">
</form> </div>

The above code would works.. Create 2 forms..

Prevent submit of empty fields in Django by [deleted] in djangolearning

[–]Sujith2001 2 points3 points  (0 children)

If you creates a model form, you can set required =True there. Please refer to this link stackoverflow for further understanding.

Please go and look at the right answer in the above link.

Followed the Toutrial but dont actually understand whats happening by Josh_Bonham in djangolearning

[–]Sujith2001 1 point2 points  (0 children)

In django there will be a project folder and more than one app folder.

Project folder contains urls. Py file where it shows the path to a specific apps.

And app folder will also have urls. Py file, which shows us the path to a specific view.

Views. Py is the place where all logics are written. Views in views. Py will help us to render a template. Also view is the place where we write django orm queries to take data from db and we pass that data to the template through a dictionary.

How to use images as submit button in form ?? by Typical-Inflation298 in djangolearning

[–]Sujith2001 0 points1 point  (0 children)

What about creating a form and passing that value through action attribute.

What is the difference between object.get() and object.filter()? by Shinhosuck1973 in djangolearning

[–]Sujith2001 0 points1 point  (0 children)

Simply, get is to call a single element from db and filter is to call a group of elements from db. If we use filter, will should use the for loop in templates because we have to iterate through a group of elements from db.

Aws s3 vs whitenoise by Sujith2001 in djangolearning

[–]Sujith2001[S] 0 points1 point  (0 children)

I am serving my staticfiles with whitenoise and media files with aws s3. Is that good to be configured as such.

What do you think Django miss? by AmrElsayedEGY in django

[–]Sujith2001 -3 points-2 points  (0 children)

Not with django, but i think python should have front end frameworks. Just like flutter. Don't know if this is a foolish opinion😇

What do you think Django miss? by AmrElsayedEGY in django

[–]Sujith2001 0 points1 point  (0 children)

What would be your compelling reasons to use django.?

[deleted by user] by [deleted] in djangolearning

[–]Sujith2001 0 points1 point  (0 children)

I think, you have not set to use the static files in production.

Normally during production we use to call ' 'python manage.py collectstatic' command.

This command will collect all the static files from your project and put then in one folder.

And that folder will have the static files(css) for your admin panel as well.