I have been researching this for a day or two. I am working on a real time application (a chat and a video chat). I am using django/apache combination which I understand is not suitable for this (at least the apache part).
In this regard I found several links from within stackoverflow such as http://www.skitoy.com/p/django-tornado-chat/305 and some comparisons such as the one at http://nichol.as/asynchronous-servers-in-python
My question is. Can someone who has worked on django real time application let me know what framework I should use. It seems that I can use either django on tornado or use django with twisted framework. I am new to real time application and just need pointers so I can save some time.
Some more tips here from people who've done similar:
http://eflorenzano.com/blog/post/technology-behind-convore/
Related
this is - don't slap me in the face - a beginner question.
I have some knowledge in Python and Django, but it is not too overwhelming. I have a very appealing business idea in my head and I made it a challange to see if I can get the nessesary skills to make it come to life.
Long story short, somewhere along the road I want to be able to build an IOS and Android App (or bring someone in who can do it). I also need a homepage for this (Django is a good enough solution for this - this much I know).
As far as I unserstand it, I can use the rest API Framework to connect Apps with the Django Backend. Is this a good solution? Or would you recommend another way to realise this projekt?
Speed would be impartant for the final solution. Also I need good scalability, though, I don't plan to recreate Facbook.
Django REST Framework is brilliant, and the documentation is really helpful (http://www.django-rest-framework.org/), takes a little while to get used to but with django experience its very simple. There is also a short video tutorial(4 videos) by a guy called thenewboston https://www.youtube.com/watch?v=Yw7gETuRKjw which will help get you started.
Hope this helps, good luck with the business adventure
Is Django-nonrel still active? I am interested on developing an e-commerce website that involves tons of catalogs and it seems like NoSQL is the best approach for this. I have background in Django but from what I found out, vanilla Django does not support NoSQL.
Enter the Django-nonrel as the alternative. However I am a bit concerned on the project continuity and community. Django-nonrel is a forked of Django 1.3, does this mean that it us outdated (since current Django is 1.5), or does it has its own circle and version after the fork?
In short, what is the status of Django-nonrel? Active?
This was recently discussed here:
http://www.reddit.com/r/django/comments/1cdrqs/using_mongodb_with_django_whats_the_status/
where the following stands out:
"It does not exist yet. And I'd strong recommend not using MongoDB unless you have a good use-case for it. Needing lots of reads/writes in some parts isn't enough to justify it IMO. MongoDB's read/write performance falls back down to earth once it's put in a real world scenario.
...
Disclaimer: I'm a dev working on a series of MongoDB apps that service hundreds of thousands of users and wish very much my predecessors just went with Postgres."
Yes it is, I am using for a year now and is working fine, the only downside, at least for me is that you can't do contains search.
If you want to change ideas please let me know.
django-nonrel is not active now, I´m testing the last version, it´s a django 1.6.11 fork
git+https://github.com/django-nonrel/django#nonrel-1.6
working with postgre and mongodb as DB engines simultaneously and it works
I'm currently using Django served on Apache (mod_wsgi) for developing my apps. One of my favorite things is to 'fake' async requests with JavaScript's setInterval() function and AJAX to retrieve new data from database. For example:
// javascript
function someFunction() {
// do some stuff
setInterval(function() { fetchNewStuff() }, 1000); // run fetchNewStuff() every second
}
function fetchNewStuff() {
Dajaxice.main.fetch_new_stuff(fetch_new_stuff_callback, {'id':$(this).attr('user_id')});
}
function fetch_new_stuff_callback(data){
// append new stuff to my table, list or whatever in HTML page
}
As far as I am aware, this is perfectly fine for my needs. However, as my apps are growing bigger and more complex, this will eventually become too much hassle for both, my server and my clients, no matter how much I try to minimize transported data. Also, I cannot settle with the thing that in today's world I'm still 'faking' this :) So, I'd like to find some 'real' solution with push capabilities for my current and future projects.
I did try to google my problem and I have found many interesting stuff (Tornado, Nginx, Node.js, Twisted, etc.) but most of tutorials/articles/blogs are at least 6 months old and I believe that many things changed in that time. So far, I have tried to test Tornado and it was successful test, but I had some problems with setting it up on my production server. I also tried Node.js which is extremely simple since I know JavaScript very good, but then again, I'm not sure if it is a good solution.
My question here is - what would be the best thing (server, platform, framework, whatever) to implement in my current and future apps depending on this conditions:
easy to use (e.g. Node.js could fit in here)
eliminate 3rd party stuff as much as possible (some out-of-the-box solution, e.g. Django+Websockets and that's it [this was really just a silly example])
good documentation in use with Django (it would be perfect to have some real examples with my new technology and Django since I'm pretty much n00b for web servers and related stuff)
has a good perspective and future (I'm really looking to learn something which I will use a lot and which I wouldn't have to re-configure very often)
Thank you for your thoughts and any kind of help about this (links to some good, recently updated readings are more than welcome :)
You should have a look at django-socketio project, a Django app providing the features required to use websockets with Django via Socket.IO.
It uses gevent library along with socket.io.
I had this idea of creating desktop apps using django. The principe being:
- Write the django app, and use something like cherrypy to serve it.
- Write a Qt app in C++ to access it and this by using QtWebview (webkit)
I'd like to "bundle" this in a single app. The lighter, the better :)
So here are my questions and if you have better ideas and suggestions, please
share them :)
Is it possible to serve a django app with a c++ one? (a c++ server embedding python)?
anyone did this before? Do you have some articles, blog posts?
Thanks a lot!
Django has it's own server. Why involve CherryPy?
You're creating a hellaciously complex architecture for no recognizable purpose. Your comments are almost impossible to parse in the context of your question. Please consider rewriting the question to address your actual concerns with an actual thing you actually wrote.
"I ... used pywxiwdgets in the past and it was SLOW"
There are many of desktop frameworks. Use another one.
Don't introduce Django -- it's for web applications, not desktop applications. The overhead of messing with Django and CherryPy is silly.
Find the original reason for SLOW. I'll bet it was database slowness from using SQLite. If not that, I'll bet it was a poor data model. If not that I'll be it was poor use of the pywxwidgets. If not that, I'll bet your desktop app made internet connections that were slow. Indeed, I'd bet that almost any part of your app was the culprit and making a super-complex architecture will not make things faster, just more complex.
Until you identify -- and measure -- the original cause for slowness, you're not actually solving the actual problem you actually had.
Look at http://www.python-camelot.com/
It says "A python GUI framework on top of Sqlalchemy and PyQt, inspired by the Django admin interface."
Pyjamas Desktop can probably be integrated with Django. And there's no need for C++. It currently uses pywebkitgtk, but I don't think there's any real reason why it couldn't use PyQt4 instead with a bit of work.
Use PyQt or PySide instead of C++.
you can use electron-api-demos this opensource
and Now this technology is considered the bright generation, so one of the most famous people who used it is YouTube and Visual Studio Code
https://github.com/electron/electron-api-demos
I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.
Some things I'm looking for:
It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.
The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.
I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app).
Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.
I would go with Wt because:
You already know C++
It has a nice layout system, so you don't need to know lots of HTML
It is very well written and a pleasure to code in
Your deployed apps will handle 50 times the load of the python app on less hardware (from experience with pylons apps, 10,000 times the load of a plone app :P)
It has all the libraries that the guy in the first question says it doesn't and more
In built development webserver
Templating language
ORM
unit testing help
open-id and user+password authentication
A brilliant widget library
Web 2.0 isn't an after thought; it wasn't designed on a Request+Response model like all the python frameworks (as far as I know), but on an event driven interactive model.
It uses WebSockets if available
Falls back to normal ajax gracefully if not
Falls back to http for browsers like linx
It is more like coding a gui app than a web app, which is probably what you're used to
It is statically typed and therefore less error prone. Does def delete(id): take an int or a string ?
The unit tests (on my apps at least) take 10-100 times less time than my python app unit tests to run (including the compile time)
It has a strong and friendly community. All my email list posts are answered in 0-3 days.
If you'd like to avoid writing HTML, you could try GWT. However, in my experience, using an intermediate framework to generate HTML and ECMAScript never works anywhere near as well as hand-writing the pages.
[edit] nikow mentions in the comments that Pyjamas is a port of GWT to Python.
Regarding the language, if given the choice between C++ and Python I would pick Python 100% of the time. Even ignoring the obvious difference in abstraction between those languages, Python simply has more useful libraries than C++. You don't have to write your own development-oriented web server -- Django comes with one. You don't need to write a custom template library -- Python has Genshi. Django comes with a capable ORM layer, or for even more control you can use SQLAlchemy. It's barely a contest.
Django is good point to start web development it is great framework
If you look for C++ take a look on CppCMS, it is much more close to Django, it is not like Wt that mimics Qt.
In any case, it is really depends on your needs. C++ can be used for embedded or high performance web applications, but for medium range web sites Django would be better. (and I'm developer of CppCMS)
I think you better go firt python in your case, meanwhile you can extend cppCMS functionalities and write your own framework arround it.
wt was a good idea design, but somehow not that suitable.
If you are exploring Python frameworks (based on the excepted answer I think you are) I think you really owe it to yourself to check out CherryPy. When you write CherryPy apps, you really are just writing Python apps. The framework gets out of your way in a real hurry. Your free to choose your own templating, ORM (if you choose to use ORM), etc. Seriously, take 10 or 20 minutes and give it a look.
The only reason you might want to use C++ over Python is when speed is paramount.
If this is going to be your first web-app, you'll probably be ok with just Python, and your development speed will be orders of magnitude better than with CPP.
Django's templating language is far from powerless, to me it actually seems very pythonic. You actually can write pure python in a template(although this is generally not recommended).
Even better, it's possible to replace Django's templating system with the one you like.
My personal favourite language for this is HAML.
Here's some data on this:
Is there a HAML implementation for use with Python and Django
Having looked several ones, like django, pylos, web2py, wt. My recommendation is web2py. It's a python version of "ruby on rails" and easy to learn.