Project config - zamaniamin/python GitHub Wiki

Add app to settings.py

INSTALLED_APPS = [
    # Django Packages
    ...

    # External Packages
    ...

    # Local apps
    'app_name',
]

App templates directory

create a directori in <app_name>/templates/<app_name>

Project templates directory

create directory <project_name>/templates and config TEMPLATES in settings.py

TEMPLATES = [
  { …
        'DIRS': [BASE_DIR / 'templates', ],
   … }
]

Static directory

create a directory in <project_name>/static and in settings.py do this:

STATIC_URL = '/static/'
STATICFILES_DIRS = [ BASE_DIR / 'static' ] 
STATIC_ROOT = 'static_root'

To use PostgresSQL

first install postgresSQL in your system, then install this package:

pip install psycopg2

now config DATABASE in settings.py

DATABASE = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': '<dtabase name>',
        'USER': 'postgres',
        'PASSWORD': 'admin',
        'HOST': 'localhost',
        'PORT': '5432'
     }
}
⚠️ **GitHub.com Fallback** ⚠️