Django项目的搭建(小白教程)

         要知道想要搭建一个django项目,首先你要对django的目录结构有所了解。然后才能搭建一个完整的项目

目录结构

wxGroupServer(项目名称)
–apps(即使是“小”工程,也建议分成多个app,每个app足够简单,只解决某一个方面的问题)
----index(自定义app)
------migrations
------static(app的静态文件)
------templates(app的模板文件)
------tests(app级别的测试代码)
--------init.py
--------test_models.py
--------test_views.py
------init.py
------admin.py
------apps.py
------models.py
------tests.py
------urls.py
------views.py
–libs(加载第三方模块,可以避免版本冲突,按照标准的site-packages管理)
–static(静态内容)
----css
----fonts
----js
----images
–templates(模板目录,覆盖app的模板)
----common
----example
----404.html
----500.html
----base.html
----copyright.html
----detail_example.html
----nav.html
----sidebar.html
–tests(project级别的测试,对于每个app,还要有自己的测试代码)
–uploads(上传文件所在目录)
–wxGroupServer
----settings
------init.py
------base.py(基础通用配置)
------development.py(开发配置)
------production.py(发布配置)
----init.py
----urls.py
----wsgi.py
–.gitignore
–manage.py
–requirements.txt(列出项目中所有使用到的python包)

修改配置

在这里插入图片描述
在这里插入图片描述在这里插入图片描述在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43292457/article/details/84670998