1

我是 Django 的新手。我按照 README 上的说明进行操作,然后找不到任何有关如何使用调度程序的进一步说明,因此我将 django-scheduler-sample 项目中的 fullcalendar.html 复制到我的项目中。但是,它在 collectstatic 或 bower 安装后找不到任何所需的 css 或 js 文件。是否有关于如何将 django-scheduler 添加到应用程序的详细教程?为什么 fullcalendar.css 没有被添加到静态文件中?我正在使用 Django 1.10.5、Nginx 和 Gunicorn。

4

1 回答 1

5

首先你需要用这个命令安装 django-scheduler:

pip install django-scheduler

并将其添加到 installed_apps 上的 setting.py 中:

'schedule',

其次,您需要在您的操作系统上安装 nodjs:

https://nodejs.org/en/download/package-manager/

在此之后,您需要设置您的资产:

运行这个命令:

npm install -g bower
pip install django-bower

将此添加到 settings.py

添加到 INSTALLED_APPS:

'djangobower',

将 staticfinder 添加到 STATICFILES_FINDERS:

'djangobower.finders.BowerFinder',

指定组件根目录的路径(需要使用绝对路径):

BOWER_COMPONENTS_ROOT = '/PROJECT_ROOT/components/'

为调度程序添加以下 Bower 依赖项:

BOWER_INSTALLED_APPS = (
    'jquery',
    'jquery-ui',
    'bootstrap'
)

最后一步,安装 bower 依赖项:

./manage.py bower install

更多信息请阅读: https ://github.com/llazzaro/django-scheduler

http://django-scheduler.readthedocs.io/en/latest/

于 2017-01-28T17:44:48.110 回答