WebFaction
Community site: login faq

Hello,

Just trying to get my Django-Webapp up and running.

I did my steps according to https://docs.webfaction.com/software/django/getting-started.html?highlight=django%2520#getting-started-with-django

The database section in settings.py reads like this:

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'xxx', 'USER': 'xxx', 'PASSWORD': 'xxx', 'HOST': '127.0.0.1', 'PORT': '3306', } }

I issue this command:

python3.5 manage.py migrate

This gives me the error that module MySQLdb is mising:

` File "/home/stephan0h/webapps/unplugsticker/lib/python3.5/Django-1.9.2-py3.5.egg/django/db/backends/mysql/base.py", line 25, in <module> import MySQLdb as Database ImportError: No module named 'MySQLdb'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/stephan0h/webapps/unplugsticker/lib/python3.5/Django-1.9.2-py3.5.egg/django/core/management/__init__.py", line 353, in execute_from_command_line

`

Do I need to install this module manually and if so, how to do it?

thanks, stephan

asked 26 Feb '16, 10:53

stephan0h
1315
accept rate: 0%

Just tried to install with "easy_install-3.5 -U MySQL-python" - does not work. I'm missing the modules with "python3.5", starting "python" alone gives me python 2.7.5 where i can import MySQLdb without problems!

(26 Feb '16, 11:08) stephan0h

The MySQLdb module is not compatible with Python 3.

Instead, you should use the mysqlclient module, as recommended in the official Django documentation:

mkdir -p ~/lib/python3.5
easy_install-3.5 mysqlcient

Hope that helps!

permanent link

answered 26 Feb '16, 20:19

seanf
12.2k41836
accept rate: 37%

Thanks a lot, that helps indeed!

(27 Feb '16, 12:42) stephan0h
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×168

question asked: 26 Feb '16, 10:53

question was seen: 4,447 times

last updated: 27 Feb '16, 12:42

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM