
Django 1.8 and Python 3: Complex app tutorial, end-to-end - dlcmh
http://www.marinamele.com/taskbuster-django-tutorial
======
matthijs_
Great job. For me personally, it's very helpful to have an end-to-end
tutorial, where all aspects of an (example) app are discussed. I don't have a
CS-background nor many years of coding experience, so a tutorial written by
somebody who does have the proper experience and knowledge and puts it all
together is extremely valuable to me. That's why I'd happily pay a fee for
tutorials like this.

At the moment I'm working on building an app in Node.js with Express and
sadly, there are not many tutorials of this quality.

------
arocks
It will surely work in Django 1.8. But whether the Django 1.8 recommendations
like turning `urlpattern` into a list [1] or using `TEMPLATES` setting [2]
have been applied is a different matter altogether.

[1]: [https://github.com/mineta/taskbuster-
boilerplate/blob/master...](https://github.com/mineta/taskbuster-
boilerplate/blob/master/taskbuster/urls.py#L7)

[2]: [https://github.com/mineta/taskbuster-
boilerplate/blob/master...](https://github.com/mineta/taskbuster-
boilerplate/blob/master/taskbuster/settings/base.py#L98)

~~~
marinamele
Thanks arocks! I'll update that!

~~~
marinamele
Done! :-)

------
bsaul
Just looked at the summary, but it doesn't seem to include a chapter on
asynchronous jobs ( such as report creations, emailing, or any kind of long
running tasks). Along with websockets / push architecture, this is often when
website designs start to be really complex.

~~~
joelhaasnoot
Django makes asynchronous jobs very easy through "management commands" \-
simple but perfect framework for running any kind of job. The sample runs on
Heroku - use a job scheduler and run your commands.

Alternative is to use something like Celery:
[http://docs.celeryproject.org/en/latest/index.html](http://docs.celeryproject.org/en/latest/index.html)

~~~
bsaul
Yeap, celery is really when i started to feel the pain of using python rather
than a more enterprise-ready language&framework. Although in my case it wasn't
using it with django but with flask ( but i don't think it makes a big
difference).

The main issues when you start to have a stack built of big independant
systems ( such as a db, a message queue, worker processes, and web server) are
more related to deployment, monitoring and failover management. But they are
really the big issues that justify the choice of a technology instead of
another.

~~~
switch007
I understand the complexity in python of tying together Flask + Celery + DB +
app server etc, but what would you use instead (your comment seems to imply
there's a language/framework that has the aforementioned things bundles/more
integrated)?

~~~
xaritas
In terms of languages that facilitate doing work concurrently or in parallel
with the HTTP request/response cycle:

    
    
      - Java / Scala / Clojure
      - Go
      - Erlang (add Elixir if you are comfortable with its maturity)
    

Not meant to be an exhaustive list of languages. Celery is great but there are
plenty of situations where chucking units of work into a job queue or running
a cron job feels like an incomplete solution.

~~~
shazow
These for the most part don't help you persist/offload/schedule asynchronous
jobs off the main process. If your process dies or gets restarted, the async
job dies with it. Celery persists, queues, schedules and distributes jobs for
you, it's different.

For something more similar to Go/Java/Scala/Clojure/whatever, you can use
Python's gevent or asyncio.

------
alashley
Nice tutorial :) I really appreciate that it covers a lot of the bases and
doesn't assume the reader will only ever run on localhost (like many others
do). I'm sure given that its a good start with Django, the gaps identified in
the comments here can be filled in later via google or further tutorials in
your series.

~~~
mlitwiniuk
(shameless self promotion) we've just released something similar, but for Ruby
on Rails - [https://prograils.com/courses/saas/ch/01-the-welcome-
word](https://prograils.com/courses/saas/ch/01-the-welcome-word) \- our plan
is to make step-by-step tutorial on creating quite complex todo-like saas app.

------
elnygren
the boilerplate seems to ignore django's "multiapp" project layout:

|-manage.py |-MyApp/ |---- settings.py, urls.py, wsgi.py,... etc.
|-AnotherApp1 |---- urls.py, models.py, views.py, migrations/... etc.
|-AnotherApp2 |---- urls.py, models.py, views.py, migrations/... etc.

This might make it not-that-suitable for actually complex projects.

EDIT: ah, looks like the formatting here did't support what I tried to do...

~~~
rylee
Err, are `AnotherApp{1,2}` intentionally missing `settings.py`, and all the
other incongruencies?

I'd think that `AnotherApp{1,2}` would be subdirectories of `MyApp/`, right?

~~~
jmelloy
There's only one settings file, which is defined in the first/main app.

