Re: how to convert to Django 3 or 4

2023-06-12 Thread 'Steven Mapes' via Django users
Ah Python 2.7, you'll need to upgrade through to at least 3.8 so unless it's a huge project where you have time to upgrade through the Django Versions and different versions of Python as you go, you may just want to create a new project and lift the code as you go. On Friday, 9 June 2023 at 15:

Re: how to convert to Django 3 or 4

2023-06-08 Thread 'Steven Mapes' via Django users
If you want to go directly then start a new project and "lift and shift" code fixing and updating as you go. Depending on the size of the project and the complexity of the processes it may be the fastest way to do it. If you want to keep the same project then upgrade in stages. The fact you're in

Re: how to convert to Django 3 or 4

2023-06-08 Thread אורי
Hi, I think you can try to upgrade LTS to LTS. That is, upgrade to the next LTS, then the next LTS, and not directly to Django 4.2. With each LTS check that the site is working. And also, I would recommend using the latest Django release only 6 months after the initial release, because all your de

Re: how to convert to Django 3 or 4

2023-06-08 Thread 'Steven Mapes' via Django users
I've used it to go from Django 3 to 4 and to move a project from 1.11 to 2.2. It doesn't do everything for you but it's a great start. I've personally moved from 1.8 through to 4.2.2 but that was during their development lifecycle. Moving up to 1.7 and then 1.7 to 1.8 and 1.8 to 1.11 and 1.11 to 2

Re: how to convert to Django 3 or 4

2023-06-08 Thread Rogério Carrasqueira
Hey Steven! Thanks for this information, do you have tried it before? I would like to move from 1.4 to lastest, do you think that is it possible? Thanks Em quarta-feira, 7 de junho de 2023 às 11:52:35 UTC-3, Steven Mapes escreveu: > I'd suggest looking into using Adam Johnson's Django-Upgrade

Re: how to convert to Django 3 or 4

2023-06-07 Thread 'Steven Mapes' via Django users
I'd suggest looking into using Adam Johnson's Django-Upgrade told -https://github.com/adamchainz/django-upgrade it will help you move between versions On Tuesday, 6 June 2023 at 15:24:36 UTC+1 Paul Haguet wrote: > There is a lot of function who can change. > > https://docs.djangoproject.com/en

Re: how to convert to Django 3 or 4

2023-06-03 Thread Shams Ulhaq
Just need to change url import from django.urls import include, re_path as url On Sat, 3 Jun 2023, 12:32 David Nugent, wrote: > nppe url is obsolete and removed in 4.x. > > You can use re_path, which is a kind of replacement but even then you will > need to adjust the regex in many cases. > >

Re: how to convert to Django 3 or 4

2023-06-03 Thread David Nugent
nppe url is obsolete and removed in 4.x. You can use re_path, which is a kind of replacement but even then you will need to adjust the regex in many cases. The best approach is to understand what the url() is doing, and replicate the same using path(). Once you do, the conversions should be more

Re: how to convert to Django 3 or 4

2023-06-02 Thread Mike Dewhirst
On 3/06/2023 11:57 am, john fabiani wrote: aware there is no longer the "patterns" urlpatterns = [     ... ] It is just a list nowadays. -- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically d

Re: how to convert to Django 3 or 4

2023-06-02 Thread carlos
maybe maybe this app hepl you i don't used never but a read this good, but i don't know is helped you https://github.com/adamchainz/django-upgrade On Fri, Jun 2, 2023 at 8:38 PM Mike Dewhirst wrote: > On 3/06/2023 7:20 am, john fabiani wrote: > > Hi everyone, > > I am tasked with updating/upgrad

Re: how to convert to Django 3 or 4

2023-06-02 Thread Mike Dewhirst
On 3/06/2023 7:20 am, john fabiani wrote: Hi everyone, I am tasked with updating/upgrading a very old Django web site - I believe it is 1.7.  I need convert and need what is required. Thanks in advance. I need to convert the following: Because all your urls are regular expressions, you ca

Re: how to convert to Django 3 or 4

2023-06-02 Thread Muhammad Juwaini Abdul Rahman
I think Django 4 still have backward compatibility with `url` although `path` is preferable. You can try to `runserver` in your local, upgrade your django version in your virtualenv to version 4 and troubleshoot the error messages (if any) one by one. On Sat, 3 Jun 2023 at 05:20, john fabiani wr

Re: how to convert to Django 3 or 4

2023-06-02 Thread john fabiani
Thanks for taking the time. I'm hoping someone will take the time to explain how to replace the old code.  As you might be aware there is no longer the "patterns".  So I am trying to determine how the url.py directs Django to the correct view? Johnf On 6/2/23 6:12 PM, David Nugent wrote: I h

Re: how to convert to Django 3 or 4

2023-06-02 Thread David Nugent
I have been through the experience of moving existing Django 1.5 app to 3.2 a couple years ago. Without doubt, the path of least resistance is to rebuild the site from scratch. Start with the latest release (ie. 4.2 as of today). You'll have the apps already defined and these have a blueprint. You