Skip to content

Instantly share code, notes, and snippets.

@gmocamilotd
Last active November 25, 2019 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmocamilotd/3f3c12c07ee05d715cec547259b3dbb6 to your computer and use it in GitHub Desktop.
Save gmocamilotd/3f3c12c07ee05d715cec547259b3dbb6 to your computer and use it in GitHub Desktop.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# which means :
# "BASE_DIR is the parent folder of the parent folder of the file this line is in (settings.py).".
# os.path.dirname() gives the parent folder path, and os.path.abspath()
# the absolute path (you need it to give os.path.dirname() enough informations to get the parent dirnames).
#exportar los settings.
from .settings import *
o bien
from django.conf import settings
mybase_dir = settings.BASE_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment