From popdata
Jump to: navigation, search

Back to Systems/Services

Django on Cartier: /home/www/pds/

  • Django admin:
  • "available" page: names and status of machines :
    NB "State" field updated automatically every minute.
  • Version 1.3.1 (python; import django; django.VERSION)
  • /usr/lib/python2.5/site-packages/django/core/handlers/
  • Apache settings in /etc/apache2/sites-enabled/portal (ex: "PythonDebug on").
    • pointing to Django Settings in /home/www/pds/ (ex: DEBUG = True)
PDS workaround 2014-08-20 for project creation

An example of how to use command-line on Sullivan to manually modify Django database entries

dlaplante@sullivan:/home/www/pds%   ./ shell_plus
project_tmp = PopGroup.objects.get(name="13-031")
print project_tmp, project_tmp.group_type
13-031 (214) 
>>> project_tmp.group_type = "project"
>>> print project_tmp, project_tmp.group_type
13-031 (214) project
PDS manual deletion of user
  • Deleting a PDS user when LDAP gets error
    • Normal usage:{NUMERIC_ID}
      • code: pds/users/ def delete(request, Id=):
        gets subusers from PDS : popdata = user.popdata; subusers = PopData.objects.filter(parent=user)
        to provide preview
      • if "Yes" delete_user(user)
      • code: general/ def delete_user(user, children = False):
        remove from LDAP groups and AD groups; remove user from LDAP and AD; recursively process children
      • now the scary part: delete user from PDS database

For example:

So once the LDAP entries have been removed for "enethery" (ID=5091) and subusers have been deleted
% cd /home/www/pds && ./ shell_plus
>>> user = User.objects.get(id=5091)
>>> print user
Elizabeth Nethery (enethery)
>>> subusers = PopData.objects.filter(parent=user)
>>> print subusers