Thursday, June 8, 2023

Re: how to convert to Django 3 or 4

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.

On Fri, Jun 2, 2023 at 11:20 PM john fabiani <johnf@jfcomputer.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABD5YeFHT4CCtbqbT06eX815WKvH%3DH%3DO9tYGdOCeyRm438iaoA%40mail.gmail.com.

No comments:

Post a Comment