Skip to content

Instantly share code, notes, and snippets.

View godfather68's full-sized avatar

Farel Ellely godfather68

View GitHub Profile
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')
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')
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')
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('----------------------------------')
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")