5 ms·
Django 1.8 and Python 3: Complex app tutorial, end-to-end
- elnygren 11y agothe 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...
- pestaa 11y agoIndent the tree with 4 spaces.
- yasoob 11y agoSomething like this probably? |-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/..
- rylee 11y agoErr, 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 11y agoThere's only one settings file, which is defined in the first/main app.
- clarkie13 11y agoI've been doing PHP for 6 years and this tutorial made me really want to play with Python.
- bsaul 11y agoJust 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.
- anhtran 11y agoThe issues in sample project are regular challenges. I also think it's not a complex project without real-time parts, searching, async and concurrency tasks. Especially in Python 3.
- joelhaasnoot 11y agoDjango 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 11y agoYeap, 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 11y agoI 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)?
- arocks 11y agoIt 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/taskbuster/urls.py#L7 https://github.com/mineta/taskbuster-boilerplate/blob/master... [2]: https://github.com/mineta/taskbuster-boilerplate/blob/master/taskbuster/settings/base.py#L98 https://github.com/mineta/taskbuster-boilerplate/blob/master...
- graffitici 11y agoCan you point me to a list of such recommendations for Django 1.8? Are these official ones?
- amarsahinovic 11y agoIt is in the official release notes: https://docs.djangoproject.com/en/1.8/releases/1.8/#template-related-settings https://docs.djangoproject.com/en/1.8/releases/1.8/#template... https://docs.djangoproject.com/en/1.8/releases/1.8/#django-conf-urls-patterns https://docs.djangoproject.com/en/1.8/releases/1.8/#django-c...
- marinamele 11y agoThanks arocks! I'll update that!
- marinamele 11y agoDone! :-)
- alashley 11y agoNice 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 11y ago(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.
- matthijs_ 11y agoGreat 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.