Find Jobs
Hire Freelancers

Django Limiting permissions with-in template

$10-30 CAD

已完成
已发布将近 8 年前

$10-30 CAD

货到付款
I have a django application made, however; I would like to check in the html template file if the user has a permission to use an application. If the user has access to the App then a link will appear (using an IF statement). If not nothing will appear. So far we've accomplished this by using a for statement in the View and checking in the database if the user has permission to use that application. As the software grows we do not want to code this in every single method. Should be a quick fix for someone with good experience.
项目 ID: 10729582

关于此项目

3提案
远程项目
活跃8 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hi there,I am a professional Django developer, having many years of experience with it. Ping me for discussion.
$30 CAD 在1天之内
5.0 (12条评论)
4.2
4.2
3威客以平均价$27 CAD来参与此工作竞价
用户头像
so check it in template ia a wrong way, becouse this part of code will be slow (django template engine) and not reusable. You should create some method in a view, and check permission in a view, or, probably, you can create View mixin with this method and use it in any View if you need it. This method should take context of a page and add "has_look_permission" attribute to this context, after you can ise it in template {% if has_look_permission %} bla-bla. Also check native Django permission Groups it is poverful build-in tool
$25 CAD 在10天之内
0.0 (0条评论)
0.0
0.0
用户头像
Open Source Developer. Experience in Python , Django, Javascript , HTML , CSS. This can be done using Django Permissions.
$25 CAD 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

CANADA的国旗
Windsor, Canada
5.0
3
付款方式已验证
会员自5月 19, 2015起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。