Brief for Django using 1

Django has several parts:

1. root and apps

Through manage.py use startnewapp to create a new app. Take 'startnewapp polls' for example, this creates a new app in the site's directory and automatically creates SQL commands used by Django, where you run 'migrate' to commit those commands to your database if database is what you'll be using.

On the other hand, setting.py contains some settings you may want to modify in the beginning, such as time zone and register app name and allowed hosts and etc.

And there is urls.py. You should firstly create a urls.py in the app's folder and configure and use 'include' from django.urls to register the urls.py you created manually. (         path('appname', include(('appname.urls','appname')))              )

2.Database

Django has a built-in admin site which admins the databases, run manage.py createsuperuser to create a administrator

While using a database though, whenever you create a new Model in 'app/model.py', you need to run manage.py makemigratitons appname then migrate to the database.

from django.db import models

# Create your models here.
class Question(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date punished')
class Choice(models.Model):
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)


For each model, use ModelName.objects.all() or ModelName.objects.get(id=1) to get object, and the keys of the gotten objects can be modified directly, then use save() to confirm changes. 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
BRIEF算法是一种特征描述子提取算法,它可以在MATLAB中实现。BRIEF算法的主要思想是以特征点为中心,取一个大小为S x S的区域,并对该区域进行高斯平滑处理。然后,通过计算区域内的像素对的亮度差异,并将结果编码为一个维度为N的位字符串,即特征点的描述子。BRIEF算法的优点是提取代价低,匹配只需要使用简单的汉明距离计算,时间代价低,空间代价低,并且效果还不错。因此,它在图像处理和计算机视觉领域中得到了广泛的应用。\[2\]\[3\]如果你想在MATLAB中实现BRIEF算法,可以参考相关的文章和资料。 #### 引用[.reference_title] - *1* [matlab练习程序(BRIEF描述子)](https://blog.csdn.net/weixin_34571341/article/details/115970632)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [特征描述子算法——BRIEF](https://blog.csdn.net/Williamcsj/article/details/121291878)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [什么BRIEF算法?BRIEF算法详解](https://blog.csdn.net/qinge_Crazy/article/details/119253418)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值