Summary of Some Problems about deploying the Python Django framework on SAES

Source: Internet
Author: User

Summary of Some Problems about deploying the Python Django framework on SAES

This article describes how to deploy the Python Django framework on SAES. SAES is an online APP deployment platform of Sina and provides support for Python applications, for more information, see

It took some time to deploy the network to SAE and encountered various problems. It seems that SAE looks pretty, but it is not very mature (at least for python ).

Below are some of my major problems and solutions.

Django version Problems

Django1.4 is about to be released, and the SAE version of the SAE platform is still 1.2x. To use django1.3, You need to upload your own django. For more information, see runtime.html # virtualenv.

Log Module Error

The first problem is the daily module. The error shows that the parameter is_mail is included in the construction of a class in AdminEmailHandler, but the constructor of the target class does not support it at all. Fortunately, the daily arrival module is not required. Replace the daily-processing module with django. utils. log. NullHandler to solve the problem.

?

1

'Null': {'level': 'debug', 'class': 'django. utils. log. nullhandler ',},

Local_thread Problems

Add index. wsgi

?

1

2

3

Import threading

From django. utils import _ threading_local

Threading. local = _ threading_local.local

Settings file

Many python packages are installed by default in SAE, including django-userena. Worse, SAE adds the demo project of django-userena to the python path, and the loading priority is higher than that of the project code. OS. environ ['django _ SETTINGS_MODULE '] = 'setting' directly finds the settings file of userena. Finally, change the settings file to qnotes_settings.py to solve the problem.

Other problems

Database Errors often occur after the deployment was launched yesterday. The error prompt is Caught OperationalError while rendering: (1045, 'Access deny '). The SAE database does not support persistent connections, and takes the initiative to time out after 30 s. However, django will automatically close the database connection after each request. In theory, similar problems should not occur. I am sorry for this problem.

The server is very unstable, often inaccessible for a long time, and can be accessed from time to time.

SAE may hack the reason for python's package loading mechanism. The loading behavior of SAE's python package is somewhat strange. The package in the current directory should be loaded first, but not necessarily.

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.