Summary of issues with the Python Django framework deployed on the SAE

Source: Internet
Author: User

This article focuses on some of the issues of deploying Python's Django Framework on the SAE, the SAE is an online app deployment platform for Sina and provides support for Python applications, and friends can refer to

It took some time to deploy the debris network to the SAE, and encountered various problems halfway. It feels like the SAE looks beautiful, but it's actually not too mature (at least Python version).

Here's a note of some of the major problems I've encountered and how to solve them.

Django Version problem

Django1.4 are about to be released, SAE platform with the SAE version is still 1.2x. To use the django1.3 version, you need to upload your own Django. You can refer to the RUNTIME.HTML#VIRTUALENV in SAE manual for the specific procedure.

Log module Error

The first encounter is the day to module problem. The error shows that a class is constructed in Adminemailhandler with the Is_mail parameter, but the constructor of the target class is not supported at all. Good day to the module is not required. Replace the day to processing module with Django.utils.log.NullHandler to solve the problem.

?

1 ' null ': {' level ': ' DEBUG ', ' class ': ' Django.utils.log.NullHandler ',},

Local_thread problem

Join in the Index.wsgi

?

1 2 3 Import threading from Django.utils import _threading_local threading.local = _threading_local.local

Settings file

The SAE defaults to installing a number of Python packages, including Django-userena. The bad thing is that SAE adds Django-userena's demo project to the Python path, and the load priority is higher than the project code. directly causing os.environ[' django_settings_module '] = ' settings ' to find the Userena settings file. Eventually renaming the settings file to qnotes_settings.py solves the problem.

Other issues

A database error has often occurred since the deployment was launched yesterday, with the error prompted by caught Operationalerror while rendering: (1045, ' access deny '). The SAE database does not support long connections, and the active timeout after 30s. But Django will automatically shut down the database connection after each request, and there should be no such problem in theory. The question today baffled itself well.

The server is very unstable, often inaccessible for extended periods of time, and can be accessed normally at irregular intervals.

The SAE may have hack the Python package loading mechanism, and the SAE Python package loading behavior is strange. The package should have been loaded in the current directory first, but not necessarily.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.