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:29:47 UTC+1 Rogerio Carrasqueira wrote:

> I'm using python 2.7, wich your suggestion?
>
> Thanks
>
>
> Rogério Carrasqueira
>
>
>
>
>
> Em sex., 9 de jun. de 2023 às 03:37, 'Steven Mapes' via Django users <
> django...@googlegroups.com> escreveu:
>
>> 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 1.4 will make it hard and you'll need to do a lot of manual 
>> changes to get into 1.8 so starting new may well be quicker. If you did 
>> upgrade then I'd go 1.8 to 1.11, 2.2, 3.2 and finally 4.2.
>>
>> Branch the code using version control and see how bad it is but it'll 
>> depend on the project.
>> I went from 1.11 to 3.2 in a day for one but most of the code was bespoke 
>> without may external packages to worry about. Those could also cause you 
>> issues.
>>
>> Since the code is Django 1.4 what version of python is it also using?
>>
>>
>> On Thu, Jun 8, 2023, 21:31 Rogerio Carrasqueira  
>> wrote:
>>
>>> So just to undersand, I cannot move directly from 1.4 to 4 I have to do 
>>> it in steps, right?
>>>
>>> Thanks 
>>> Rogério Carrasqueira
>>>
>>>
>>>
>>>
>>>
>>> Em qui., 8 de jun. de 2023 às 17:01, 'Steven Mapes' via Django users <
>>> django...@googlegroups.com> escreveu:
>>>
 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 will be the hardest parts but it'll get easier once you're 
 on 
 1.11

 On Thu, Jun 8, 2023, 19:58 Rogério Carrasqueira <
 rogerio.ca...@gmail.com> wrote:

> 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 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/4.2/releases/4.0/
>>>
>>> All the function declared as deprecated into Django 3 has been 
>>> removed into Django 4. In the deprecated section of django 3 new 
>>> functions 
>>> names are systematically indicated. So just search the function under 
>>> their 
>>> old name and replace them with their new name. The 2 links below give 
>>> the 
>>> list.
>>>
>>>
>>> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
>>>
>>> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>>>
>>> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>>>
 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.
>
> 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 or less straight-forward. Instead of regex you use labelled 
> patterns 
> making for more comprehensible path lines. For complex regex 
> expressions 
> you may need to define custom matches - or "converters" - that 
> enforce 
> specific patterns allowing you to restrict input and improve 
> matching. This 
> is one area that Django has improved really well over time.
>
> But, like I said, don't try to replace this file wholesale. 
> Instead of converting it and doing error-fix-error-fix ad infinitun, 
> re-implement things as you enable parts of the app you have 
> successfully 
> ported. While re_path may be a fallback, try to re-implement as 
> path() 
> 

Re: how to convert to Django 3 or 4

2023-06-09 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 1.4 will make it hard and you'll need to do a lot of manual
changes to get into 1.8 so starting new may well be quicker. If you did
upgrade then I'd go 1.8 to 1.11, 2.2, 3.2 and finally 4.2.

Branch the code using version control and see how bad it is but it'll
depend on the project.
I went from 1.11 to 3.2 in a day for one but most of the code was bespoke
without may external packages to worry about. Those could also cause you
issues.

Since the code is Django 1.4 what version of python is it also using?


On Thu, Jun 8, 2023, 21:31 Rogerio Carrasqueira <
rogerio.carrasque...@gmail.com> wrote:

> So just to undersand, I cannot move directly from 1.4 to 4 I have to do it
> in steps, right?
>
> Thanks
> Rogério Carrasqueira
>
>
>
>
>
> Em qui., 8 de jun. de 2023 às 17:01, 'Steven Mapes' via Django users <
> django-users@googlegroups.com> escreveu:
>
>> 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 will be the hardest parts but it'll get easier once you're on 1.11
>>
>> On Thu, Jun 8, 2023, 19:58 Rogério Carrasqueira <
>> rogerio.carrasque...@gmail.com> wrote:
>>
>>> 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 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/4.2/releases/4.0/
>
> All the function declared as deprecated into Django 3 has been removed
> into Django 4. In the deprecated section of django 3 new functions names
> are systematically indicated. So just search the function under their old
> name and replace them with their new name. The 2 links below give the 
> list.
>
>
> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
>
> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>
> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>
>> 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.
>>>
>>> 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 or less straight-forward. Instead of regex you use labelled 
>>> patterns
>>> making for more comprehensible path lines. For complex regex expressions
>>> you may need to define custom matches - or "converters" - that enforce
>>> specific patterns allowing you to restrict input and improve matching. 
>>> This
>>> is one area that Django has improved really well over time.
>>>
>>> But, like I said, don't try to replace this file wholesale. Instead
>>> of converting it and doing error-fix-error-fix ad infinitun, 
>>> re-implement
>>> things as you enable parts of the app you have successfully ported. 
>>> While
>>> re_path may be a fallback, try to re-implement as path() expressions and
>>> you'll be better in the long run.
>>>
>>>
>>> On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
>>> juw...@gmail.com> wrote:
>>>
 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 
 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:

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
dependencies have to upgrade and also bug fixes. So use Django 4.1 now, and
Django 4.2 only on October 2023.

If you have a problem with something not working, read the release notes of
the specific versions and search for the function not working. For example,
search for "url" on the page (control-f in the browser).

Good luck!

Uri Rodberg, Speedy Net.
אורי
u...@speedy.net


On Fri, Jun 2, 2023 at 11:20 PM 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:
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = patterns('',
> # Examples:
> url(r'reg4/$', 'register.views.reg4', name='reg4'),
> url(r'reg3/$', 'register.views.reg3', name='reg3'),
> url(r'reg2/$', 'register.views.reg2', name='reg2'),
> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
> url(r'reg1/$', 'register.views.reg1', name='reg1'),
> #url(r'^$', 'register.views.home', name='home'),
> url(r'reg/$', 'register.views.home', name='home'),
> url(r'get_courts/(\d+)$', 'register.views.get_courts',
> name='get_courts'),
> url(r'get_courses/(\d+)$', 'register.views.get_courses',
> name='get_courses'),
> url(r'autoschedule/', 'register.views.autoschedule',
> name='autoschedule'),
> url(r'get_cities/(\d+)$', 'register.views.get_cities',
> name='get_cities'),
> url(r'get_classes/(\d+)$', 'register.views.get_classes',
> name='get_classes'),
> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
> name='get_cities2'),
> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2',
> name='get_classes2'),
> url(r'rejected/$', 'register.views.rejected', name='rejected'),
> url(r'finished/$', 'register.views.finished', name='finished'),
>
> ##url(r'^$', 'profiles.views.home', name='home'),
> #url(r'^contact/$', 'register.views.home', name='contact'),
> #url(r'^about/$', 'register.views.about', name='about'),
> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
> #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>
> What is required?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABD5YeFHT4CCtbqbT06eX815WKvH%3DH%3DO9tYGdOCeyRm438iaoA%40mail.gmail.com.


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 will be the hardest parts but it'll get easier once you're on 1.11

On Thu, Jun 8, 2023, 19:58 Rogério Carrasqueira <
rogerio.carrasque...@gmail.com> wrote:

> 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 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/4.2/releases/4.0/
>>>
>>> All the function declared as deprecated into Django 3 has been removed
>>> into Django 4. In the deprecated section of django 3 new functions names
>>> are systematically indicated. So just search the function under their old
>>> name and replace them with their new name. The 2 links below give the list.
>>>
>>>
>>> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
>>>
>>> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>>>
>>> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>>>
 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.
>
> 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 or less straight-forward. Instead of regex you use labelled patterns
> making for more comprehensible path lines. For complex regex expressions
> you may need to define custom matches - or "converters" - that enforce
> specific patterns allowing you to restrict input and improve matching. 
> This
> is one area that Django has improved really well over time.
>
> But, like I said, don't try to replace this file wholesale. Instead of
> converting it and doing error-fix-error-fix ad infinitun, re-implement
> things as you enable parts of the app you have successfully ported. While
> re_path may be a fallback, try to re-implement as path() expressions and
> you'll be better in the long run.
>
>
> On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
> juw...@gmail.com> wrote:
>
>> 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 
>> 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:
>>>
>>> from django.conf.urls import patterns, include, url
>>> from django.contrib import admin
>>> from django.conf import settings
>>> from django.conf.urls.static import static
>>>
>>> urlpatterns = patterns('',
>>> # Examples:
>>> url(r'reg4/$', 'register.views.reg4', name='reg4'),
>>> url(r'reg3/$', 'register.views.reg3', name='reg3'),
>>> url(r'reg2/$', 'register.views.reg2', name='reg2'),
>>> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
>>> url(r'reg1/$', 'register.views.reg1', name='reg1'),
>>> #url(r'^$', 'register.views.home', name='home'),
>>> url(r'reg/$', 'register.views.home', name='home'),
>>> url(r'get_courts/(\d+)$', 'register.views.get_courts',
>>> name='get_courts'),
>>> url(r'get_courses/(\d+)$', 'register.views.get_courses',
>>> name='get_courses'),
>>> url(r'autoschedule/', 'register.views.autoschedule',
>>> name='autoschedule'),
>>> url(r'get_cities/(\d+)$', 'register.views.get_cities',
>>> name='get_cities'),
>>> url(r'get_classes/(\d+)$', 'register.views.get_classes',
>>> name='get_classes'),
>>> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
>>> name='get_cities2'),
>>> url(r'get_classes2/(\d+)/(\d+)/$',
>>> 'register.views.get_classes2', 

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 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/4.2/releases/4.0/
>>
>> All the function declared as deprecated into Django 3 has been removed 
>> into Django 4. In the deprecated section of django 3 new functions names 
>> are systematically indicated. So just search the function under their old 
>> name and replace them with their new name. The 2 links below give the list.
>>
>>
>> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
>>
>> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>>
>> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>>
>>> 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.

 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 or less straight-forward. Instead of regex you use labelled patterns 
 making for more comprehensible path lines. For complex regex expressions 
 you may need to define custom matches - or "converters" - that enforce 
 specific patterns allowing you to restrict input and improve matching. 
 This 
 is one area that Django has improved really well over time.

 But, like I said, don't try to replace this file wholesale. Instead of 
 converting it and doing error-fix-error-fix ad infinitun, re-implement 
 things as you enable parts of the app you have successfully ported. While 
 re_path may be a fallback, try to re-implement as path() expressions and 
 you'll be better in the long run.


 On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
 juw...@gmail.com> wrote:

> 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  
> 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:
>>
>> from django.conf.urls import patterns, include, url
>> from django.contrib import admin
>> from django.conf import settings
>> from django.conf.urls.static import static
>>
>> urlpatterns = patterns('',
>> # Examples:
>> url(r'reg4/$', 'register.views.reg4', name='reg4'),
>> url(r'reg3/$', 'register.views.reg3', name='reg3'),
>> url(r'reg2/$', 'register.views.reg2', name='reg2'),
>> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
>> url(r'reg1/$', 'register.views.reg1', name='reg1'),
>> #url(r'^$', 'register.views.home', name='home'),
>> url(r'reg/$', 'register.views.home', name='home'),
>> url(r'get_courts/(\d+)$', 'register.views.get_courts', 
>> name='get_courts'),
>> url(r'get_courses/(\d+)$', 'register.views.get_courses', 
>> name='get_courses'),
>> url(r'autoschedule/', 'register.views.autoschedule', 
>> name='autoschedule'),
>> url(r'get_cities/(\d+)$', 'register.views.get_cities', 
>> name='get_cities'),
>> url(r'get_classes/(\d+)$', 'register.views.get_classes', 
>> name='get_classes'),
>> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2', 
>> name='get_cities2'),
>> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2', 
>> name='get_classes2'),
>> url(r'rejected/$', 'register.views.rejected', name='rejected'),
>> url(r'finished/$', 'register.views.finished', name='finished'),
>> 
>> ##url(r'^$', 'profiles.views.home', name='home'),
>> #url(r'^contact/$', 'register.views.home', name='contact'),
>> #url(r'^about/$', 'register.views.about', name='about'),
>> #url(r'^profile/$', 'register.views.user_profile', 
>> name='profile'),
>> #url(r'^checkout/$', 'checkout.views.checkout', 
>> 

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/4.2/releases/4.0/
>
> All the function declared as deprecated into Django 3 has been removed 
> into Django 4. In the deprecated section of django 3 new functions names 
> are systematically indicated. So just search the function under their old 
> name and replace them with their new name. The 2 links below give the list.
>
> https://docs.djangoproject.com/en/4.2/releases/3.0/#deprecated-features-3-0
> https://docs.djangoproject.com/en/4.2/releases/3.1/#deprecated-features-3-1
>
> Le samedi 3 juin 2023 à 10:10:31 UTC+2, Shams Ulhaq a écrit :
>
>> 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.
>>>
>>> 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 or less straight-forward. Instead of regex you use labelled patterns 
>>> making for more comprehensible path lines. For complex regex expressions 
>>> you may need to define custom matches - or "converters" - that enforce 
>>> specific patterns allowing you to restrict input and improve matching. This 
>>> is one area that Django has improved really well over time.
>>>
>>> But, like I said, don't try to replace this file wholesale. Instead of 
>>> converting it and doing error-fix-error-fix ad infinitun, re-implement 
>>> things as you enable parts of the app you have successfully ported. While 
>>> re_path may be a fallback, try to re-implement as path() expressions and 
>>> you'll be better in the long run.
>>>
>>>
>>> On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
>>> juw...@gmail.com> wrote:
>>>
 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  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:
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = patterns('',
> # Examples:
> url(r'reg4/$', 'register.views.reg4', name='reg4'),
> url(r'reg3/$', 'register.views.reg3', name='reg3'),
> url(r'reg2/$', 'register.views.reg2', name='reg2'),
> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
> url(r'reg1/$', 'register.views.reg1', name='reg1'),
> #url(r'^$', 'register.views.home', name='home'),
> url(r'reg/$', 'register.views.home', name='home'),
> url(r'get_courts/(\d+)$', 'register.views.get_courts', 
> name='get_courts'),
> url(r'get_courses/(\d+)$', 'register.views.get_courses', 
> name='get_courses'),
> url(r'autoschedule/', 'register.views.autoschedule', 
> name='autoschedule'),
> url(r'get_cities/(\d+)$', 'register.views.get_cities', 
> name='get_cities'),
> url(r'get_classes/(\d+)$', 'register.views.get_classes', 
> name='get_classes'),
> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2', 
> name='get_cities2'),
> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2', 
> name='get_classes2'),
> url(r'rejected/$', 'register.views.rejected', name='rejected'),
> url(r'finished/$', 'register.views.finished', name='finished'),
> 
> ##url(r'^$', 'profiles.views.home', name='home'),
> #url(r'^contact/$', 'register.views.home', name='contact'),
> #url(r'^about/$', 'register.views.about', name='about'),
> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
> #url(r'^checkout/$', 'checkout.views.checkout', 
> name='checkout'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>
> What is required?
>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Django users" group.
> To unsubscribe from 

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.
>
> 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 or less
> straight-forward. Instead of regex you use labelled patterns making for
> more comprehensible path lines. For complex regex expressions you may need
> to define custom matches - or "converters" - that enforce specific patterns
> allowing you to restrict input and improve matching. This is one area that
> Django has improved really well over time.
>
> But, like I said, don't try to replace this file wholesale. Instead of
> converting it and doing error-fix-error-fix ad infinitun, re-implement
> things as you enable parts of the app you have successfully ported. While
> re_path may be a fallback, try to re-implement as path() expressions and
> you'll be better in the long run.
>
>
> On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
> juwa...@gmail.com> wrote:
>
>> 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  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:
>>>
>>> from django.conf.urls import patterns, include, url
>>> from django.contrib import admin
>>> from django.conf import settings
>>> from django.conf.urls.static import static
>>>
>>> urlpatterns = patterns('',
>>> # Examples:
>>> url(r'reg4/$', 'register.views.reg4', name='reg4'),
>>> url(r'reg3/$', 'register.views.reg3', name='reg3'),
>>> url(r'reg2/$', 'register.views.reg2', name='reg2'),
>>> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
>>> url(r'reg1/$', 'register.views.reg1', name='reg1'),
>>> #url(r'^$', 'register.views.home', name='home'),
>>> url(r'reg/$', 'register.views.home', name='home'),
>>> url(r'get_courts/(\d+)$', 'register.views.get_courts',
>>> name='get_courts'),
>>> url(r'get_courses/(\d+)$', 'register.views.get_courses',
>>> name='get_courses'),
>>> url(r'autoschedule/', 'register.views.autoschedule',
>>> name='autoschedule'),
>>> url(r'get_cities/(\d+)$', 'register.views.get_cities',
>>> name='get_cities'),
>>> url(r'get_classes/(\d+)$', 'register.views.get_classes',
>>> name='get_classes'),
>>> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
>>> name='get_cities2'),
>>> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2',
>>> name='get_classes2'),
>>> url(r'rejected/$', 'register.views.rejected', name='rejected'),
>>> url(r'finished/$', 'register.views.finished', name='finished'),
>>>
>>> ##url(r'^$', 'profiles.views.home', name='home'),
>>> #url(r'^contact/$', 'register.views.home', name='contact'),
>>> #url(r'^about/$', 'register.views.about', name='about'),
>>> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
>>> #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
>>> # url(r'^blog/', include('blog.urls')),
>>>
>>> url(r'^admin/', include(admin.site.urls)),
>>> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>>>
>>> What is required?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAFKhtoSO2XrckAe6uqpYoHYxKnqSm4sm3GkaNZXfUeXGs90Ftw%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To 

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 or less
straight-forward. Instead of regex you use labelled patterns making for
more comprehensible path lines. For complex regex expressions you may need
to define custom matches - or "converters" - that enforce specific patterns
allowing you to restrict input and improve matching. This is one area that
Django has improved really well over time.

But, like I said, don't try to replace this file wholesale. Instead of
converting it and doing error-fix-error-fix ad infinitun, re-implement
things as you enable parts of the app you have successfully ported. While
re_path may be a fallback, try to re-implement as path() expressions and
you'll be better in the long run.


On Sat, Jun 3, 2023 at 11:59 AM Muhammad Juwaini Abdul Rahman <
juwa...@gmail.com> wrote:

> 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  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:
>>
>> from django.conf.urls import patterns, include, url
>> from django.contrib import admin
>> from django.conf import settings
>> from django.conf.urls.static import static
>>
>> urlpatterns = patterns('',
>> # Examples:
>> url(r'reg4/$', 'register.views.reg4', name='reg4'),
>> url(r'reg3/$', 'register.views.reg3', name='reg3'),
>> url(r'reg2/$', 'register.views.reg2', name='reg2'),
>> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
>> url(r'reg1/$', 'register.views.reg1', name='reg1'),
>> #url(r'^$', 'register.views.home', name='home'),
>> url(r'reg/$', 'register.views.home', name='home'),
>> url(r'get_courts/(\d+)$', 'register.views.get_courts',
>> name='get_courts'),
>> url(r'get_courses/(\d+)$', 'register.views.get_courses',
>> name='get_courses'),
>> url(r'autoschedule/', 'register.views.autoschedule',
>> name='autoschedule'),
>> url(r'get_cities/(\d+)$', 'register.views.get_cities',
>> name='get_cities'),
>> url(r'get_classes/(\d+)$', 'register.views.get_classes',
>> name='get_classes'),
>> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
>> name='get_cities2'),
>> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2',
>> name='get_classes2'),
>> url(r'rejected/$', 'register.views.rejected', name='rejected'),
>> url(r'finished/$', 'register.views.finished', name='finished'),
>>
>> ##url(r'^$', 'profiles.views.home', name='home'),
>> #url(r'^contact/$', 'register.views.home', name='contact'),
>> #url(r'^about/$', 'register.views.about', name='about'),
>> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
>> #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
>> # url(r'^blog/', include('blog.urls')),
>>
>> url(r'^admin/', include(admin.site.urls)),
>> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>>
>> What is required?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFKhtoSO2XrckAe6uqpYoHYxKnqSm4sm3GkaNZXfUeXGs90Ftw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

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 decrypt my signature and be sure it came from me. Your
email software can handle signing.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/21946589-28bb-ff69-9e29-17a1d59ec851%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


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/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 can replace them all
> with re_path. A quick and dirty starter might be to replace the next line
> and see where that gets you ...
>
> from django.conf.urls import patterns, include, url
>
>
> from django.urls import include
> from django.urls import re_path as url
>
> If that gets you a bit further there is a lot more to do. Really the only
> methodical way forward is to upgrade Django a step at a time after studying
> the release notes for the next version.
>
> Finally you should decide whether to get rid of re_path (as url) and
> refactor to use path. Depends on you view of the future.
>
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = patterns('',
> # Examples:
> url(r'reg4/$', 'register.views.reg4', name='reg4'),
> url(r'reg3/$', 'register.views.reg3', name='reg3'),
> url(r'reg2/$', 'register.views.reg2', name='reg2'),
> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
> url(r'reg1/$', 'register.views.reg1', name='reg1'),
> #url(r'^$', 'register.views.home', name='home'),
> url(r'reg/$', 'register.views.home', name='home'),
> url(r'get_courts/(\d+)$', 'register.views.get_courts',
> name='get_courts'),
> url(r'get_courses/(\d+)$', 'register.views.get_courses',
> name='get_courses'),
> url(r'autoschedule/', 'register.views.autoschedule',
> name='autoschedule'),
> url(r'get_cities/(\d+)$', 'register.views.get_cities',
> name='get_cities'),
> url(r'get_classes/(\d+)$', 'register.views.get_classes',
> name='get_classes'),
> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
> name='get_cities2'),
> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2',
> name='get_classes2'),
> url(r'rejected/$', 'register.views.rejected', name='rejected'),
> url(r'finished/$', 'register.views.finished', name='finished'),
>
> ##url(r'^$', 'profiles.views.home', name='home'),
> #url(r'^contact/$', 'register.views.home', name='contact'),
> #url(r'^about/$', 'register.views.about', name='about'),
> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
> #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>
> What is required?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com
> 
> .
>
>
>
> --
> 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 decrypt my signature and be sure it came from me. Your
> email software can handle signing.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9f972f6c-9a19-8da0-c2fb-2a0a56237f24%40dewhirst.com.au
> 
> .
>


-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO1ZCyEjDyU_9hBfm55Vau89BUBwax4NCJ0bEZ7kX-zVng%40mail.gmail.com.


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 can replace them all 
with re_path. A quick and dirty starter might be to replace the next 
line and see where that gets you ...



from django.conf.urls import patterns, include, url


from django.urls import include
from django.urls import re_path as url

If that gets you a bit further there is a lot more to do. Really the 
only methodical way forward is to upgrade Django a step at a time after 
studying the release notes for the next version.


Finally you should decide whether to get rid of re_path (as url) and 
refactor to use path. Depends on you view of the future.



from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = patterns('',
    # Examples:
    url(r'reg4/$', 'register.views.reg4', name='reg4'),
    url(r'reg3/$', 'register.views.reg3', name='reg3'),
    url(r'reg2/$', 'register.views.reg2', name='reg2'),
    #url(r'reg1/$', 'register.views.reg1', name='reg1'),
    url(r'reg1/$', 'register.views.reg1', name='reg1'),
    #url(r'^$', 'register.views.home', name='home'),
    url(r'reg/$', 'register.views.home', name='home'),
    url(r'get_courts/(\d+)$', 'register.views.get_courts', 
name='get_courts'),
    url(r'get_courses/(\d+)$', 'register.views.get_courses', 
name='get_courses'),
    url(r'autoschedule/', 'register.views.autoschedule', 
name='autoschedule'),
    url(r'get_cities/(\d+)$', 'register.views.get_cities', 
name='get_cities'),
    url(r'get_classes/(\d+)$', 'register.views.get_classes', 
name='get_classes'),
    url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2', 
name='get_cities2'),
    url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2', 
name='get_classes2'),

    url(r'rejected/$', 'register.views.rejected', name='rejected'),
    url(r'finished/$', 'register.views.finished', name='finished'),

    ##url(r'^$', 'profiles.views.home', name='home'),
    #url(r'^contact/$', 'register.views.home', name='contact'),
    #url(r'^about/$', 'register.views.about', name='about'),
    #url(r'^profile/$', 'register.views.user_profile', name='profile'),
    #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)

What is required?

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com 
.



--
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 decrypt my signature and be sure it came from me. Your
email software can handle signing.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9f972f6c-9a19-8da0-c2fb-2a0a56237f24%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


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  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:
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = patterns('',
> # Examples:
> url(r'reg4/$', 'register.views.reg4', name='reg4'),
> url(r'reg3/$', 'register.views.reg3', name='reg3'),
> url(r'reg2/$', 'register.views.reg2', name='reg2'),
> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
> url(r'reg1/$', 'register.views.reg1', name='reg1'),
> #url(r'^$', 'register.views.home', name='home'),
> url(r'reg/$', 'register.views.home', name='home'),
> url(r'get_courts/(\d+)$', 'register.views.get_courts',
> name='get_courts'),
> url(r'get_courses/(\d+)$', 'register.views.get_courses',
> name='get_courses'),
> url(r'autoschedule/', 'register.views.autoschedule',
> name='autoschedule'),
> url(r'get_cities/(\d+)$', 'register.views.get_cities',
> name='get_cities'),
> url(r'get_classes/(\d+)$', 'register.views.get_classes',
> name='get_classes'),
> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
> name='get_cities2'),
> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2',
> name='get_classes2'),
> url(r'rejected/$', 'register.views.rejected', name='rejected'),
> url(r'finished/$', 'register.views.finished', name='finished'),
>
> ##url(r'^$', 'profiles.views.home', name='home'),
> #url(r'^contact/$', 'register.views.home', name='contact'),
> #url(r'^about/$', 'register.views.about', name='about'),
> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
> #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>
> What is required?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFKhtoSO2XrckAe6uqpYoHYxKnqSm4sm3GkaNZXfUeXGs90Ftw%40mail.gmail.com.


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 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. Your 
templates are done and may not need to be touched at all. Settings 
will be different so build that in as your progress through the 
implementation. You may need to "port" any customisations - for 
example middleware and templatetags, but structurally the application 
should be much the same.


HTH,
David



On Sat, Jun 3, 2023 at 7:21 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:

from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = patterns('',
    # Examples:
    url(r'reg4/$', 'register.views.reg4', name='reg4'),
    url(r'reg3/$', 'register.views.reg3', name='reg3'),
    url(r'reg2/$', 'register.views.reg2', name='reg2'),
    #url(r'reg1/$', 'register.views.reg1', name='reg1'),
    url(r'reg1/$', 'register.views.reg1', name='reg1'),
    #url(r'^$', 'register.views.home', name='home'),
    url(r'reg/$', 'register.views.home', name='home'),
    url(r'get_courts/(\d+)$', 'register.views.get_courts',
name='get_courts'),
    url(r'get_courses/(\d+)$', 'register.views.get_courses',
name='get_courses'),
    url(r'autoschedule/', 'register.views.autoschedule',
name='autoschedule'),
    url(r'get_cities/(\d+)$', 'register.views.get_cities',
name='get_cities'),
    url(r'get_classes/(\d+)$', 'register.views.get_classes',
name='get_classes'),
    url(r'get_cities2/(\d+)/(\d+)/$',
'register.views.get_cities2', name='get_cities2'),
    url(r'get_classes2/(\d+)/(\d+)/$',
'register.views.get_classes2', name='get_classes2'),
    url(r'rejected/$', 'register.views.rejected', name='rejected'),
    url(r'finished/$', 'register.views.finished', name='finished'),

    ##url(r'^$', 'profiles.views.home', name='home'),
    #url(r'^contact/$', 'register.views.home', name='contact'),
    #url(r'^about/$', 'register.views.about', name='about'),
    #url(r'^profile/$', 'register.views.user_profile',
name='profile'),
    #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)

What is required?

-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com

.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE5VhgUVKqLiGRk80bP2B4O7%3DWBTgkzkS%2BBwHWRByybz_B8HVQ%40mail.gmail.com 
.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23be0d49-2679-8515-fb35-9bd66bb59ffe%40jfcomputer.com.


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. Your
templates are done and may not need to be touched at all. Settings will be
different so build that in as your progress through the implementation. You
may need to "port" any customisations - for example middleware and
templatetags, but structurally the application should be much the same.

HTH,
David



On Sat, Jun 3, 2023 at 7:21 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:
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = patterns('',
> # Examples:
> url(r'reg4/$', 'register.views.reg4', name='reg4'),
> url(r'reg3/$', 'register.views.reg3', name='reg3'),
> url(r'reg2/$', 'register.views.reg2', name='reg2'),
> #url(r'reg1/$', 'register.views.reg1', name='reg1'),
> url(r'reg1/$', 'register.views.reg1', name='reg1'),
> #url(r'^$', 'register.views.home', name='home'),
> url(r'reg/$', 'register.views.home', name='home'),
> url(r'get_courts/(\d+)$', 'register.views.get_courts',
> name='get_courts'),
> url(r'get_courses/(\d+)$', 'register.views.get_courses',
> name='get_courses'),
> url(r'autoschedule/', 'register.views.autoschedule',
> name='autoschedule'),
> url(r'get_cities/(\d+)$', 'register.views.get_cities',
> name='get_cities'),
> url(r'get_classes/(\d+)$', 'register.views.get_classes',
> name='get_classes'),
> url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2',
> name='get_cities2'),
> url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2',
> name='get_classes2'),
> url(r'rejected/$', 'register.views.rejected', name='rejected'),
> url(r'finished/$', 'register.views.finished', name='finished'),
>
> ##url(r'^$', 'profiles.views.home', name='home'),
> #url(r'^contact/$', 'register.views.home', name='contact'),
> #url(r'^about/$', 'register.views.about', name='about'),
> #url(r'^profile/$', 'register.views.user_profile', name='profile'),
> #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> ) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
>
> What is required?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE5VhgUVKqLiGRk80bP2B4O7%3DWBTgkzkS%2BBwHWRByybz_B8HVQ%40mail.gmail.com.


how to convert to Django 3 or 4

2023-06-02 Thread john fabiani

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:

from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = patterns('',
    # Examples:
    url(r'reg4/$', 'register.views.reg4', name='reg4'),
    url(r'reg3/$', 'register.views.reg3', name='reg3'),
    url(r'reg2/$', 'register.views.reg2', name='reg2'),
    #url(r'reg1/$', 'register.views.reg1', name='reg1'),
    url(r'reg1/$', 'register.views.reg1', name='reg1'),
    #url(r'^$', 'register.views.home', name='home'),
    url(r'reg/$', 'register.views.home', name='home'),
    url(r'get_courts/(\d+)$', 'register.views.get_courts', 
name='get_courts'),
    url(r'get_courses/(\d+)$', 'register.views.get_courses', 
name='get_courses'),
    url(r'autoschedule/', 'register.views.autoschedule', 
name='autoschedule'),
    url(r'get_cities/(\d+)$', 'register.views.get_cities', 
name='get_cities'),
    url(r'get_classes/(\d+)$', 'register.views.get_classes', 
name='get_classes'),
    url(r'get_cities2/(\d+)/(\d+)/$', 'register.views.get_cities2', 
name='get_cities2'),
    url(r'get_classes2/(\d+)/(\d+)/$', 'register.views.get_classes2', 
name='get_classes2'),

    url(r'rejected/$', 'register.views.rejected', name='rejected'),
    url(r'finished/$', 'register.views.finished', name='finished'),

    ##url(r'^$', 'profiles.views.home', name='home'),
    #url(r'^contact/$', 'register.views.home', name='contact'),
    #url(r'^about/$', 'register.views.about', name='about'),
    #url(r'^profile/$', 'register.views.user_profile', name='profile'),
    #url(r'^checkout/$', 'checkout.views.checkout', name='checkout'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
) + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)

What is required?

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8f8a68b4-a3c5-a10d-8246-2ef41635b406%40jfcomputer.com.