dreamhost python3 Django passenger setup import Cookie - django

I am trying to setup django with python3 on dreamhost.
I have setup a virtualenv as documented by them and installed all the pre-requisites. I have gotten runserver working
The problem comes with passenger setup. The error log shows that I am unable to import a module named Cookie, resulting out of further errors.
This is the traceback:
File "/home/user/path/env/lib/python3.4/imp.py", line 171, in load_source
module = methods.load()
File "<frozen importlib._bootstrap>", line 1220, in load
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "passenger_wsgi.py", line 17, in <module>
from django.core.wsgi import get_wsgi_application
File "/home/user/path/env/lib/python3.4/site-packages/django/core/wsgi.py", line 2, in <module>
from django.core.handlers.wsgi import WSGIHandler
File "/home/user/path/env/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 11, in <module>
from django import http
File "/home/user/path/env/lib/python3.4/site-packages/django/http/__init__.py", line 1, in <module>
from django.http.cookie import SimpleCookie, parse_cookie
File "/home/user/path/env/lib/python3.4/site-packages/django/http/cookie.py", line 5, in <module>
from django.utils.six.moves import http_cookies
File "/home/user/path/env/lib/python3.4/site-packages/django/utils/six.py", line 90, in __get__
result = self._resolve()
File "/home/user/path/env/lib/python3.4/site-packages/django/utils/six.py", line 113, in _resolve
return _import_module(self.mod)
File "/home/user/path/env/lib/python3.4/site-packages/django/utils/six.py", line 80, in _import_module
__import__(name)
File "/home/user/path/env/lib/python3.4/site-packages/django/http/__init__.py", line 1, in <module>
from django.http.cookie import SimpleCookie, parse_cookie
ImportError: cannot import name 'SimpleCookie'
as you can see the line,
from django.core.wsgi import get_wsgi_application
is failing
on the other hand, when i try it with the python interpreter, it imports correctly.
I have also verified that the same interpreter is being used by passenger by logging the variable
import sys
raise Exception(sys.executable)
Any ideas as to the cause of this?
I tried logging path, it displays the following
['/home/user/path/env/lib/python3.4/site-packages', '/home/user/path/env/lib/python3.4/site-packages/django', '/home/user/path/env/bin', '/home/user/path', '/usr/local/dh/passenger/helper-scripts', '/home/user/path/env/lib/python34.zip', '/home/user/path/env/lib/python3.4', '/home/user/path/env/lib/python3.4/plat-linux', '/home/user/path/env/lib/python3.4/lib-dynload', '/home/user/opt/python-3.4.2/lib/python3.4', '/home/user/opt/python-3.4.2/lib/python3.4/plat-linux', '/home/user/path/env/lib/python3.4/site-packages', '/home/user/path', '/home/user/path/git/package']
which seems fine to me

The instructions in dreamhost wiki works fine. You just need to remove the extra django path in your wsgi config file. It should look like this:
...
cwd = os.getcwd()
sys.path.append(cwd)
sys.path.append(cwd + '/projectname') #You must add your project here
sys.path.insert(0,cwd+'/env/bin')
sys.path.insert(0,cwd+'/env/lib/python2.7/site-packages')
...
not like this:
...
cwd = os.getcwd()
sys.path.append(cwd)
sys.path.append(cwd + '/projectname') #You must add your project here
sys.path.insert(0,cwd+'/env/lib/python2.7/site-packages/django')
sys.path.insert(0,cwd+'/env/bin')
sys.path.insert(0,cwd+'/env/lib/python2.7/site-packages')
...

I ran into a same problem and the following solution works for me.
I have Django 1.7 with Python 3.4, using Eclipse with PyDev as my IDE.
My solution is related to this thread: Import Python module fails (http.cookies)
What I did:
In Eclipse, go to tab Project/Properties
Select side-tab PyDev - PYTHONPATH
Select External Libraries
There should be a path which looks like /.../lib/pythonX.Y/site-packages/django. Remove it.
(I was using the venv package to create my virtual environment. Your path may differ.)
Run the project and see if it works.
Comment: I think this is indeed a very weird problem... Something to do with the PyDev - DjangoProject setup with Python3, possibly. Let me know if this helps.

Related

Apache + mod_wsgi + Django + dataclasses stopped working after upgrade to python3.10

After upgrading to python3.10 code with dataclasses stopped working with mod_wsgi.
If a class is created with #dataclass decorator (with just a single attribute x: str) and then instantiated somewhere in apps.py at module level, an exception is thrown. The reason is missing generated __init__ method (I confirmed that everything works if I define __init__ manually). Unfortunately, in real project it's part of external library and dataclass is instantiated in imported module, so there's no way to define __init__ by hands. The code without changes (all packages have same versions too) works with python3.9.
To be clear, here's the code:
# models.py
from dataclasses import dataclass
#dataclass
class Test:
foo: str
# apps.py
from django.apps import AppConfig
from .models import Test
Test('bar') # Error is thrown here
class AppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'app'
It seems like there's a bug somewhere. I also know that mod_wsgi only support python up to 3.8, according to data on pypi, but can't believe the answer is "Look for other wsgi solution or don't upgrade yet" (if so - tell me too, it might be true). You might notice that Django is of version 3.2 in requirements while 4.0 is available: I tried upgrading on this demo project, nothing has changed, plus django 3.2 claims to support python3.10 too (on the real project I can't upgrade due do dependencies using deprecated functions). So my questions are:
Am I missing something that should be changed on upgrade to python 3.10 in this case?
If it's some inner bug, where should I report it --- to python 3.10, to mod_wsgi or to Django?
The traceback is:
Traceback (most recent call last):
File "/var/www/html/proof/proof/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/usr/local/lib/python3.10/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/usr/local/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python3.10/site-packages/django/apps/config.py", line 124, in create
mod = import_module(mod_path)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/var/www/html/proof/app/apps.py", line 6, in <module>
Test('bar')
TypeError: Test() takes no arguments
Here's repo with more details and full project layout, also Dockerfile present so you can reproduce easily.

Getting error cannot import name 'six' from 'django.utils' when using Django 3.0.0 latest version

Currently I have upgraded version of Django 2.2 to 3.0 and suddenly getting error like below.
ImportError: cannot import name 'six' from 'django.utils'
I have checked
Traceback is like below.
Traceback (most recent call last):
File "c:\Users\admin\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\ptvsd_launcher.py", line 43, in <module>
main(ptvsdArgs)
File "c:\Users\admin\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 432, in main
run()
File "c:\Users\admin\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 316, in run_file
runpy.run_path(target, run_name='__main__')
File "C:\Python37\Lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Python37\Lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Python37\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\production\myproject\erp_project\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "d:\production\myproject\venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "d:\production\myproject\venv\lib\site-packages\django\core\management\__init__.py", line 377, in execute
django.setup()
File "d:\production\myproject\venv\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "d:\production\myproject\venv\lib\site-packages\django\apps\registry.py", line 92, in populate
app_config = AppConfig.create(entry)
File "d:\production\myproject\venv\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "d:\production\myproject\venv\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "d:\production\myproject\venv\lib\site-packages\post_office\__init__.py", line 3, in <module>
from .backends import EmailBackend
File "d:\production\myproject\venv\lib\site-packages\post_office\backends.py", line 6, in <module>
from .settings import get_default_priority
File "d:\production\myproject\venv\lib\site-packages\post_office\settings.py", line 101, in <module>
context_field_class = import_attribute(CONTEXT_FIELD_CLASS)
File "d:\production\myproject\venv\lib\site-packages\post_office\compat.py", line 45, in import_attribute
module = importlib.import_module(module_name)
File "d:\production\myproject\venv\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "d:\production\myproject\venv\lib\site-packages\jsonfield\__init__.py", line 1, in <module>
from .fields import JSONField, JSONCharField # noqa
File "d:\production\myproject\venv\lib\site-packages\jsonfield\fields.py", line 21, in <module>
from .encoder import JSONEncoder
File "d:\production\myproject\venv\lib\site-packages\jsonfield\encoder.py", line 2, in <module>
from django.utils import six, timezone
ImportError: cannot import name 'six' from 'django.utils' (d:\production\myproject\venv\lib\site-packages\django\utils\__init__.py)
I have checked in folder Lib\site-packages\django\utils and not found and six.py file but still from Lib\site-packages\jsonfield\encode.py containing line from django.utils import six, timezone which trying to import six but not able to find.
Earlier version of django containing six.py file in folder Lib\site-packages\django\utils.
Any idea how to solve this ?
Short answer: you might want to abandon django-jsonfield.
Based on the traceback, you are using the django-jsonfield package [GitHub], and this is a known issue [GitHub-issue]. It depends on the django.utils.six module, but that module has been removed in django-3.0.
At the moment, you thus can not use django-3.0 with django-jsonfield, and since the last commit to this project is from October 2017, perhaps the project is not that "active" anymore, and it thus might take a very long time (or even never) get fixed. The successor of django-jsonfield is jsonfield2 ([GitHub]). It was made compatible with django-3.0 by a pull request in October (2019) [GitHub-pr].
in order to use the six module you can install it directly using pip and then modify the django-jsonfield package accordingly . What I mean is find the files in the package where there is from django.utils import six and replace them with import six. Then it should be working. I faced the same issue when using djongo with django 3.0. I found the respective file and replaced it with the above suggestion. Please note that it is never recommended to do this if you are working on a production level or enterprise level project. I did it for my pet project.
A specified in Django 3.0 release note, django.utils.six is removed.
In case you need it, it is advised to use pypi packages instead
In your case, jsonfield package might be replaced by native Django's JSON Field.
Another solution would be to fork jsonfield package yourself to solve you issue, or to make a PR on project's repo'
Short Answer
in Django 3.0 just install six:
pip install six
And just use it like:
import six
In my case it was django-haystac causing this error.
It helped me to upgrade the pip package to the newest beta.
pip install django-haystack==3.0b2

django 2 not able to load env variables from the .env file to setting.py file

I tried to load environment variables from a file named .env to settings.py file
here i created the .env file and settings file same folder.
this is my .env file
DEBUG=on
SECRET_KEY=ksmdfw3324##jefm
DATABASE_URL=psql://urser:un-githubbedpassword#127.0.0.1:8458/database
SQLITE_URL=sqlite:///my-local-sqlite.db
CACHE_URL=memcache://127.0.0.1:11211,127.0.0.1:11212,127.0.0.1:11213
REDIS_URL=rediscache://127.0.0.1:6379/1?
client_class=django_redis.client.DefaultClient&password=ungithubbed-secret
MYSQL_DATABASE = student
MYSQL_USERNAME = root
SECRET_KEY=secret-key
this is my setting.py file
import os
from os.path import join, dirname
from dotenv import load_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)
# Accessing variables.
dbname = os.getenv('MYSQL_DATABASE')
secret_key = os.getenv('SECRET_KEY')
# Using variables.
print(dabname)
print(secret_key)
i installed pip install -U python-dotenv
Issue is i am not able to get environment variable inside settings file
while trying python manage.py runserver i am getting this error
C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\dotenv\main.py:65: UserWarning: File doesn't exist
warnings.warn("File doesn't exist {}".format(self.dotenv_path))
Traceback (most recent call last):
File "manage.py", line 28, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\django\core\management\__init__.py", line 371, in
execute_from_command_line
utility.execute()
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\django\core\management\__init__.py", line 317, in execute
settings.INSTALLED_APPS
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\django\conf\__init__.py", line 56, in __getattr__
self._setup(name)
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\django\conf\__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\django\conf\__init__.py", line 106, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-
32\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\xampp\htdocs\epitastudent\epitastudent\settings.py", line 25, in
<module>
load_dotenv()
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\dotenv\main.py", line 255, in load_dotenv
return DotEnv(f,
verbose=verbose).set_as_environment_variables(override=override)
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\dotenv\main.py", line 98, in set_as_environment_variables
os.environ[k] = v
File "C:\Users\mehul\AppData\Local\Programs\Python\Python36-32\lib\os.py",
line 675, in __setitem__
self.putenv(key, value)
ValueError: embedded null character
I am not sure how to create development and production environment variable and about this embedded null character. pls help me any one
Thanks in advance
Edit: I got now .env file to inside settings
import os
import environ
root = environ.Path(__file__) - 3 # three folder back (/a/b/c/ - 3 = /)
env = environ.Env(DEBUG=(bool, False),) # set default values and casting
environ.Env.read_env() # reading .env file
print(os.getenv('DATABASE_NAME'))
How can i differentiate development env credentials and production credentials
Try this instead:
import os
import environ
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
environ.Env.read_env(env_file=os.path.join(BASE_DIR, '.env'))
For future Googlers here's another approach. Inside manage.py add:
from dotenv import load_dotenv
load_dotenv()
Now you can do the following anywhere else in your project (including settings.py) to get access to environment variables:
import os
os.environ.get("NAME")
I was unable to load environment variables using load_dotenv() in Python version 3.5 - later versions were working fine.
The workaround is explicitly include the folder containing .env in the path. So, assuming folder project contains .env, settings.py will have following lines:
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
from dotenv import load_dotenv
load_dotenv(os.path.join(BASE_DIR, "project", ".env"))
I think there are mainly two packages to use
pip install django-environ and
pip install python-dotenv
I choose to use dotenv, as django-environ give me some error.
Error: The SECRET_KEY setting must not be empty
Below is my working solution, notice that it is square bracket [] when calling os.environ.
My version is Django==2.2.6, python==3.7.5
settings.py
import os
from dotenv import load_dotenv
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
load_dotenv(os.path.join(BASE_DIR, '.env'))
SECRET_KEY = os.environ['SECRET_KEY']
and the .env file is storing in the current directory with
.env
export SECRET_KEY="xxxxxx"
export DB_NAME = "xxx"
I'm not quite sure, but maybe it has to do with the path to the .env file. Maybe you should try in settings.py:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))
dotenv_path = os.path.join(BASE_DIR, file.env)

DJANGO_SETTINGS_MODULE No Module Named

I am trying to create a population script for my database, but I get a No module named error.
Project Structure:
staticone/
manage.py
mysite/
populate_rango
settings
urls
__init__
wsgi
rango/
Traceback:
Traceback (most recent call last):
File "populate_rango.py", line 8, in <module>
django.setup()
File "/home/ubuntu/virtenv/webstatic/lib/python3.5/site-
packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/ubuntu/virtenv/webstatic/lib/python3.5/site-
packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/ubuntu/virtenv/webstatic/lib/python3.5/site-
packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'mysite'
My path:
['/home/ubuntu/virtenv/webstatic/staticone/mysite',
'/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-
x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload',
'/home/ubuntu/virtenv/webstatic/lib/python3.5/site-packages']
My settings.py file is under mysite
populate_rango.py under mysite folder:
import sys
print (sys.path)
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE','settings')
import django
django.setup()
from mysite.rango.models import Category,Page
If I try
os.environ.setdefault('DJANGO_SETTINGS_MODULE','mysite.settings')
I get the same error:
No module named mysite.
mysite is on the path, so I am confused as to why it is not finding the settings file.
I needed to put the parent directory of mysite on the path. I only had /home/ubuntu/virtenv/webstatic/staticone/mysite. Now it works when I included
/home/ubuntu/virtenv/webstatic/staticone/.
import sys
sys.path.append("/home/ubuntu/virtenv/webstatic/staticone/")
print (sys.path)
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE','mysite.settings')
import django
django.setup()
from mysite.rango.models import Category,Page
Now it works.

Django and Pytz what is going wrong?

I'm currently trying to make Django1.6b2 with Python3.3 work on my server.
I got so many problems for now that I just can't list them (Flup, Threading, FastCGI) and finally I'm almost there. Here is my django.fcgi :
#!/home/benjamin/Python/3.3/bin/python3
import os, sys
import django
print("Django Version : {}".format(django.VERSION))
print("Python Version : {}".format(sys.version[:3]))
_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, _PROJECT_DIR)
sys.path.insert(0, os.path.dirname(_PROJECT_DIR))
_PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
And here is my traceback :
Traceback (most recent call last):
File "website/public/django.fcgi", line 17, in <module>
runfastcgi(method="threaded", daemonize="false")
File "/home/benjamin/Python/3.3/lib/python3.3/site-packages/django/core/servers/fastcgi.py", line 143, in runfastcgi
from django.core.servers.basehttp import get_internal_wsgi_application
File "/home/benjamin/Python/3.3/lib/python3.3/site-packages/django/core/servers/basehttp.py", line 25, in <module>
from django.core.wsgi import get_wsgi_application
File "/home/benjamin/Python/3.3/lib/python3.3/site-packages/django/core/wsgi.py", line 1, in <module>
from django.core.handlers.wsgi import WSGIHandler
File "/home/benjamin/Python/3.3/lib/python3.3/site-packages/django/core/handlers/wsgi.py", line 9, in <module>
from django import http
File "/home/benjamin/Python/3.3/lib/python3.3/site-packages/django/http/__init__.py", line 4, in <module>
from django.http.response import (HttpResponse, StreamingHttpResponse,
File "/home/benjamin/Python/3.3/lib/python3.3/site-packages/django/http/response.py", line 17, in <module>
from django.utils import six, timezone
File "/home/benjamin/Python/3.3/lib/python3.3/site-packages/django/utils/timezone.py", line 11, in <module>
import pytz
File "<frozen importlib._bootstrap>", line 1567, in _find_and_load
File "<frozen importlib._bootstrap>", line 1534, in _find_and_load_unlocked
File "/home/benjamin/modules/pytz-2013b-py2.6.egg/pytz/__init__.py", line 1103, in <module>
File "/home/benjamin/modules/pytz-2013b-py2.6.egg/pytz/__init__.py", line 1103, in <listcomp>
File "/home/benjamin/modules/pytz-2013b-py2.6.egg/pytz/__init__.py", line 107, in resource_exists
File "/home/benjamin/modules/pytz-2013b-py2.6.egg/pytz/__init__.py", line 100, in open_resource
File "/nfs/http7/benjamin/Python/distribute-0.7.3/pkg_resources.py", line 949, in resource_stream
self, resource_name
File "/nfs/http7/benjamin/Python/distribute-0.7.3/pkg_resources.py", line 1379, in get_resource_stream
return StringIO(self.get_resource_string(manager, resource_name))
File "/nfs/http7/benjamin/Python/distribute-0.7.3/pkg_resources.py", line 1956, in StringIO
return StringIO(*args,**kw)
TypeError: initial_value must be str or None, not bytes
How can I solve that ? It seems that Django tries to import a module that I can't find with pip-3.3 (pytz-2013b-py2.6.egg) it's 2.6 and why does pip install that ? xD
Could someone help me ? =)
It looks like a bug in distribute package for python3 at the following location -
pkg_resources.py -> get_resource_string
this method returns bytes and StringIO is expecting for string.
I tried to decode it by using decode("ISO-8859-1") method then I got error in pytz package.
However I got the workaround for this -
Change "./pytz-2013.7-py3.3.egg" to "./pytz" in
"site-packages/easy-install.pth" file.
Make sure you have unzipped pytz directory in your site-packages
directory.