I think Django is a difficult framework that, to my touch, is different from Rails or Express. Personally, I think it's ** a little big Express + a lot of batteries **
This is because the framework itself is simpler than Rails and has a ** battery ** that allows you to create a wealth of convenient websites.
Rails has app, config and various files, while Django usually has only the following files
With this configuration, there is a problem that the views become long, but since you can use the means of dividing or writing only the logic to another code, there is no problem unexpectedly.
--Automatically generated Admin page (where data can be managed) --CRUD forms can be created easily
It will be long if you write various things, so I will fold it, but for example, you can create a new user only with the following
views.py
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.edit import CreateView
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
class CreateUser(CreateView):
model = User
form_class = UserCreationForm
template_name = "user.html"
def get_success_url(self):
return reverse('index')
~~ import is long because it is a Python specification, so please give up ~~ From this code, you can derive the following features of Django:
--User model is automatically generated in the first place --It's relatively easy to create a new model
Besides, it is easy because it uses decent encryption technology as standard, so there is no need to know the encryption technology.
As I wrote in other articles, it also supports streaming distribution, so in theory it can also support SSE.
By default, Sass, Babel, and TypeScript cannot be used, and the process of making them available is quite troublesome.
Since there are few examples of use in Japan, you will be reading English as a matter of course. Besides, it is difficult for Japanese people to exchange information, and there are few jobs.
It's a full-stack framework, so it can't be helped, but it doesn't have that much speed advantage over other frameworks.
If you use Ajax, it will be blocked if you do not pass the CSRF Token, the problem is that it is sober
--Using Django REST Framework, throw all front ends to Node --Learn English --If the logic part is the bottleneck, throw it to PyPy ――I feel reassured that it is secure
I hope anyone wants to try Django in this article. Also, the range that can be analyzed with my arm is about this, so if anyone can supplement it, please do not hesitate to contact me.
Recommended Posts