News for hackers. Stuff that matters.
Re:Django 2.0 alpha by obilgic on Saturday September 23, 2017 @12:51PM (#15320547)
Can someone who uses Django, review this release? What are the most anticipated changes etc?
Re:Django 2.0 alpha by keganunderwood on Saturday September 23, 2017 @12:57PM (#15320582)
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.

Re:Django 2.0 alpha by gt_ on Saturday September 23, 2017 @01:42PM (#15320791)
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.

Re:Django 2.0 alpha by ubernostrum on Saturday September 23, 2017 @02:39PM (#15321024)
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?
Re:Django 2.0 alpha by gt_ on Saturday September 23, 2017 @03:00PM (#15321112)
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.

Re:Django 2.0 alpha by boterock on Saturday September 23, 2017 @02:19PM (#15320955)
Blender supports Python 3... time to move to blender I guess =P
Re:Django 2.0 alpha by aaossa on Saturday September 23, 2017 @01:44PM (#15320808)
Well, they still have arount 2.5 years of support (https://pythonclock.org/)
Re:Django 2.0 alpha by storax on Saturday September 23, 2017 @04:56PM (#15321670)
http://www.vfxplatform.com/ It's planned for 2019.
Re:Django 2.0 alpha by gt_ on Saturday September 23, 2017 @07:59PM (#15322456)
Nice! Thanks for pointing this out. This could be naive but maybe the script transition can be a hiring opportunity for those like myself... not that there are many of us.
Re:Django 2.0 alpha by mixmastamyk on Saturday September 23, 2017 @10:35PM (#15322961)
Not a lot of text encoding going on there so most porting should be easy.
Re:Django 2.0 alpha by stefano on Saturday September 23, 2017 @03:59PM (#15321406)
App engine still only supports python 2.7 in the standard environment...
Re:Django 2.0 alpha by m45t3r on Saturday September 23, 2017 @06:12PM (#15322065)
Re:Django 2.0 alpha by ameliaquining on Sunday September 24, 2017 @12:45AM (#15323350)
Flexible environment only. This matters because the standard environment's pricing structure is a lot better for apps that go significant periods without much traffic, or that have spiky traffic patterns that necessitate fast scaling.
Re:Django 2.0 alpha by keganunderwood on Tuesday September 26, 2017 @06:02AM (#15337418)
What prevents Google from offering Python3 support in standard environment? Is this a business decision?
Re:Django 2.0 alpha by ameliaquining on Tuesday September 26, 2017 @10:34PM (#15344451)
It's on the roadmap and there's a public statement that it'll ship next year.
Re:Django 2.0 alpha by fish_fan on Saturday September 23, 2017 @03:59PM (#15321407)
App engine is a niche environment.
Re:Django 2.0 alpha by zmix on Saturday September 23, 2017 @01:10PM (#15320655)
Easy, easy! You're walking dangerous territories here. ;)
Re:Django 2.0 alpha by kolanos on Saturday September 23, 2017 @01:16PM (#15320689)
The story here is removing Python 2.7 support. This greatly simplifies the Django codebase. In terms of new features, it's relatively light, although I can see the new path-based urls being useful for new devs or those who are regular expression adverse.
Re:Django 2.0 alpha by angrygoat on Saturday September 23, 2017 @01:23PM (#15320712)
I haven't tried it out yet, but I suspect dropping Python 2.7 is going to make tracebacks a whole lot clearer and easier to read. Right now, there tends to be a bunch of frames relating to `six`, which clutters things up.

The new path based URLs look great - to me, the gain looks like readability more than anything (reading regexps at a glance isn't exactly easy, especially if they have named groups), and having built in type coercion for the parameters is a nice win too.

Re:Django 2.0 alpha by ProblemFactory on Saturday September 23, 2017 @04:11PM (#15321467)
> In terms of new features, it's relatively light

In a way that actually sounds like a good way to release things.

* Release 1.11 LTS with final feature updates for people who want to stay on Python2.7,

* Release 2.0 which is mostly a refactoring & internal cleanup - so for Django users on Python3 it should be a simple upgrade, and you get real life testing on it,

* Start adding features once the refactoring seems stable.

Re:Django 2.0 alpha by danpalmer on Saturday September 23, 2017 @04:02PM (#15321418)
I'm hoping for a speed improvement here too. Regex compilation for the URLconfs adds about a second to our startup time which in development is quite a bit.
Re:Django 2.0 alpha by Ralfp on Saturday September 23, 2017 @01:01PM (#15320606)
There's new `path()` as alternative to `url()` that allows one to use easier to remember syntax for url params like `<int:id>` instead of past `(?P<year>[0-9]{4})`. But if you need it, there's still `url()` for you to use power of regex in your urls.

And your shop still runs on Py2k, you'll need to move to Py3k to use Django 2.0. This also means that websockets support will not land on Django version that works for Py2k.

Re:Django 2.0 alpha by switch007 on Saturday September 23, 2017 @01:42PM (#15320793)
How is <int:id> identical to (?P<year>[0-9]{4})? I'm talking about the {4}. Just an error in their blog post?
Re:Django 2.0 alpha by westurner on Saturday September 23, 2017 @02:50PM (#15321075)
Does it support negative long integers?

EDIT: I am without actual internet or mobile tethering and an unable to `git clone https://github.com/django/django -b stable/2.0.x` and check out this convenient new feature.

Re:Django 2.0 alpha by ubernostrum on Saturday September 23, 2017 @04:12PM (#15321477)
It's still regex under the hood, the 'int' is just syntactic sugar for "[0-9]+":

https://github.com/django/django/blob/dda37675db0295baefef37...

Re:Django 2.0 alpha by westurner on Sunday September 24, 2017 @10:29PM (#15327690)
Thanks!
Re:Django 2.0 alpha by whalesalad on Saturday September 23, 2017 @04:09PM (#15321454)
Seriously? I mean you can achieve that with your own regex the old way. Surprised you’re asking the commenters here to investigate such a specific and odd use case of a convenience method.
Re:Django 2.0 alpha by lozenge on Sunday September 24, 2017 @05:19AM (#15324023)
You normally would want a three digit year to 404, and the same is true for a silly year like `3456` - you would 404 in the view. So, it isn't identical, but close enough for most purposes, as your view probably already has code to return 404.
Re:Django 2.0 alpha by ameliaquining on Saturday September 23, 2017 @01:01PM (#15320607)
I'd say the major things at the top of the release notes:

- Dropped support for Python 2

- New simpler syntax for specifying URL routes (as an alternative to the traditional regex-based one, which is still supported)

- The admin interface got a new responsive design that works better on mobile

- The ORM now has first-class support for OVER clauses

Re:Django 2.0 alpha by stuaxo on Saturday September 23, 2017 @01:27PM (#15320724)
I wonder if they fixed the admin internals. When I looked (years ago), it had many sins, such as outputting markup in the the code.
Re:Django 2.0 alpha by ubernostrum on Saturday September 23, 2017 @02:40PM (#15321025)
Re:Django 2.0 alpha by the_duke on Saturday September 23, 2017 @12:59PM (#15320591)
I haven't used Django in a few years, but the relase notes look like only minor new features.

This isn't a huge change the world release which you might expect of a 2.0.

The biggest one seems to be dropping Python 2.x support. This is probably the reason for the 2.0.

Re:Django 2.0 alpha by ameliaquining on Saturday September 23, 2017 @01:07PM (#15320641)
Correct. Starting with this release, Django is moving towards a model where every third release is semver-major. Every eight-month minor release will have new incremental features and deprecations. Each X.0 release will drop support for everything that was deprecated two or three releases ago, and each X.2 release will be an LTS release that gets bugfixes for the next 3 years.
Re:Django 2.0 alpha by adpirz on Saturday September 23, 2017 @01:00PM (#15320602)
Mostly minor changes, biggest developer facing changes involve dropping Python 2.x support and URL routing syntax (much more simplified, previously required a working knowledge of regex).
Re:Django 2.0 alpha by Osmose on Saturday September 23, 2017 @01:01PM (#15320608)
Besides dropping 2.0, the new urlconf syntax is a small but impactful improvement to something that you end up using very often.