创建项目:django-admin startproject user_sys
创建APP:python manage.py startapp auth
测试项目创建是否成功:localhost:8000   It Works!
#注册APP到settings中
设置templates路径:'DIRS': [os.path.join(BASE_DIR,'templates')],
创建数据模型models
进行数据迁移python manage.py migrate    数据模型有变动则需要进行  python manage.py makemigrations操作
创建超级用户 python manage.py createsuperuser   (如果提示要设置max_length,则需要设置models中的字段长度限制)
新增一个视图:send_register
增加一条路由url(前提要导入APP的视图views)
在APP文件夹下新建一个templates文件夹,并且新增一个register.html文件
运行 python manage.py runserver
打开 localhost:8000/url 即可

  

 

相关文章:

  • 2021-12-03
  • 2022-12-23
  • 2021-07-04
  • 2021-12-03
  • 2021-09-29
  • 2021-12-03
  • 2021-12-07
  • 2022-01-23
猜你喜欢
  • 2021-11-30
  • 2021-11-23
  • 2021-11-23
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案