Ich benutze gawk in Terminal, um die ALLOWED_HOSTS = []
Zeile in der Datei unten zu entsprechen. Ich benutze gawk '$1 ~ /ALLOWED_HOSTS =.+$/{ print $0 }' file_name
. Ich bekomme kein passendes. Es ist sehr rätselhaft. Ich habe versucht, mit /^ALLOWED_HOSTS =.+$/
, aber keinen Erfolg. Bitte sehen Sie am Ende des Textes nach, um die Zeile zu sehen, die ich angleichen möchte.Regulärer Ausdruck gawk passend
Django settings for superlists project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '4(8f0buww1_&0jqmo-zg89$!epi=zd0)z3v^d+qp&z63fg*bin'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
Was die FS (FieldSeperator) ist Sie verwenden? Standardmäßig ist "" (Leerzeichen) der FS. so könnte hier mit $ 1 übereinstimmen. /^ALLOWED_HOSTS[[space:]]+=.+$/{print} könnte funktionieren – Chet