小编z3a*_*z3a的帖子

django/file上传权限

我写了一个django应用程序,但我对来自Web表单的上传文件的文件权限有一点问题.

基本上我可以上传一个.mp3文件,但它始终保持chmod 600.

容器文件夹具有chmod 775,并且umask设置为022.

我在共享托管服务.

django permissions file-upload django-uploads

32
推荐指数
1
解决办法
1万
查看次数

Django flatpages备份?

我正在一个我在本地服务器上开发的网站中使用flatpages.我需要备份flatpage的数据,以便在最终服务器中使用它.有谁知道怎么做?

django django-flatpages

14
推荐指数
1
解决办法
1375
查看次数

django-registration"记住我"

我需要在使用django-registration app的登录表单中实现"记住我"按钮.任何人都可以帮助我告诉我这样做的方法吗?

谢谢

django django-registration

13
推荐指数
1
解决办法
5987
查看次数

扩展satchmo用户配置文件

我正在尝试扩展satchmo商店中包含的基本用户注册表单和配置文件,但我遇到了问题.

这就是我所做的:

创建一个新的应用程序"extendedprofile"

编写了一个扩展satchmo_store.contact.models类的models.py并添加了自定义名称字段.

写了一个admin.py,取消注册Contact类并注册我的newapp但这仍然显示默认的用户配置文件表单.

也许有人可以告诉我这样做的正确方法?

django django-templates django-models django-admin satchmo

5
推荐指数
1
解决办法
836
查看次数

幽灵物体 - 子弹物理学

我正在尝试在bulletphysicals中实现一个简单的幽灵对象,这就是我创建幽灵对象的方式:

btGhostPairCallback* ghostCall = new btGhostPairCallback();
world->getBroadphase()->getOverlappingPairCache()->setInternalGhostPairCallback(ghostCall);

btGhostObject* ghostObj = new btGhostObject();
btCollisionShape* shape = new btBoxShape(btVector3(ofGetWidth()+1000, ofGetHeight()+1000, 50));
ghostObj->setCollisionShape(shape);
btTransform trans;
trans.setIdentity();
trans.setOrigin(btVector3(0,0,-500));
ghostObj->setWorldTransform(trans);
ghostObj->setCollisionFlags( btCollisionObject::CF_NO_CONTACT_RESPONSE);
world->addCollisionObject(ghostObj,btBroadphaseProxy::SensorTrigger,btBroadphaseProxy::AllFilter & ~btBroadphaseProxy::SensorTrigger);
Run Code Online (Sandbox Code Playgroud)

这是尝试找到碰撞的方法:

btCollisionObject* obj = world->getCollisionObjectArray()[j];
btRigidBody* body = btRigidBody::upcast(obj);

    btAlignedObjectArray < btCollisionObject* > objsInsidePairCachingGhostObject;
    btAlignedObjectArray < btCollisionObject* >* pObjsInsideGhostObject = NULL;
    btGhostObject* ghost = btGhostObject::upcast(obj);

    if(ghost){
        objsInsidePairCachingGhostObject.resize(0);
        pObjsInsideGhostObject = &ghost->getOverlappingPairs();
        cout << ghost->getNumOverlappingObjects() << endl;
Run Code Online (Sandbox Code Playgroud)

但我总是得到这样的回应:我的所有世界对象都与幽灵对象发生碰撞。

任何人都可以帮助我获得一个功能简单的幽灵对象吗?

谢谢

bullet bulletphysics

4
推荐指数
1
解决办法
7957
查看次数

忽略mercurial中目录的一部分

我需要忽略一个目录,但要跟踪该目录的一个子文件夹.我的文件树看起来像:

root
 -d1
  --bin
  --bin/data
 -d2
  --bin
  --bin/data
Run Code Online (Sandbox Code Playgroud)

我需要忽略bin目录,但要在我的repo的所有文件夹中跟踪bin/data目录.现在我正在使用Rigth:

syntax: glob
*/obj/*
*/bin/*
*.swp
Run Code Online (Sandbox Code Playgroud)

但是当我运行hg状态时,无法看到我的数据目录中是否有新的东西.

谢谢!

mercurial ignore

3
推荐指数
1
解决办法
111
查看次数

定义一个django模型关系

我正在编写一个具有这种递归关系的应用程序(伪代码):

class atist:
      name = charfield 
      (...)

class press:
      pub = foreingkey(artist)

class works:
      work = foreingkey(artist)

class img:
      im = foreingkey(works)
Run Code Online (Sandbox Code Playgroud)

我在想,如果这是解决这个问题的更好方法,或者我会使用其他类似的关系,比如很多很多?另一方面我如何在管理网站注册这个应用程序只有一个页面的艺术家与作品和按作为艺术家的内嵌对象?

谢谢

django django-models django-admin

2
推荐指数
1
解决办法
303
查看次数