我的客户端要求我用PHP创建一个Web应用程序,最后我使用了Symfony.在交付时,他告诉我他已经发布了一个带有嵌入式Web视图的软件,该软件指向硬编码的URL:
www.domain.com/dir/tools.php
现在他希望Web应用程序出现在它的Web View中,但该软件被大约400个客户使用,我们不能指望更改硬编码的URL.
您认为我怎么能干净利落地做到这一点:
我制作了一个简单的代码来演示和理解类 - 但是当我运行它时,我的列表显示它们是空的,包含"None"值而不是用户输入的字符串作为名称.
#Static methods do not require the object to be initiated. Can be remotely accessed from outside the function .
#Counting critters and remote access.
class Orc (object):
total = 0
def get_score (self):
print "The number of orcs the orc factory has made is",Orc.total
def __init__ (self):
Orc.total += 1
name = raw_input ("I am a critter by the name of:\n")
#Creating 10 Orcs
list = []
for i in range (4): list[i] = list.append(Orc.get_score(Orc()))
print "You …Run Code Online (Sandbox Code Playgroud) 是否建议或冗余设置模板和视图的权限?
考虑到对数据库的任何数据操作都是通过POST完成的
如果以下足够的权限?
{% if perms.system.view_employee %}
<!-- content here -->
{% else %}
<h1>Sorry you do not have permission to access this page<h2>
{% endif %}
Run Code Online (Sandbox Code Playgroud)
或者我是否也应该实施服务器端检查(这样做是否多余或必要)?
def my_view(request):
if not request.user.has_perm('polls.can_vote'):
return HttpResponse("You can't access this page")
else:
# do stuff
...
Run Code Online (Sandbox Code Playgroud) 它是为了什么?
为什么他们的各种版本呢?什么是可用的版本以及它们各自匹配的内容?
为什么它似乎导致许可证问题?EG:我有些像py2exe这样的工具无法捆绑它们但是你仍然需要它们来运行生成的exe.
如果要为Windows分发软件,如何解决这个问题: