Heading edited from “Migrating systers/portal to latest versions ” to “How I migrated systers/portal to latest versions” . P.S. Not a clickbait 😛
Before solving this issue [PR], I considered migrating portal is something so huge and hard. Although it’s huge, it’s definitely not hard. It just needs some time, knowing how to google right, and more importantly patience. All the while doing this, my moments ranged from ‘I have no clue’ to ‘Eureka! I did it’. Believe me, I was elated when I finally get it to work and solving no other bug gave me this immense happiness.
Most often, people eye only the achievement, and actually undervalue the work that should go into it. One of the reasons I am writing this post is to remind someone like me not to quit if it’s hard. Keep on trying, keep rewarding yourself for the small progress – and even when you think there’s no progress, and you don’t know what to do next, realise that you were better than what you were before. Okay, I don’t want to go all philosophical in this 😛
One other reason is that someone who wants to migrate any other project mustn’t reinvent the wheel i.e going through the same states like me. Hence, I included the thought processes, that went through my mind to finally able to migrate it.
Although, I was nowhere near completion I recorded my progress here coz I knew someday I would solve this. B)
24th October I noticed that I don’t have python3.6 installed. Installed it and fed it to the virtual environment. Now I removed all the versions in requirements files and set django version to 1.11.6.
python manage.py runserver
ImportError: No module named apps
So I checked the django documentation and found out this,
polls.apps.PollsConfig has to be added to settings file.
Then I figured, I need to read this.
After taking a one day break from this issue, I had a eureka moment.Instead of trying to read all the documentation, I should make a new dummy app. Compare between the old urls and settings files to new ones to edit them accordingly.
Templates in urls is changed. So I changed this in portal’s file.
TEMPLATES = [
I also compared settings files and read this, that it no longer uses patterns with it. https://docs.djangoproject.com/en/1.11/topics/http/urls/#example
I changed both of these.Now run the server again
I got this error. Now, removed this line
import community.signals # NOQA
I also got errors with server and views so I changed the urls.py accordingly.
Then I got an error with migrations. like this,
django.db.utils.programmingerror relation already exists
Then I run this command
python manage.py migrate --fake-initial
Migrations issue solved.
Time to solve warnings:
<Insert Image >
Warnings Solved! Yay!
Now it’s time to fix flake8.Ah! What a pain.
Migration of django and other packages to their latest versions is done. Tests and flake8 issues have to be checked.Skipping this for 27th october.
If you are currently using Django old versions, Follow these steps to upgrade.
If you get errors at any stage, don’t be overwhelmed.You have google else ask for help.
Install python 3.6, On ubuntu, Use these commands
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
You must be already having virtualenv, so you must delete the old environment and create a new one.
virtualenv venv --python=/usr/bin/python3.6 --no-site-packages
createuser alice --pwprompt
CREATE DATABASE systersdb;
ALTER DATABASE OWNER systersdb TO alice;