# djco **Repository Path**: sharpX1/djco ## Basic Information - **Project Name**: djco - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-08-25 - **Last Updated**: 2022-08-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 系统说明 ``` 框架版本和依赖包 (更多请查看libs.txt) python 3.9 django 3.2.6 djangorestframework 3.12.4 django-celery-results 2.2.0 gevent 21.8.0 redis-3.5.3 django-comment-migrate 0.1.5 生成数据库备注 help_text request-2.26.0 依赖包导出和导入 导出:php freeze > libs.txt 导入:pip install -r libs.txt ``` ### 框架相关文档 ``` Django 文档参考 :https://docs.djangoproject.com/en/3.2/ 教程参考:https://docs.djangoproject.com/zh-hans/3.2/intro/tutorial01/ Djangorestframework https://www.django-rest-framework.org/ ``` ### 安装/启动 ``` 导入依赖包 pip install -r libs.txt 启动django python manage.py runserver --noreload // 加上noreload 避免日志无法分割( 另一个程序正在使用此文件,进程无法访问。) 启动Celery Worker Celery -A djco worker -l info -P gevent // 启动work 执行器(管道中获取任务并且执行) 启动Celery beat Celery -A djco beat -l info // 启动beat 调度器(启动定时任务/类似于crontab) ``` ### celery 监控web Flower ``` pip install flower // 安装 Celery -A djco flower --port=5555 --broker=redis://127.0.0.1:6379/6 ``` ### migrate 操作 ``` python manage.py showmigrations 查看当前migration python manage.py migrate --fake 模块 zero # 重置某个模块的数据表(需要删除数据表和migration) python manage.py makemigrations 重新生成模块 ``` ### git 操作 ``` 创建仓库 cd djco git init git add * git commit -m "first commit" git remote add origin https://gitee.com/sharpX1/djco.git git push -u origin master 已有仓库 cd djco git add * git commit -m "first commit" git push -u origin master ``` ### django-rest-framwork 没有样式(关闭了debug 模式) ``` python manage.py collectstatic // 生成静态文件 ``` ### 创建模块 ``` python manage.py creartapp name ```