Django API Rest Framework - django

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

Related

Learning django with "Django from the Ground Up": Outdated?

I've discovered this excelent series of video-tutorials, the "Django from the Ground Up", but as it was uploaded on 09/08 I was wondering if it's still worth going through it or I will teach me and "outdated" way of working with django.
What do you think?
thanks in advance,
Ignacio.
I haven't watched the video, but I suspect it's out of date.
If the tutorial is from 2008, then it's probably based on Django 1.0. As I write this is 2012, the latest version is Django 1.4.
Django is pretty good at not breaking things between versions, however there are changes you have to make to get a 1.0 project working in 1.4. If you're new to Django, you might end up wasting a lot of time struggling with the changes.
Although I personally don't know "Django from the Ground Up", I would not suggest using 2-3 year old tutorials about in-depth parts of Django.
A large part of Django is still the same (forms for example), but a lot of cool things have been added/modified in the Django ORM and Django Admin. So it really depends on what you're learning. If it's a simple part or just an initial look than it would probably be a good starting point.
If you want in-depth knowledge than you will need something more recent.
I think teamtreehouse has some django videos (though I have never seen them), but I would suggest you purchase the django book written by the django creators "The Definitive Guide to Django: Web Development Done Right". But be sure to get the second edition. You should also take a look at "http://harry.pythonanywhere.com/tutorial/1/" he has some very good tutorials you should work through. If however you really want videos try http://www.youtube.com/user/programmersbook he has has whole collection of django tutorials. The only downside on these is that the first 16 videos have no sound.
Anyway's good luck with django!

What is a good tutorial for Django other than the Django documentation? [duplicate]

This question already has answers here:
Closed 11 years ago.
What is a good tutorial for Django other than the Django documentation? I need a tutorial to get some expertise with Django.
I don't know your background, but I would have liked someone to have told me when I started with Django to go over the basics of programming for the web. It's quite different to programming normal desktop applications. I learned a lot of things the hard way. (Even simple things like HTTP/POST/GET, the difference between desktop patterns and web application patterns, etc.).
It's important to understand what Django is, and what it isn't. It might be a nice idea to try a very stripped down framework (like Flask for example) in tandem, as it will highlight the 'heavy lifting' Django takes care of. Django abstracts a lot of things meaning you don't have to worry about them. While this is great to start with (you don't have to worry about sessions, authentication, etc.) you will eventually find yourself having to come to terms with them.
Furthermore, I probably should have sat down and learned Python before diving in.
Once you have the basics, Django is quite straightforward; the easiest way is to attempt a simple starter project, that is, a blog, CMS or something similar.
I think you should check out The Django book (2.0). This is the perfect second tutorial as it covers much much more in the same fantastic documentation style. It's also green.
There's also this list of tutorials on the djangoproject.com wiki but it's kind of outdated.
Beyond the Django book, I just started building stuff and googled the problems I ran into.

Django or Zope?

I want to create a website and I am confused which web framework to use. Please recommend me which framework is better: Django or Zope. I am using Python.
If you mean plain Zope2 by zope then I'd go for Django. Most interesting stuff in the Zope world takes place with either Plone or Grok (which is Zope3, which is actually quite different from Zope2).
Grok works nice with relational databases, Plone doesn't really, so if you depend on an RDBMS, either go with Grok or Django.
Zope and Plone have a rather steep learning curve so you'll get started more quickly with Django.
The largest downside about Django is, in my opinion, that it tries do do everything by itself (templating, object publishing, ORM, and so on) while there are many excellent existing components out there. If you want to be able to use your code / knowledge outside of the web framework you're using, consider Pylons or BFG
Many options, no clear answer, sorry :)
I have no idea what sort of website you're trying to create, so it's hard to recommend a specific framework.
I'd recommend getting through some tutorials to see which one you like best (There's also pylons and TurboGears to pick from).
Django seems to be the most popular starting kit these days though.
If your website is very hierarchical and needs fine grained permissions, I'd use Zope. (Don't use Zope if you intend to store your data almost exclusively in an SQL database.)
If you have large datasets that can be put into (sql)tables and need many forms, I'd use Django. (Don't use Django if you need very fine grained access control, and hierarchical data)
You see: both have their weaknesses and strengths (although I am only developing in Django these days. The Zope community seems to be a bit in dispute these days about the way it should develop)
Zope is dead. As is TurboGears, Pylons, BFG, Repoze, CherryPy etc.
Active and popular Python web frameworks include:
* django
* flask
* bottle
Big, medium and small. Take your pick.
Here is a good comparison of Django and Zope (and Rails)
http://cd-docdb.fnal.gov/cgi-bin/RetrieveFile?docid=2715;filename=Comparison.html;version=3
They preferred Django. I, personally, use Django too, so I don't know much about Zope.
Another good thing about Django is that they have very good documentation (though I don't know that of Zope). Many people praise that very much.
Also I found Django quite easy to use, and also they have a ready 'administrator panel', which allows quick web-oriented site management from the first steps. More important for me, however, is its fine integration with python and the simple organisation (in the link above they complained that Zope uses very much of its own features, while Django is closer to pure Python).
If you are starting from scratch I will suggest you should go for Django. You will get lots of features and suppost from django. Easy to debug and best suited for rapid developement. In the other hand, You should only choose Zope, if you have experienced developers familiar with Zope or have existing projects based on Zope and the cost of switching is too high for the potential value gain.
In zope's website it self it is written, It is no longer recommended to start new projects based on it, unless you are intimately familiar with the technology stack.

Learning Django as an experienced ASP.NET developer

I am quite aware of the MVC concept, though I have never developed anything bigger in ASP.NET MVC, but I have been developing ASP.NET pages for years now.
So is there any good tutorial or even better: a book that is suitable for an ASP.NET developer and does comparisons? Especially I am looking for information on Django reusability/how to deal with components, etc.
Regardless of your background, if you want to learn DJango, try the free online Django Book.
I'm not aware of anything that will specifically compare ASP.NET code to Django/Python. There are a bunch of good books though. Practical Django Projects 2nd Edition by James Bennett is an excellent book. It has a couple of example applications you can build.
There's also Pro Django by Marty Alchin that really gets into some of the guts of Django. There isn't any "tutorial" kind of information here. It's more just an extension of the documentation.
Both of these books talk some about reusability in Django, but they don't dwell on it specifically that much. One of Django's design goals has been to keep things modular and reusable. Because of this, there are a lot of mostly plug and play apps that you can drop into your project.
Once you get a little bit familiar with how Django works, you should check out Virtualenv and pip to manage each of your projects. It helps out a ton.

Should Django be used for large, complex sites?

I've recently used Django for a very small CMS-style website. I was so impressed with how quick and easy it was to develop a Django project, that I'm now considering using it for a significantly larger project.
However, before I get excited about the idea, I just wanted to run it by someone who actually has developed a very large Django website (with many features, and high traffic).
Baring in mind that recently I have used mostly C# Asp.Net - Are there any pitfalls I should know about?
As mentioned, it really depends on what "large" and "complex" actually mean. If you're planning on building another eBay, the answer is "probably not".
This question is asked a lot. Frankly, there are plenty of answers out there. This thread is pretty good. There was also a very well attended presentation at DjangoCon this year on Scaling Django. It's up to you to architect your site so that it scales, regardless of what technology you use.
My answer would be: If your site is going to outgrow Django (or any other framework, for that matter), it's huge success and you'll probably have enough capital to hire a gigantic team to rewrite the entire thing.
It's going to depend a lot on exactly what you mean by "large" and "complex".
As far as "complex", take a look at Pinax. Tons of features all built out of simple Django apps hooked together and it's still considered a framework that you would use as a start towards building a social software site. But I'm sure you can still come up with some version of "complex" that doesn't mesh well with Django's architecture.
Handling large amounts of traffic and large datasets is a different matter. Ultimately, if you get large enough, Django's not going to handle it. But really, neither will any framework. Jacob-Kaplan Moss (one of the django devs) has a great article outlining the history of web development that led up to where Django is. He makes a pretty strong case for why Django or any other framework can't excel at both rapid development and massive scalability but why it's still worth starting with one. Basically, no two high traffic sites are going to have the same scalability issues: they will all need a custom approach that's specific to the exact type of data and traffic they have to deal with. But since it's hard to predict exactly where those bottlenecks are going to be, it's a good idea to start with a rapid development framework and start replacing components when you encounter the need.
I found this quite interesting to read: http://softwaremaniacs.org/blog/2008/02/24/why-offline-crashed-en/
There are a lot of interesting articles in this blog, but, unfortunately, they're all in Russian.
Added: And since that post Ivan did write MySQL backend supporting master-slave replication: http://softwaremaniacs.org/soft/mysql_replicated/en/