
Django 2.0 alpha - orf
https://docs.djangoproject.com/en/dev/releases/2.0?hnews
======
nickstefan12
If anyone wants to see "Database level -- on delete cascade", here's my PR to
Django that's been open since July/August:
[https://github.com/django/django/pull/8661](https://github.com/django/django/pull/8661)

~~~
cjbprime
Nothing against your PR, but the default cascade-on-delete behavior is my
least favorite thing about Django. :(

~~~
nickstefan12
You don't like that models.CASCADE fakes it with extra requests to the Db? Or
you don't like that the default is models.CASCADE instead of something like
models.DO_NOTHING? There's talk of making the on_delete kwarg required. In
that world there would be no default :).

------
nnain
Some highlights from the pages:

"This alpha milestone marks a complete feature freeze."

"The current release schedule calls for a beta release in about a month and a
release candidate about a month from then."

"The Django 1.11.x series is the last to support Python 2.7."

------
gt_
Can someone recommend a learning path for building Django sites/apps to
someone who has no web dev experience but uses python for scripting and
workstation utilities? In particular, I use python for VFX/CGI scripting.

~~~
spapas82
Start with the django-tutorial. Always start with the tutorial no matter what
else they tell you. The django tutorial is excellent and cover most basics:
[https://docs.djangoproject.com/en/1.11/intro/tutorial01/](https://docs.djangoproject.com/en/1.11/intro/tutorial01/)

Then start writing your own application. When you have questions read the
django documentantion. The django docs are the _best_ documentantion I've ever
seen, they are better than most books about django and should answer all your
questions. The docs are so good I recommend reading them from start to finish
- i.e download this off line version of the docs:
[https://media.readthedocs.org/pdf/django/1.11.x/django.pdf](https://media.readthedocs.org/pdf/django/1.11.x/django.pdf)

and read it from cover to cover. You will not regret it.

~~~
gt_
Thank you. My bookworm habits make this hard to accept, but your advice
reflects my experience learning Python as well. The python.org tutorial was
better than anything.

Would you also recommend learning CSS, HTTP, PHP _before_ the Django
tutorials?

~~~
ubernostrum
I strongly recommend the DjangoGirls tutorial:

[https://tutorial.djangogirls.org/](https://tutorial.djangogirls.org/)

It covers HTML, CSS, git, etc. in addition to teaching you Django.

~~~
otherme1
I also like that tutorial, but the name is a bit unfortunate. I recommended it
to a woman and she quickly accused me of "giving her a dumbed down tutorial
for girls". I had to convince her that the site is actually very good.

------
obilgic
Can someone who uses Django, review this release? What are the most
anticipated changes etc?

~~~
keganunderwood
Not an expert by any means but to me the biggest change is no more Python 2.

> Django 2.0 supports Python 3.4, 3.5, and 3.6. We highly recommend and only
> officially support the latest release of each series.

People should not write new code in Python 2 at all. If you're learning Python
today, I'd say pretend Python 2 doesn't exist. Use python3-venv and renounce
the baggage of the past.

~~~
gt_
Doing VFX pipeline dev here and none of the softwares support 3 yet.
Houdini/3ds Max/Maya are all 2.7 only.

I have not even seen mention of moving to 3.

~~~
ubernostrum
What are they planning to do when the support for Python 2 runs out and people
remind them they had a decade in which to start a port but didn't?

~~~
gt_
I have the same question. If I remember right, it's going to happen in 2020.

I don't work with a studio yet but studios who buy the software don't seem too
worried for some reason, even though their pipelines depend on it. Maybe
someone else can offer better insight. As someone wanting to go into pipeline
development, I am very curious.

------
cryptos
It's a bit disappointing that Django doesn't emphasize REST more. I'm
expecting that "classic" web application frameworks with templates rendered on
the server (as long as they are not templates from a client-side framework
rendered there for some optimization) are on their way out. And, to be honest,
REST is not a strength of Django ...

~~~
nicwolff
I'm expecting that REST APIs are on their way out ツ but what's wrong with the
Django REST Framework?

~~~
ric2b
Why is that, are you thinking about GraphQL?

------
vegbrasil
I started learning Django yesterday and now I'm not sure if I should just skip
to the 2.0 alpha instead of learning the current stable version.

~~~
huxley
I wouldn't worry that much about it, the differences between Django 1.11 and
Django 2.0 aren't major ones with the exception of dropping support for Python
2.x and the new simplified URL routing syntax.

Django 1.11 is a LTS (Long Term Support) release so it will have security
upgrades until 2020, so you are safe sticking with it.

However I'd go ahead with 1.11 and transition to 2.0 to learn how Django
handles deprecation and how to upgrade a codebase, both very useful skills as
Django has a steady release process and it's often easier to track Django than
to do a multi-version migration.

------
claudiug
How a rails/ruby buy should start with python/django?

~~~
unoti
Two answers for you:

1) don't-- instead learn about making single page apps on the front end using
React and Redux, or perhaps Angular 2. Then write a REST backend in either
Node, Go, Python, or C#. Or go serverless and write the backend in Firebase.

2) if you really do want to do Django, start by doing the default tutorial
that focuses on building something in the admin interface. Coming from a rails
background you are on somewhat similar ground.

~~~
spapas82
Answer 1) is plain wrong. I don't think that more than 10% of all web
applications will benefit from SPAs. Your recommendation stands only for
valley companies that have money to burn.

For example, in my industry (I work on the public sector) SPAs are never
needed. Good old traditional request/response web apps, maybe with a little
jquery on top to make things more responsive or add some advanced controls
(autocompletes, keywords etc) are perfect for the job.

An experienced django developer can create a full traditional multi-user CRUD
web app in a couple of hours. You'll just create the models and a couple of
CBVs and everything else will be auto-created (but not magically created)
through django-forms, django-filters and django-tables2. Now, how much time
would you need to duplicate this functionality with an SPA? As I said, if you
have money to burn then this is the way to go - on other cases, just use
Django.

~~~
unoti
> Answer 1) is plain wrong. I don't think that more than 10% of all web
> applications will benefit from SPAs. Your recommendation stands only for
> valley companies that have money to burn.

Actually it's very easy to put together a single page application today!
Really easy, really fast, really practical. I'll lay out the basic steps
below. But before that, an important note: several years ago, what you said
was totally true. In, say, 2013, it would have been a big piles-of-cash-
burning exercise to make a single page application. Today, though, it's
actually quite simple, fast, and productive to create and deploy a single page
application. Here are the basic steps, assuming you're using Angular 2 for
example.

1) Generate your application. This is a single command line command. 2) Edit
it a little, add a text box and some buttons. 3) Deploy it to google app
engine; this is a single command line command, too.

The time investment is in learning how to write apps with Angular 2 or React.
That is indeed a big learning curve, but it's way easier today than it was
years ago. Angular 2 is way easier to write apps in than Angular 1 was.
Deployment is easier than it once was.

My real thesis here is that today is a good day to embrace the modern web and
try things a new way-- single page apps are actually much more straightforward
and practical than they were years ago.

I totally agree that if your goal is to build a crud app for a client then
Django is likely a superior approach. But if you're already a Rails developer
that wants to learn something new, then SPA is a better investment of time
than Django.

~~~
spapas82
> 1) Generate your application. This is a single command line command. 2) Edit
> it a little, add a text box and some buttons. 3) Deploy it to google app
> engine; this is a single command line command, too.

That will create a toy application. If you want to create a production
application you need to handle data. To handle data you will need:

* Tables / lists to display the data

* Views to edit and display the data

* Forms to edit the data

* Auditing of the user actions

* User authentication + authorization

All these are _not_ trivial to create in an SPA especially since you'll always
need both server _and_ client side code. With django (or rails, or spring or
various other server only frameworks) you won't need to write client code
_and_ most of these components will be auto-generated (at leas their default
values).

For your last comment, I also agree that if you know rails then you don't
really need to learn django since they are both similar (however I do profer
django because of its no magic philisophy and because python is a better
language than ruby) but I believe that you also don't need to go the SPA route
until somebody specifically asks for an SPA and has good reasons asking for it
(or you want to learn the technology and modern frameworks that surround
SPAs).

As a final comment, I have to say that really like all those modern frameworks
(especiall react and redux) but I won't consider them for my day-to-day job
since instead of creating something in 1 week I'd need 1 month using these
technologies.

~~~
unoti
I think you and I are actually not far apart on this at all. Everything you
mentioned Django does well. And so does Rails. And I sorely miss the beauty of
Django admin in the world of SPA's.

------
tiagocorrea
How smooth is to upgrade your app to every future release of Django? Starter
here, on Python and then Django.

~~~
leetrout
In very broad terms it's not bad. The docs are great and they give specific
advice for upgrades.

With that said you may find many 3rd party apps / utils lagging. A couple libs
I use still don't support new style middleware, for instance.

With 2.0 dropping support for py2.7 this might cause more pain points for
poorly maintained libs but all in all keeping up with Django releases is
pretty straightforward and almost always worth it.

Source: happily using Django since 2008.

------
zaro
So basically nothing new. Nothing about channels, ASGI or any async support
which IMHO are way overdue to be included.

------
sdfjkl
Hmm, I haven't done much with Django in a while, but for a major version this
seems a bit... underwhelming.

~~~
brianwawok
Dropping python2 is a pretty big feature alone.

