Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动BUG #6

Open
majiayu000 opened this issue Feb 24, 2025 · 1 comment
Open

启动BUG #6

majiayu000 opened this issue Feb 24, 2025 · 1 comment

Comments

@majiayu000
Copy link

使用python manage.py runserver 启动报错了。
报错内容如下:

No module named 'LearnSpider.secret_settings'
True
Traceback (most recent call last):
  File "/Users/lifcc/Desktop/code/Work/Common/Lib/LearnSpider/manage.py", line 40, in <module>
    main()
    ~~~~^^
  File "/Users/lifcc/Desktop/code/Work/Common/Lib/LearnSpider/manage.py", line 36, in main
    execute_from_command_line(sys.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/lifcc/Library/Caches/pypoetry/virtualenvs/ls-V0Qd-Nu_-py3.13/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
    ~~~~~~~~~~~~~~~^^
  File "/Users/lifcc/Library/Caches/pypoetry/virtualenvs/ls-V0Qd-Nu_-py3.13/lib/python3.13/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
    ~~~~~~~~~~~~^^
  File "/Users/lifcc/Library/Caches/pypoetry/virtualenvs/ls-V0Qd-Nu_-py3.13/lib/python3.13/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lifcc/Library/Caches/pypoetry/virtualenvs/ls-V0Qd-Nu_-py3.13/lib/python3.13/site-packages/django/apps/registry.py", line 124, in populate
    app_config.ready()
    ~~~~~~~~~~~~~~~~^^
  File "/Users/lifcc/Desktop/code/Work/Common/Lib/LearnSpider/topics/apps.py", line 10, in ready
    from LearnSpider.settings import DJANGO_ENV
ImportError: cannot import name 'DJANGO_ENV' from 'LearnSpider.settings' (/Users/lifcc/Desktop/code/Work/Common/Lib/LearnSpider/LearnSpider/settings.py)

看起来少了一个文件?

@cpython666
Copy link
Owner

少了一个变量,注释掉使用这个变量的地方即可。
现在已经上传这个变量了。
不过没有数据库的情况下,项目启动起来估计不会有我本地一样的效果。后续会抽时间把数据库弄到docker里,这样可以一键启动,不会缺数据。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants