Answers for "settings.py file in django"

7

django import settings

from django.conf import settings
Posted by: Guest on September-15-2020
2

database default code in settings django

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'mydatabase',
    }
}
Posted by: Guest on November-24-2020
0

how to get SITE_ID in django....shell

[ ... banner ... ]
>>>
>>> from django.contrib.sites.models import Site
>>>
>>> sorted([(site.id,site.name) for site in Site.objects.all()])
[(1, u'www.lvh.me'), (2, u'example.com'), (3, u'www.example.com'),...]
>>>
>>> quit()
user$
Posted by: Guest on September-24-2020

Code answers related to "settings.py file in django"

Python Answers by Framework

Browse Popular Code Answers by Language