0

I have an old django project and I built it in docker for the development environment,
django 1.3.1 is installed. (Python version is 2.7 setting in docker-compose)

Is there any way to upgrade to django 1.3.7?
Thanks for advance.

I tried followings but don't work.

  • apt-get upgrade django
  • apt-get install python-pip and pip install [--upgrade] django==1.3.7

Downloading/unpacking Django==1.3.7
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement Django==1.3.7
No distributions at all found for Django==1.3.7

My dockerfile:

FROM ubuntu:12.04

...

# Install dependencies
RUN apt-get update \
  && apt-get install -y \
        apache2 \
        libapache2-mod-wsgi \
        mysql-server \
        python-mysqldb \
        python-django
...
Doyoun
  • 89
  • 1
  • 11

1 Answers1

0

Firstly, keep in mind that Django 1.3.7 is an old version and might contain security vulnerabilities. Upgrading to a more recent Django version could make your project more secure and stable.

Below are the steps to upgrade Django 1.3.1 to 1.3.7 in a Docker image based on Ubuntu 14.04:

Dockerfile:

FROM ubuntu:14.04

...

# Update dependencies and install prerequisites
RUN apt-get update && apt-get install -y \
    apache2 \
    libapache2-mod-wsgi \
    mysql-server \
    python-mysqldb \
    python-pip

# Upgrade Django to 1.3.7
RUN pip install --upgrade --index-url=https://pypi.org/simple/ django==1.3.7

...

With these steps, you can update your Docker image and install Django 1.3.7. However, remember that Django 1.3.7 is an outdated version and could be vulnerable to future security issues. If possible, consider upgrading your project to a more current Django version.

Keep in mind that your code might need to be compatible with the newer Django version, so make sure to test your code and make necessary adjustments before upgrading.

mert2
  • 37
  • 5
  • Thanks, @mert2. But it didn' work well. I found `https://pypi.org/simple/django/` and tar.gz link and tried --find-links option, shown `failed to solve: executor failed running [/bin/sh -c pip install --upgrade --index-url https://pypi.org/simple/django/Django-1.3.7.tar.gz]: exit code: 1` – Doyoun Aug 17 '23 at 07:37
  • I found the solution `RUN pip install -U https://www.djangoproject.com/m/releases/1.3/Django-1.3.7.tar.gz` – Doyoun Aug 17 '23 at 08:41
  • Thanks, @Doyoun. Previous methods didn't work, including the --find-links option. However, RUN pip install -U https://www.djangoproject.com/m/releases/1.3/Django-1.3.7.tar.gz solved it for me. Thanks again! – mert2 Aug 17 '23 at 09:36