Symfony 2 for Django Developers

After 8 years of developing PHP, I switched to python 2 years ago, as far as I liked coding with Django, there are more jobs in PHP than Python in New Zealand (not to mention .NET), I started reading about Symfony 2. I went through the tutorial The Big Picture, and he seems very familiar with Django.

Question: Is there a migration guide for Django developers? So, can this speed up the learning process?

Google's search for "Symfony for Django" returns irrelevant results.

+4
source share
2 answers

I don’t think there is a framework in PHP Django. This is almost impossible due to language features. I respect the opinions of everyone and I do not judge, but I am a Django developer, and I tried Symfony2, and I did not like it. Especially because in many formats there are many configuration files. It seemed to me that this is the framework for creating an application in C ++.

I tried Laravel and was very pleased with this. As happy as you can be with PHP, of course. It uses many of the latest PHP 5 features, configuration files are just .php files (just like Django are .py ) and have very declarative syntax.

The documents are fine, not as large as Django (at that time I did not think that the documents for Symfony2 are fine too), and not to mention the 1.5 mb structure, compared to 70mb +, which is Symfony (with suppliers) .

To answer your question, there is no migration guide (because IMHO it is not possible to conduct direct migration). As a Django developer, you should be familiar with MV * patterns, Symfony2 uses the same approach as the MVP pattern, it will not be difficult for you. In principle, this is the same as Django (far away :) :), you have a model, controller and views. You execute your business logic in the controller ( DefaultController.php by default for each package), you code there a method for each view (usually) that the visualized template should return.

You declare your models in yaml, xml or php with annotations and synchronize your db with them. This creates model objects for you, so you can request them in your controller. As you can see, conceptually the same approach.

Hope this helps! I get a lot of hatred from the people of Symfony2, but that's just my opinion.

Good luck :)

+5
source

No. This is not true.

You will need to work with white papers (which are awesome btw).

+3
source

Source: https://habr.com/ru/post/1487601/


All Articles