This file contains hidden or 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 django.core.management.base import BaseCommand | |
import os | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
class Command(BaseCommand): | |
help = "Templates Generator" | |
template_dir = os.path.join(BASE_DIR, 'templates') |
This file contains hidden or 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 django.core.management.base import BaseCommand | |
import os # | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
class Command(BaseCommand): | |
help = "Templates Generator" | |
template_dir = os.path.join(BASE_DIR, 'templates') | |
file_path = os.path.join(template_dir, '_base.html') |
This file contains hidden or 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 django.core.management.base import BaseCommand | |
import os | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
class Command(BaseCommand): | |
help = "Templates Generator" | |
template_dir = os.path.join(BASE_DIR, 'templates') | |
file_path = os.path.join(template_dir, '_base.html') |
This file contains hidden or 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 django.core.management.base import BaseCommand | |
import os # <= new | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # <= new | |
class Command(BaseCommand): | |
help = "Templates Generator" | |
def handle(self, *args, **kwrags): | |
self.stdout.write("Generating _base.html template ...") | |
self.stdout.write('----------------------------------') |
This file contains hidden or 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 django.core.management.base import BaseCommand | |
class Command(BaseCommand): | |
help = 'Understanding management command' | |
def handle(self, *args, **kwrags): | |
self.stdout.write("Writing management command") |
NewerOlder