django problem with mysql and apache

128 views
Skip to first unread message

th.gr...@free.fr

unread,
Dec 23, 2014, 8:24:16 PM12/23/14
to django...@googlegroups.com
Hello
i have just installed Django on Ubuntu 14.04  and i'd like to know

1  how to do a multilingual site?
2 how to do a forum or use one existent

3 during the installation i have this probleme about mysql



root@linux-pc:/home/siteweb# python3.4 manage.py migrate
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/django/db/backends/mysql/base.py", line 14, 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 "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/usr/local/lib/python3.4/dist-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.4/dist-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/usr/local/lib/python3.4/dist-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/usr/local/lib/python3.4/dist-packages/django/contrib/auth/models.py", line 40, in <module>
    class Permission(models.Model):
  File "/usr/local/lib/python3.4/dist-packages/django/db/models/base.py", line 124, in __new__
    new_class.add_to_class('_meta', Options(meta, **kwargs))
  File "/usr/local/lib/python3.4/dist-packages/django/db/models/base.py", line 299, in add_to_class
    value.contribute_to_class(cls, name)
  File "/usr/local/lib/python3.4/dist-packages/django/db/models/options.py", line 166, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/usr/local/lib/python3.4/dist-packages/django/db/__init__.py", line 40, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/usr/local/lib/python3.4/dist-packages/django/db/utils.py", line 242, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/usr/local/lib/python3.4/dist-packages/django/db/utils.py", line 108, in load_backend
    return import_module('%s.base' % backend_name)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/usr/local/lib/python3.4/dist-packages/django/db/backends/mysql/base.py", line 17, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'




how can i repair this?


AND finally
4 i'd like ti use my apache server instead of the server provided by Django. I have made the modifications in the apacahe2.conf
but now??

how use apache instead of the internat server od Django?


MANY THANKS

Sandeep kaur

unread,
Dec 24, 2014, 11:16:17 AM12/24/14
to django-users

On Wed, Dec 24, 2014 at 6:54 AM, <th.gr...@free.fr> wrote:
>
> 3 during the installation i have this probleme about mysql
>
>
>
> root@linux-pc:/home/siteweb# python3.4 manage.py migrate
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.4/dist-packages/django/db/backends/mysql/base.py", line 14, in <module>
>     import MySQLdb as Database
> ImportError: No module named 'MySQLdb'

About this, try installing MySQLdb using this command:
apt-get install python-mysqldb

--

Collin Anderson

unread,
Dec 29, 2014, 12:32:46 AM12/29/14
to django...@googlegroups.com
Hi,

1. I don't do a lot of multilingual, but here's a start:
If you have _content_ that's in multiple languages, you generally will want separate urls, like https://example.com/en/some/page/

2. Not sure on the best forum software for django.

3. Like mentioned, run:
apt-get install python-mysqldb
or us the recommended mysqlclient
apt-get install mysql-dev
pip install mysqlclient

4. If you haven't already, check out the django's mod_wsgi docs:

Collin
Reply all
Reply to author
Forward
0 new messages