Skip to content

Instantly share code, notes, and snippets.

@bussiere
Created February 27, 2012 17:40
Show Gist options
  • Save bussiere/1925796 to your computer and use it in GitHub Desktop.
Save bussiere/1925796 to your computer and use it in GitHub Desktop.
list app in a django project
import os
chemin = "D:\Documents\Projets_Perso\Yuki"
#(,
#(models.Model)
#(null=True,blank=True)
#models.NullBooleanField(blank=True)
#models.BooleanField(null=True,blank=True)
def liste_app(chemin):
listfile = os.listdir(chemin)
listeapp = []
for f in listfile :
if os.path.isdir(os.path.join(chemin, f)):
listindir = os.listdir(os.path.join(chemin, f))
for f2 in listindir :
if f2 == "models.py":
listeapp.append(f)
print f
return listeapp
print liste_app(chemin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment