This is probably a great time to explain the settings.py file.
1. Open your settings.py file in your text editor
2. At the top, we see a comment that that contains a couple URLs that will explain this file indepth
3. First thing after comment we see code that states import os. Os is python package that allows us to work with paths.
4. Next line we see the path in action we create a variable that holds the path to our project. If you are curious what that path is add the following print statement "print(BASE_DIR)" and go into your terminal and runserver "python3 manage.py runserver" this will print the path out.
5. SECRET_KEY - this is used in production to keep our project safe so you want to keep this a secret.
6. DEBUG - is one of most useful features of Django. This will return detailed error pages to use to help us find issues with our project. Never deploy a site with Debug set to true.
7. ALLOWED_HOSTS - This is only used when debug is set to false and we would add our domain name this is another security feature for the site.
8. Installed apps - 'django.contrib.admin' - is for the admin site we will look at this shortly, 'django.contrib.auth' - for our authentication of users, 'django.contrib.contenttypes' - framework that handles contenttypes, 'django.contrib.sessions' - session framework, 'django.contrib.messages' handles messages from our site, 'django.contrib.staticfiles' - handles static files for our sites,
9. Middleware is small software packages that handle communication between our server and our Django project.
Root_urlconf - is the location of our main URL file.
Templates - This section handles backend information for our DjangoTemplates along with the location of templates. Templates are in HTML pages.
WSGI_APP = this is the location of our wsgi file
Database - this is where we set up our DATABASE for our project.
Auf dieser Seite können Sie das Online-Video Django Settings.py File Explained mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Code master 10 Oktober 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 8,735 Mal angesehen und es wurde von 48 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!