gpt4 book ai didi

python - Django错误: unrecognized arguments:

转载 作者:行者123 更新时间:2023-12-01 02:29:51 31 4
gpt4 key购买 nike

我正在使用 django 和 VB Linux Red Hat。我尝试过使用命令

python manage.py runserver - 192.168.1.100:8000

为了访问我的网站。到目前为止它运行良好,但后来它向我显示了以下消息:

manage.py runserver: error: unrecognized arguments: 192.168.1.100:8000

我认为这与 settings.py 文件有关,我不记得我到底在那里更改了什么。

这是settings.py的内容:

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'o-g4ql*yum(+ollra+t%1x)$svtr!sd7mrcv=lj@_p&hrbq_&z'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = ['192.168.1.100']

# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

WSGI_APPLICATION = 'mysite.wsgi.application'


# Database
# https://docs.djangoproject.com/en/dev/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

# Internationalization
# https://docs.djangoproject.com/en/dev/topics/i18n/

LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/dev/howto/static-files/

STATIC_URL = '/static/'

谢谢!

最佳答案

这不是设置文件。您不需要命令中的破折号:它应该只是 python manage.py runserver 192.168.1.100:8000

关于python - Django错误: unrecognized arguments:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46955907/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com