Quickest/simplest backend for angluarjs? [closed] - python

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
I am learning angular.js and would like to have a backend to experiment with. What is the quickest/simplest backend I can setup on my development machine? Is it python cgi? I have Apache running.
A bit of context: I do plan an production application and started to do it in Django (I know a smattering) but I thought I would look at angular.js first. For the project, I will have to query a mssql database (I can do that with python). I hesitate to mix Django and angular -- seems like a wreck waiting to happen -- but maybe that is the best way to go.
I have used an ajax connection to a python cgi script in the past, so I thought that might be the simplest way to go. (Some encouragement here for Django: Angular JS and Django)
Too bad angular doesn't come with a simple backend! (or does it?)
Any suggestions?
PS: http://popdevelop.com/2010/03/a-minimal-python-websocket-server/ describes a websocket. Is that a possibility? (Looks neat!)

I would recommend Flask. It is a web microframework (meaning it does not come with a lot bolted on). You can extend it with extensions like flask-sqlalchemy which can integrate with mysql. It also has a built in developer web server so you can jsut do python myapp.py get it going (for production you will need to use apache/mod_wsgi or something like gunicorn).
The docs are easy to follow and there is a brand new book on it.

I'd look into Bottle if you want to go the Python route. I don't have much personal experience with it but from what I've heard it's very light weight and easy to get started with.
Node is a common backend for an angular app and it's also very easy to get started with.
Lasted I'd try out Firebase. It is a backend-as-a-service so it doesn't get much simpler than that. There's also an example of using it on the angular home page.

We have been connecting AngularJS and django and it tured out to be really easy. In django you have http://www.django-rest-framework.org/ which really simplifies creating REST APIs.

Related

Django and Node – how does it work? [closed]

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 7 years ago.
Improve this question
In order to make an web application with RESTful capabilities I have read and watched tons of articles and videos and I still do not get a complete picture of how it works. And which I should chose. Every other answer is the not helpful ”it depends”. I have boiled it down to a first choice between Django and Node. But nowhere I find the whole ”picture” of how the pieces works together and which modules are needed. Therefore I have tried to put all into a rough illustration. Note that I am a complete newbie on this.
I develop an ERP application with accounting modules. Basically it is mainly about CRUD besides viewing diagrams, printing and storing documents. So this is the ”it depends”
The only thing I have managed to make decisions about is to use nginx, Postgresql and Debian 8 as tools/os. These are the fixed stars.
My questions are not really the common Django vs Node.js and it is not just an opinion I want:
Is the picture below correct? Any comments?
Is there any further components that will be needed? To get started?
You have a lot of questions - and on StackOverflow there should be one question that can be answered without generating a lot of debate or have opinions rather than facts.
As such, I think your question might be closed as "too broad"; however I think it deserves an answer.
I am not going to say "it depends", although that's really all it boils down to - but here is my attempt to explain it.
nodejs is a runtime. It is an environment which allows you to develop code on the server using javascript. In order to do anything useful with nodejs, beyond "hello world"; you'll need to use a framework, and there are tons of those around and various stacks have been developed by the community to tie in all the components together. An example of such a stack is MEAN, which is MongoDB for the database, Express for the framework, Angular to assist with the front-end, and Node to run it all.
django is a framework - it is not a runtime. This means that it is one step removed from the node world. The runtime for django is Python. django also is not a "stack" like MEAN, you can develop your own stack on top of it - but since django is a "batteries included" framework, you only really need to add a database to it - it includes everything else you need.
REST is just a way of designing web-services. Its not a language, or a platform or a library. Its a set of rules that describe a way to design APIs such that they take advantage of the semantic verbs of HTTP.
You can use any library and programming language to develop a RESTful service. All you really need is two things [a] a library to communicate over HTTP [b] a way to serialize data, preferably in JSON (but even that's not a requirement).
nginx is just a very fast webserver and a reverse proxy. The reason it is mentioned often - is because it is very expensive for a framework to serve static media. All requests to a framework (either in django world, or in nodejs world) have to go through a large chain of components that help decode the HTTP request and create a data structure that is easy for developers to use. This chain of components is often called middleware. Since each and every request has to go through this middleware, it is better for performance reasons that requests that don't need the "power" of the application to execute (like a request for an image, a stylesheet, a video file) be handled by something else. This is what nginx is used for, since its a very fast webserver.
Now that those are explained, you need to see what stack works best for your application. To do that, you need to know a bit about the philosophy/justification or problem that each stack is trying to solve.
For django - this is easy. Django was created by a team working on multiple newspapers to help them manage content that was published on different sites. As such, it is designed so that the management of content is of primary concern. That is why it has a very robust administration console as a standard component; and a built-in quite robust ORM and its own templating engine. Django leaves it up to you to figure out how best to actually run and deploy it; although they do provide a lot of suggestions and examples - but in the end, its upto you to decide which database to use, which web server to use, and how to deploy the application.
In the nodejs world - the primary focus is nonblocking I/O and speed of response. Nodejs excels at being able to serve a lot of simultaneous requests on limited resources. Therefore, it provides you a very powerful foundation to develop applications that need to quickly respond to requests ... and that's it. When you program in node or any other specialized lower-level library, you need to make sure your code is taking complete advantage of the library. So, if you start writing blocking code in node, you'll find that the performance that you expect hasn't been achieved.
nodejs doesn't care what the application actually does. Think of it like a very fast, very powerful tool. You can build anything with it, but you need to know what the tool is designed to do best in order to know when to use it.
nodejs has you working at a lower level - which is why there are a lot of packages that help you do all sorts of things with node; and multiple ways you can take components and create your own stack - depending on what you are building on top of node. Think of it like Lego building blocks.
nodejs and django are not mutually exclusive. You can utilize both in your application and exploit their strengths and take advantage of what each does best.
As far as your specific questions:
Did I get the picture? Any comments?
I don't know. Did you?
Is there any further components that will be needed? To get started?
The answer to this is yes, because you don't want to build everything from scratch. Each stack has its own libraries components for developing services. For django, there is django rest framework (DRF).
Which framework are best for CRUD?
Which framework are best for RESTful? Any other module needed?
Best report generator for printing?
Best diagram tools?
There is nothing that is "best" for anything. This question is just asking for opinions. Its like asking, what is the best fruit juice?
Which framework are fastest and most reliable for CRUD using Postgresql
People have developed many robust applications on top of postgresql; however as nodejs is bound to javascript - there is still a lot of work being done in this area.
Can I lock the library (trade secrets) in both environments?
Yes.
Is there better tools for creating ERP/Accounting?
ERP and accounting are two very different things. There are tons of accounting packages/applications written in Python. There are very few ERP systems written in Python.
You cannot combine the two and lump it together.
What is the benefits using Angular on top of Node.js?
The same benefit of using Angular on top of _____ (insert your favorite backend). Angular is just a front end library.
An anecdotal benefit is that both Angular and Node use the same programming language.

Python and Neo4j - creating a RESTful API [closed]

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 have spent quite a bit of time researching the different Python frameworks for neo4j (i.e. neo4django, bulbflow, py2neo), and have been very impressed at how they are able to abstract the functionality to make it feel like working with familiar relational databases. The question I have is around setting up a stack that allows for some of this abstraction for things like model creation, oauth, and basic querying but to incorporate graph-based algorithms for data analysis, more detailed traversals and path finding, etc.
Is there a recommended or tried approach for creating a robust RESTful API with the available libraries and capabilities of Django, and the freedom to drop down to the lower level neo4j API when necessary? Having some control over the cypher queries would be great, but I don't want to re-invent the wheel if something like neo4django has already implemented the basics very well. It is a bit daunting deciding how to set this all up from scratch, and there seem to be a lot of possibilities, so any advice is greatly appreciated.
For example, since py2neo is built on top of the neo4j REST API, and I then use it to work with Django and Tastypie as a separate REST API, which is accessed by a mobile or web app, do these layers of abstraction get redundant or even start to take away from the usefulness? Again, any input from people who have worked with graph databases and python is definitely helpful.
Thanks!
EDIT:
I would also really like to take advantage of some of the neo4j libraries out there, such as spatial, so the extra abstraction in some of the existing solutions may be counter-productive -- again, I'm not sure though!
Both Neo4django and Neomodel are built on client libraries (neo4jrestclient and py2neo respectively) so you can in theory drop down to lower level functionality with either of those projects as required.
I also built a (very basic) Object-Graph Mapping module for py2neo which is intended to be a base for custom object mapping layers. In light of some of the big enhancements in Neo4j 2.0 though, I have a number of improvements planned for this module as and when I get the time.
I was debating with myself if I should answer as the repo and the python package is outdated but I guess more information is better.
Here is a repo where Django is used with neo4j-embedded. I went this way to be able to build what ever REST API I wanted (tastypie) and use the very fast embedded db.
That said, as Neo4j approaches 2.0 I would think twice of investing to much in the embedded db and Python. Neo4j's REST server seems the way to go.

ESB for Python? [closed]

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 9 years ago.
Improve this question
At work we're debating choosing an off-the-shelf full-stack ESB (Enterprise Service Bus -- http://en.wikipedia.org/wiki/Enterprise_service_bus ) versus rolling our own around an AMQP system such as RabbitMQ.
Part of the concern is that our ecosystem is PHP moving as fast as possible to Python, and what APIs we already have all pass messages in JSON. The search space on ESBs and 'SOA solutions' is really, really polluted; either that or this just isn't a Python Thing(tm). Thus I ask here: it seems that all full-stack ESB solutions that we've considered are primarily focused on integrating SOAP-based components. That seems like a lot of double wrapping and unwrapping of messages that we may not want to do. Also, we'd really like to write our service-to-ESB adapters in Python if we can.
I should note here that the PHP/Python ecosystem is internal -- many of our clients are fairly hidebound organizations using big monolithic enterpriseware with which our apps integrate. They would be happy with SOAP, XML-RPC etc for our customer-facing APIs. We've already had requests. So, at the border, we may end up eventually providing both JSON-based and SOAP-based services; just not internally.
tl;dr: Does anybody have a favored full-stack ESB for use with Python apps? What about a non-favored one that you've worked with (and how terrible was it, anyway)? Do you think that wrapping something like RabbitMQ is a better idea for a PHP/Python ecosystem?
It really is a big question, more like a couple of questions in one, if I may. So please excuse me if I misunderstood you.
An ESB is, by definition, not really coupled to your choice of language in implementing your applications. So no matter if your apps that you want to connect in a SOA manner are written in PHP or Python, you should be able to expose them in a SOA. JSON on the other hand is a bit of an off choice in the SOA world and this choice is really important.
Many of the COTS ESBs offer some level of REST support. Mule, ServiceMix, WSO2, JBoss are some open source ones. If you prefer to go with a commercial vendor I believe Tibco and Oracle have either out-of-the-box support or can be implemented with a bit of coding.
Your choice of using any of the message brokers such as RabbitMQ or AMQP is really about the transport - which is once again not really directly related. Then again, if your goal is to add messaging among your applications it is a valid question which I cannot really answer.
If you can write your main motivation for your interest in an ESB it would be helpful for a better answer.
HTH
Wow...that's quite the question, and there's no way that I can answer it fully...but since you asked here's the proverbial 2 cents:
RabbitMQ is pretty good. I'm using it for real-time messaging in a multi-agent system that implements caching on a scientific computing grid. One of the nice features of RabbitMQ is that you can push arbitrary (including binary) messages, which might be a nice feature for performance. (Perhaps using the serialization / deserialization from the Hessian protocol?)
My only concern with RabbitMQ would be the continued support of the python libraries for AMQP. The current libraries are functional, I've used them...but they haven't been around long, and I'm not sure how big the community is that's interested in and supporting such work. That said, it seems like RabbitMQ (AMQP, and messaging in general) are becoming a hotter topic as of late, and hopefully that would broaden the base that's working on the python - AMQP interface libraries.

Python Web Framework for Small Team [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have 4 days off and I will use this time to rewrite our RoR (Ruby on Rails) Application in a python web framework just for fun ;-] (and why not make the switch, RoR is great but keep changing all the time, can be exhausting.)
I don't know the python web framework very well, I've glad web.py, django, cherry.py, pylons/pyramid and few others. Our requirements are (put everything can be irrelevant) :
MVC (Strict or not)
Small Team (2-3 people included one designer)
Fun to use
REST support
Multilevel caching (DB query, page cache)
Nginx Support (X-Accel-Redirect File Download)
Heavy traffic (1,200,000 ~ views)
Urls rewrting (Multi-domains support not only subdomain)
Not a problem if it's not hype
Not a problem if there is no plugins
Either SQL or NOSQL (can be fun to try NOSQL)
So what you would advise ?
I think most of the big frameworks will fit your requirements so maybe you might look at it from the perspective of the app you are writing. How much do you want to work "out of the box". Will you need user management? Will you need an admin panel etc.
I use Django and it's great when you don't want to rewrite a lot of boilerplate. It can be a bit tedious at times trying to bend it to do what you want, but once you get your head around it's intricacies , you can get things done very quickly.
With Django anyway:
MVC (Strict or not)
Not MVC, but similar > http://www.djangobook.com/en/2.0/chapter05/#cn16
Small Team (2-3 people included one designer)
not sure how the framework will effect this, but yes, it's quick to develop on your own or with a team via version control
Fun to use
well there's a lot of great documentation, so less time is spent pulling your hair out, and you can get going very quickly which is nice
REST support
Yes, as a library: > https://bitbucket.org/jesperndjjango-piston/wiki/Home
Multilevel caching (DB query, page cache)
Yep > https://docs.djangoproject.com/en/dev/topics/cache/?from=olddocs
Nginx Support (X-Accel-Redirect File Download)
Again, not sure this is relevant, but yes. I use nginx with UWSGI and it's very quick
Heavy traffic (1,200,000 ~ views)
Yes > Does Django scale?
Urls rewriting (Multi-domains support not only subdomain)
Not sure about this
Not a problem if it's not hype
It's no node-js, but again, lots of really good documentation
Not a problem if there is no plugins
There are .... my god there are
Either SQL or NOSQL (can be fun to try NOSQL)
SQL out of the box, but NOSQL is supported > http://www.allbuttonspressed.com/projects/django-nonrel
In addition to the other frameworks mentioned (which are all good options), you should check out web2py. It's a feature-packed, full-stack framework that's very easy to set up, learn, and use. It was originally inspired by Ruby on Rails, so if you're rewriting an RoR application, you may find it more comfortable than some of the other Python frameworks. Here are some details regarding your requirements:
MVC:
http://web2py.com/book/default/chapter/01#Model-View-Controller
REST support:
http://vimeo.com/21133657
https://groups.google.com/d/msg/web2py/gcqEcXIo7RI/I8BhkK0G_XUJ
Multilevel caching (DB query, page cache):
http://web2py.com/book/default/chapter/04#cache
http://web2py.com/book/default/chapter/06#Caching-Selects
Nginx Support:
http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
Urls rewriting:
http://web2py.com/book/default/chapter/04#URL-Rewrite
Not a problem if there is no plugins
Plugin documentation
plugin_wiki
Plugins
More plugins
Appliances
Slices
Either SQL or NOSQL (can be fun to try NOSQL)
SQL support: SQLite, PostgreSQL, MySQL, Oracle, MSSQL, FireBird, DB2, Informix, Ingres, Cubrid.
NoSQL support: Google App Engine, CouchDB (partial), MongoDB (partial)
Easy to add additional database adapters (SQL or NoSQL).
The framework is under very active development (new releases every 2-4 weeks), yet is committed to maintaining backward compatibility, so existing apps won't break upon upgrade. If you have any questions, you'll get lots of help from the friendly and responsive mailing list.
I would recommend DJANGO or TurboGears.
I don't think you can go wrong with any of the major web frameworks. Personally I've used Django the most and would lean that way, the ORM is really great and it's philosophies/design are closely aligned with my own personal preference. However, if you wanted to go a different route, bottle is a really fun lightweight microframework, I've found it a pleasure to develop with. If you want to go the NoSQL route, MongoDB has great Python support. PyMongo is excellent (and the recommended way to use MongoDB from Python), MongoEngine is a nice little ORM (if you care for that sort of thing).
Of the frameworks you've mentioned, Django has the most momentum and is most likely to fit your ideals of a framework, coming from a Rails background. By this I mean it has helpers that allow you to generate your forms quickly, though no scaffolding. (In fact, Django's way is a little better than scaffolding in Rails because you can use all or just pieces of it)
It has a good ORM with lots of helper methods and, one of the best features, it has a fully functional admin interface once you define your models. You can start porting data even while the site is being developed.
It also provides excellent user support, including permissions, access control, groups, user profiles.
It's easy (and fun) to create your own middleware and context processors that let you abstract out often reused pieces as plugins to the framework.
The only feature Django doesn't have that you specified above is the NoSQL support. And this is only half true. If you want to use a non relational database for some parts of your app, such as session storage, you can. If you want to use it as your exclusive backend you'll lose some of Django's awesome features unless you patch Django with django-nonrel.
I've used turbo gears which is a combination of several of the other options you mentioned. That community has some great people in it but they're currently experiencing a major architecture revamp and honestly, they're just not getting as much developer attention as Django.

webapp, tipfy or django on google app engine [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
which one are you using on google app engine?
what were the reasons behind your decision?
Tipfy
It's developed as an extension to webapp, so it's just one abstracted layer.
That abstracted layer is very minimal. Methods have the same or similar names to their webapp counterparts, but with useful extras that you'd probably end up coding yourself.
Simple routing; if you're familiar with Django or web2py, tipfy's routing is a huge step forward.
Finally, tipfy has an excellent support community. Rodrigo Moraes is especially helpful and engaging. Questions are answered very quickly, and courteously.
Although I mainly work with Django for larger work related projects (hosted elsewhere) I've tended to use webapp for things on App Engine. App Engine to me is best suited for small webservices that you then link together into a full app, and webapp suits that usecase pretty well. Small hacks as well I always use webapp just for simplicity and speed of development. Examples imified-demo.appspot.com, gitbug.appspot.com and github.com/garethr/appengine-image-host
Downside is tool support, you probably have to hack together little things to make your life easier that already exist in the Django world (eg. a test runner http://github.com/garethr/appengine-testrunner)
Anecdotal evidence from a previous project made me feel like Django was a little slow on App Engine for my liking.
Tipfy sounds a good idea, hopefully a case of App Engine maturing as a platform, although I have no personal experience with it at this stage.
All things considered it depends. A big project with multiple developers should probably opt for Django. It's standard ways of doing things will make life easier for everyone. For one off projects I personally prefer webapp or similar. But set aside some time for building your own tools as well as writing your application.
Imho..
Django - the only part that's relevant is the templating and maybe the no rel..
Webapp - never tried it after
Tipfy - is what I'm using, seems to be more "pylons" like, has a basic apps/modules structure and lots of "helpers" which quite frankly should be in the google.appengine.api
Easy to implement templates and routing is nice. Your pretty much left on your own on how to use tipfy and how to structure the application.
I'm still investigating, but I think webapp and tipfy will be a lighter framework than django. Right now, I am using just webapp and the cold start times are already too long. I want to use tipfy for sessions and keep everything else in webapp.
What are you trying to optimize for? Speed of development? Easy of programming? Obscure middleware?
I would still prefer Django for its structure and a high support available over internet for it and for the following reasons:
Webapp offcourse is light weight, but
Django comes with a nice structure
which saves a lots of time while
working on a large application.
Google app engine does provide a good
document for working with Webapp but Django has
a large community of programmers and
thus proves to be a better choice for
implementing some complex
applications.
Django provides a default admin
panel, which otherwise would need to
be created in Webapp, though Google
app provides an admin interface but
that is not equivalent of a full
fledged customizable admin panel.
Webapp itself follows Django for its templates.
I use webapp2 which is a derivative of tipfy (in fact the functions and docs are in many cases identical) and takes ideas from other frameworks too. I recommend taking a look at some boilerplates if you are starting a new project and want to get a quick feel for the framework. Take a look at this boilerplate i've been working on with coto if you are interested in webapp2: http://github.com/coto/gae-boilerplate

Categories