
Subterfuge – No module named defaults – resolved
Why does this happen?
After scratching my head for a couple of minutes over this I realized that this was a compilation or rather package error by the subterfuge. And happens because the configuration file that Ubuntu is referring to inside the urls.py file no longer exists. Well technically speaking it does still exist but just with a different file name. This means that the reference information inside the original django.conf.urls.defaults file is still relevant and the same as the previous file but the pointer inside the urls.py file is broken as it is referring to a file that simply does not exist.
I hope that this gets resolved in newer versions but for the time being I have got the solution for you below.
The he complete error that you receive is:
ImportError at /
No module named defaults
Request Method: GET
Request URL: http://127.0.0.1/
Django Version: 1.6.1
Exception Type: ImportError
Exception Value:
No module named defaults
Exception Location: /usr/share/subterfugea/urls.py in , line 1
Pythone Executable: /usr/bin/python
Python Version: 2.7.6
Python Path:
[‘/usr/share/subterfuge’,
‘/usr/share’,
‘/usr/lib/python2.7’,
‘/usr/lib/python2.7/plat-x86_64-linux-gnu’,
‘/usr/lib/python2.7/lib-tk’,
‘/usr/lib/python2.7/lib-old’,
‘/usr/lib/python2.7/lib-dynload’,
‘/usr/local/lib/python2.7/dist-packages’,
‘/usr/lib/python2.7/dist-packages’,
‘/usr/lib/python2.7/dist-packages/PILcompat’,
‘/usr/lib/python2.7/dist-packages/gtk-2.0’,
‘/usr/lib/python2.7/dist-packages/ubuntu-sso-client’]
Server time: Mon, 4 Apr 2016 02:14:44 -0500
Let’s look at the SOLUTION
1. Edit the following file using your favorite editor, in my case I will be using gedit
sudo gedit /usr/share/subterfuge/urls.py
2. Inside the urls.py file on line 1 you should have the following
from django.conf.urls.defaults import patterns, include, url
3. Remove the word “defaults” so it looks like this
from django.conf.urls import patterns, include, url
4. Save the file and start the application by running the following command
sudo subterfuge
NOTE:
You might get the following “error that port is already in use”, simply run the following to kill all the processes associated with port 80
sudo fuser -k 80/tcp
If this was helpful please consider a donation
Thank you for following my tutorial. You can click here for more Ubuntu Tutorials.
[sg_popup id=1]