About website development

the problem is like this. I have learned that Python has a foundation, but now I need to develop a medium-sized website. It is very tangled between the two. Many people on the Internet say that the speed of Python is too slow. How does, Python web compare with php? Should you choose php for development or Python flask/django? Ask the boss to show the way QAQ

Aug.18,2021

what you can use. Whether it is suitable or not is not a question that you can consider at this stage. (you can't even do it, so why think about how you can do it better?)


this question. Both php and python can meet your needs, and of course you have to do it in your own most familiar language. And the performance gap is not so great that it will not be the bottleneck of your website. Even if a performance problem occurs later, there are many ways to solve it.


php is the best language in the world


I personally prefer that python,php is not much faster than python. It is estimated that with the same logic, the difference between py and php is only a few hundred milliseconds, which is imperceptible to customers. If real-time requirements are high, don't use interpretive language. Java is the first choice.


A little nonsense is a way of thinking.

what you mentioned is a medium-sized website, that is to say, it can't be done in three or five days, it may take dozens of days, and your problem also shows. You don't seem to mind the time it takes to learn php. Otherwise, there is nothing to do with php or python. Similarly, you did not mention your programming experience. I also speculate that, according to the problem, your programming experience is not rich.

to say this is to show that I am worried about the first place. It is not a simple thing to develop a website. Writing code is only the easiest part of it. As other respondents said, this should not be considered at this stage. The first thing you should consider is what the website should do, and so on. Of course, should you first step on the left foot or the right foot? If you don't have web development experience, you can only learn the language first. There's nothing you can do about it.

now when it comes to the issue of speed, python is indeed a bit slow. If you develop a website for the first time, I suggest you use django, to help you fully understand web development. You don't need to use flask, "there is a plug-in to achieve this function", and you don't need to use tornado to show "what am I doing?" You just need to have peace of mind to configure the route, write the logic, and be ready for html,. The framework does a lot of chores for you.

< H2 > so how slow is django? < / H2 >

to tell you the truth, I am not happy, but it may not be correct to say that he is slow.
Django is slow in concurrency. Entry CVM may only handle hundreds of requests per second, or even less than 100 requests per second.
100 per second, a day is more than 8 million, of course, if the peak is 100, then there will be hundreds of thousands of visits every day. So generally speaking, this concurrency is not a bottleneck, and websites that can reach 10 are already happy.

the speed of a single request cannot exceed 1 second. The bottleneck usually lies in the database. Requests that do not involve database operations are basically at the 100ms level. When it comes to the database, it is generally no more than 500ms. It is not much worse than any other language.

many people say that python is slow, indeed slow, which is the difference between display 144hz and 240hz. Do you think there is any difference between the two? Of course, but most people are happy to watch 60hz. It doesn't make much sense to discuss how much worse 144hz is than 240hz. It's perfectly enough.

my idea is that python is fine, but if you consider more external factors, python will lose its position a little bit. For example, for career development, web developing python can be considered one of the worst choices, far less than languages such as java,php,cPP,Golang. When we recruit web developers, we always pay more attention to the understanding of the development itself, and the mastery of tools is secondary. It is better to write code slowly than to write wrong.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7bbd6a-15d44.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7bbd6a-15d44.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?