English 中文(简体)
将 Django 1. 3 移动到新服务器
原标题:Moving Django 1.3 to new server
  • 时间:2012-05-25 11:18:52
  •  标签:
  • django

我试图移动Django 1. 3所建立的网站。

服务器被设置为 Privits 之一( 我想是的 ) 。

After Django installation, I moved all files to new server, I swap settings files so now in settings are files from the privies server. I changed files locations in setting, so right now all are pointed to sew server location. Also some modules was missing which I install and I don’t get errors with missing django modules.

当我试图在互联网上显示时, 我就会发现以下错误:

[root@575283 somod]# python manage.py runserver 0.0.0.0:8000
Traceback (most recent call last):
File "manage.py", line 13, in <module>
  execute_manager(settings)
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
  utility.execute()
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
  self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
  self.execute(*args, **options.__dict__)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 209, in execute
  translation.activate( en-us )
File "/usr/lib/python2.6/site-packages/django/utils/translation/__init__.py", line 100, in activate
  return _trans.activate(language)
File "/usr/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 202, in activate
  _active.value = translation(language)
File "/usr/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 185, in translation
  default_translation = _fetch(settings.LANGUAGE_CODE)
File "/usr/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 162, in _fetch
  app = import_module(appname)
File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
  __import__(name)
File "/usr/lib/python2.6/site-packages/sorl_thumbnail-11.12-py2.6.egg/sorl/thumbnail/__init__.py", line 1, in <module>
  from sorl.thumbnail.fields import ImageField
File "/usr/lib/python2.6/site-packages/sorl_thumbnail-11.12-py2.6.egg/sorl/thumbnail/fields.py", line 2, in <module>
  from django.db import models
File "/usr/lib/python2.6/site-packages/django/db/__init__.py", line 78, in <module>
  connection = connections[DEFAULT_DB_ALIAS]
File "/usr/lib/python2.6/site-packages/django/db/utils.py", line 93, in __getitem__
  backend = load_backend(db[ ENGINE ])
File "/usr/lib/python2.6/site-packages/django/db/utils.py", line 33, in load_backend
  return import_module( .base , backend_name)
File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
  __import__(name)
File "/usr/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 14, in <module>
  raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

我猜我错过了 MySQLdb 模块, 有没有提示?

其他产出线呢?

Old server has Django 1.3
I m using CentOS 6, Apache 2, Django 1.3.1, mod_wsgi, Python 2.6.6

最佳回答

您需要安装 < a href=> http://pypi.python.org/pypi/MySQL-python> >MySQL-python 。 您可以使用 < a href=> 安装 http://www.pip-revelopter.org/en/latest/index.html >pip :

sudo pip安裝 MySQL- python

如果您需要帮助使用 Apache 来运行 Django 的 Django, 请查看 < a href='https://docs.djangoproject.com/ en/ dev/ howto/ mote/ wsgi/modwsgi/ > > 官方 docs 。 如果它们混淆了, < a href= 'https://www.google.se/ webhp? sourdi=chrome- stant& =UTFF- 8& = 1# hl=sv& slib=ps- a& 20f- furp;... 2231.20. 809. 0. 0. 0. 00. 0. 258....5....... GID_ br=20ache.

祝你好运:)

问题回答

暂无回答




相关问题
How to get two random records with Django

How do I get two distinct random records using Django? I ve seen questions about how to get one but I need to get two random records and they must differ.

Moving (very old) Zope/Plone Site to Django

I am ask to move data from a (now offline) site driven by Plone to a new Django site. These are the version informations I have: Zope Version (unreleased version, python 2.1.3 ) Python Version 2.1....

Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

Flexible pagination in Django

I d like to implement pagination such that I can allow the user to choose the number of records per page such as 10, 25, 50 etc. How should I go about this? Is there an app I can add onto my project ...

is it convenient to urlencode all next parameters? - django

While writing code, it is pretty common to request a page with an appended "next" query string argument. For instance, in the following template code next points back to the page the user is on: &...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

热门标签