【问题标题】:Step by step with django-jet-demo使用 django-jet-demo 一步一步来
【发布时间】:2018-06-15 08:14:50
【问题描述】:

我正在尝试查看 django-jet-demo,即https://github.com/geex-arts/django-jet-demo,但它不起作用。

  • git clone https://github.com/geex-arts/django-jet-demo.git
  • mkvirtualenv venv
  • cd django-jet-demo
  • pip install -r requirements/base.txt
  • django makemigrations

我有错误

1-configparser.NoSectionError: No section: 'common'

如果我在 application/settings.py 中删除 config.get(..., 'common')

2-configparser.NoSectionError: No section: 'email'

如果我在application/settings.py 中删除config.get(..., 'email')

3-configparser.NoSectionError: No section: 'database'

我该如何解决这个问题?使 django-jet-demo 工作的步骤是什么?它在您的计算机上运行良好吗?

更新

如果我修改 default.conf 文件,我会遇到相同的第一个错误。

[common]
secret_key='t_g&c7^(!jb*$caaeue%$t_0pdtx5z(a7v%b6#svl1&0$5h9o-'
debug=False

[email]
server_email=test@test.com
host=localhost
port=1025
user=
password=
tls=True

[database]
ENGINE=django.db.backends.mysql
NAME=capitaine
USER=root
PASSWORD=wd9598%%DD
HOST='localhost'
PORT=3306

【问题讨论】:

    标签: python django django-jet


    【解决方案1】:

    有一个名为default.conf 的文件,其中每个部分的值都是空的,您应该为至少secret_keyserver_email[database] 部分添加适当的值。

    如果您不想使用mysql 作为数据库后端,请改用sqlite(不需要NAMEUSERPASSWORD 等)。

    另请注意,您必须在路径下创建此.conf 文件:

    /path/to/project/conf/project_name.conf
    

    当然,将project_name 更改为您实际项目的名称。

    【讨论】:

    • 是的,我看过那个文件。虽然我填写了那个文件,但我仍然有同样的错误。我会修改问题。你测试过django-jet-demo吗?
    • 问题中有default.conf,我仍然有相同的第一个错误,即configparser.NoSectionError: No section: 'common'
    • 嗯...如果您在设置文件中的config_path=... 下插入print config_path,您会得到什么?还可以尝试从每个值中删除单引号(即使用NAME=capitaine 而不是NAME='capitaine')。
    • 我收到了/home/infinity/Projects/Work_Projects/django-jet-demo/conf/jet_demo.conf
    • 好的,那么这个文件j‌​et_demo.conf是否存在这个路径下?
    猜你喜欢
    • 2016-01-17
    • 2011-04-18
    • 2011-09-19
    • 1970-01-01
    • 2019-11-13
    • 1970-01-01
    • 1970-01-01
    • 2011-01-25
    • 2011-12-15
    相关资源
    最近更新 更多