for z in range(10): theArtwork = Artwork() theArtwork.title = titles[(seed + z) % titlesLen] theArtwork.url_path = articleUrl[(seed + z) % articleUrlLen] theArtwork.category = theCategory theArtwork.owner = userProfile theArtwork.save() for i in range(20): articleseed = randint(0, 1000) article = Article() article.title = titles[articleseed % titlesLen] article.body = sentences[articleseed % sentenceLen] if (i % 2) == 0: article.is_project = True else: article.is_project = False article.image = articleUrl[articleseed % articleUrlLen] article.owner = userProfile article.save() theCategory = Category() sentencesRead.close() usersRead.close() profilePicRead.close() titlesRead.close() articleUrlRead.close()