Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am an experienced PHP developer (10 years) who has built 3 different custom frameworks for extreme high traffic sites. I have recently started to get into programming a lot of python, usually just for fun (algorithms). I am starting to develop a new site as my side project and wanted to know if I should use a pre-existing python web framework (Django, Pyramids, ect...) or develop my own.
I know things might go a lot faster using a pre-existing framework, but from my experience with PHP frameworks and knowing the amount of traffic my side project could generate, whould it be better to develop an extremely light weight framework myself just like I have been doing for a while with PHP? It also might be a good way for me to learn python web development because most of my experience with the language has been for coding algorithms.
If I do use a pre-existing framework I was going to try out Pyramid or Django.
Also do other companies that use Python for web development and expect high traffic use their own web frameworks or a pre-existing one?
Learn from existing frameworks, I think. The Python web stack (wsgi, sqlalchemy, template engines, full stack frameworks, microframeworks) has spent a lot of time maturing. You'll have the opportunity to develop fast and learn from existing design.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
What are the pros and cons of using Rails but using python scripts for all kinds of operations, including ML (hosting on heroku)? I like Rails, but if Django would be better long-term, I'm willing to switch to that.
I'm hoping that by framing this question as "pros and cons," this fits more into stack overflow norm... if not, I'm sorry. I'd really appreciate help though.
I like rails, but...
What do you like about rails? Rails is great, but what does it offer that Django does not? It's quite common to have multiple languages in one project, multiple languages are complied to the same code. There are libraries like 'rupy' that make it a simple thing to do, if you are more comfortable with rails than django then there is a use case to consider the proposed approach. There are some issues in general, the main will be around what is 'best' architecturally.
In regard to any possible cons, let's try to explore any that may come up when modelling a real-world example:
def init_py_script
parsed_output = JSON.parse(`cat #{file.path} | python3 lib/some_python_script.py`)
end
Why did the author chose to do this? In our model, let's say they outsourced the work the python code is doing due to not understanding how to complete the task in ruby. Maybe they did not have the bandwidth to learn how to do this in ruby and could only find a python developer who could complete the work.
Which is fine, but there some issues here. [Note these issues may/may not apply to you]:
The user has to install different dependencies on their server in order to run both languages, which takes time to understand and debug.
If the outsourced coder uploads the code to another repository; most deployment scripts won't be able to deploy the submodule code and there is manual intervention required.
Maintaining multiple languages on a server is not easy and when upgrading packages, which may cause issues such as having to install multiple 'libssl-dev' packages, which creates more ongoing work.
Ruby and rails is classically driven by TDD. If you solely rely on unit tests, there will be no issue. If you like to incorporate integration tests, it will be much harder to get full coverage.
When writing code, the author should be conscientious of the reader and reducing the cognitive load of future readers and developers to understand what applications are doing. You'll restrict the amount of developers who can work on the entire project going forward if you include more languages as they will have to understand both languages. This may not be an issue if they are working on one small component of the application.
TLDR: It's OK for small projects. Using multiple languages causes infrastructure issues by likely cause version conflicts in the future. Upgrading will likely be more difficult. If you have good documentation and tests, the development of code should remain unaffected.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have Linux Ubuntu installed and I want to code my Flask app in Linux only.But certain tutorials are coding the web app in a VPS.Why do I need a VPS?Can't I build my web app locally and directly host my site on Heroku?
You can host your application in any form you like.
VPS are an abstraction of a machine, giving you all the resources your application would need often at a fraction of the price required to get a physical server just for you. So it may be a good idea to use a VPS for the development and first phase in the life of your website.
You may also directly choose to deploy your website in one of the many cloud providers. Often they will not charge you until you start hitting a certain amount of resource utilization. So that may also be a cost saver.
You can find some additional info about the benefits of VPS here.
Note I am not associated with the website in any way, I just found it to be quite thorough in talking about VPS.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
So I was wondering if there is any Python package that can allow a pure Python application with a graphic interface to be embedded in a website. I have an application with a Tkinter interface that I want to make available on a website. Any way to do this without converting too much code?
Thanks!
In fact, it's possible: GTK3 has a html5 backend named Broadway.
This backend enable to access to an application through a web browser.
$ GDK_BACKEND=broadway your-application
You can see an exemple with python in this video
Of course, it needs a GTK application...
It's impossible.
Python/Tkinter app is a desktop application, which requires desktop manager, has access to file system etc.
Web application is a different stack of technologies (HTTP, HTML, javascript etc), it is not possible to mix them
Yes, this is possible, but not in way you expect.
There is python - to js translation kit, which supports many, but not all, python operations, functions and types.
So you can write back-end and front-end in python.
But using pure js for front-end will give you more performance.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to transfer from using PHP to Python, Im looking to change to Python as it seems a much more versatile language able to work across a range of scenarios. The sort of things i plan to use it for range from web app development (using django), NLP, machine learning and automation using mechanize.
One of the things I really liked about PHP was MAMP, the way it creates an htdocs folder, a localhost:8888 url, and a MySQL server, with pretty much 0 effort.
Is there something similar with Python ? I'm not necessarily looking for a GUI like MAMP (although that would be good) - what are the other options for setting up a local environment?
Python excels in this area, but as with most tools exactly what you do depends on what you want. In particular, you certainly want virtualenv, Python's configuration and dependency -isolation tool.
You may also want a development-configuration management tool such as buildout, but that is more controversial as there are many other great, language-agnostic tools that overlap. (For example, you may want to set up your environment using Vagrant and leave your host OS behind.)
Neither virtualenv nor buildout will set up Apache for you OotB, but you do have the option of installing django, zope, or many other Python frameworks and applications with buildout recipes. There are recipes for apache too, but most Python web development that I know of is agnostic of the httpd, so you might end up not wanting it.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I really like Django. I've fiddled around a bit with Rails, but I personally prefer Django's logic. I also prefer Python over Ruby. Again, personal preferences. Despite all that, I am now switching back to Rails because of Django's lack of native support for databases like mongodb. I saw there was no plan for Django 1.5 to support NoSQL databases.
I've tried to install django-nonrel as it looked promising, but with no success. Even if I succeeded, I can't trust this fork of django considering the lack of active development. There isn't even a post to tell you what version of the dependencies to install, some of which are updating quite fast. So you run into errors that are not well-documented, and it's just an horror.
Django could be a long term investement for me, so I was wondering if there there was a plan to change Django's ORM to support NoSQL databases?
There has been a lot of discussion about this on the various django project channels.
There are a number of side project and forks which allow no-sql functionality on django. There is also a wiki post from the django people which discusses some alternatives https://code.djangoproject.com/wiki/NoSqlSupport so you can use no sql.
So the bad news is: as of yet there is no definitive answer as to whether anything no-sql will be included in the django core. But the good news is there are a number of no-sql options which are supported and being developed.