Created
October 18, 2021 08:58
-
-
Save Shrestha7/889e1e3d8c0714fc0b72d05cf7a454b8 to your computer and use it in GitHub Desktop.
listing the path of directory templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from typing import Reversible | |
from django.db import models | |
from os import listdir | |
from os.path import isfile, join | |
import os | |
# Create your models here. | |
class insp(models.Model): | |
xml =models.FileField(upload_to='xml/') | |
print (os.path.abspath(__file__)) | |
print (Path().resolve().parent) | |
onlyfiles = [f for f in listdir(str('E:/Projects/demodj/alpha/templates/xml/'))] | |
print(onlyfiles) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
listing templates from dir