Can I learn Django without knowing coding?
No!
You’re essentially always writing code.
- You’ll define the logic in the views.[1]That is Python code.
- from django.http import HttpResponse
- import datetime
- def current_datetime(request):
- now = datetime.datetime.now()
- html = "<html><body>It is now %s.</body></html>" % now
- return HttpResponse(html)
- You’ll define the structure of the page in the templates.[2]That is HTML code and even some Python and CSS code.
- {% if latest_question_list %}
- <ul>
- {% for question in latest_question_list %}
- <li><a href="/polls/{{ question.id }}/">{{ question.question_text }</a></li>
- {% endfor %}
- </ul>
- {% else %}
- <p>No polls are available.</p>
- {% endif %}
- You’ll define the relationship and how the data is stored in the models.[3] That is Python code.
- from django.db import models
- class Person(models.Model):
- first_name = models.CharField(max_length=30)
- last_name = models.CharField(max_length=30)
- You’ll define the urls’ structure in the URLconf.[4] That is Python code.
- from django.urls import path
- from . import views
- urlpatterns = [
- path('', views.index, name='index'),
If you want to use Django you must learn Python (and HTML at least).
The good thing is that Python is a nice and easy language to learn.
Both the Python and the Django community are very friendly and eager to help.
EDIT: I found this article about this topic How much Python should you know before learning Django? | JustDjango Blog
Comments
Post a Comment