dvep
dvep

Reputation: 85

django error: unrecognized arguments:

I'm using django with VB Linux Red Hat. I've tried using the command

python manage.py runserver - 192.168.1.100:8000

In order to get access to my website. It worked fine until now, but then it showed me this message:

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

I think it has something to do with the settings.py file, I can't remember what exactly I've changed there.

Here is the content of 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/'

Thank you!

Upvotes: 1

Views: 4636

Answers (2)

Sandeep Lade
Sandeep Lade

Reputation: 1943

remove the dash (-) in the command:

python manage.py - runserver 192.168.1.100:8000

to get:

python manage.py runserver 192.168.1.100:8000

Upvotes: 1

Daniel Roseman
Daniel Roseman

Reputation: 599490

It's not the settings file. You don't need the dash in the command: it should be just python manage.py runserver 192.168.1.100:8000.

Upvotes: 2

Related Questions