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.
In questa pagina del sito puoi guardare il video online Django Settings.py File Explained della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Code master 10 ottobre 2016, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 8,735 volte e gli è piaciuto 48 spettatori. Buona visione!