Pycharm in requested setting CACHES, but settings is not configured. You must either define the environment variable django_settings_module problem solving

Source: Internet
Author: User

Yesterday encountered a problem, pycharm can not run the Django program, see the error is: django.core.exceptions.ImproperlyConfigured:Requested setting CACHES, but Settings is not configured. You must either define the environment variable Django_settings_module or call Settings.configure () before accessing Setti Ngs. As a result, Baidu had no results for half a day, and finally found the answer on the Foreigner's website. The DJANGO project would have been perfectly run in the Python shell, not in Pycharm, because Pycharm wanted you to configure an environment variable Django_settings_module This variable tells the Django project which settings file to look for. Specific steps:
1, run–> Editconfigures
2, find Python a specific name is Python tests (note is not the Django one), and then modify the inside of the environment variables add an item. The name is Django_settings_module value is your SETTINGS, such as mysite.settings.
Turn from: [Http://www.cnblogs.com/lout/articles/4149591.html]

Requested setting CACHES in Pycharm, but settings is not configured. You must either define the environment variable Django_settings_module problem Resolution

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.