Skip to main content
More descriptive question title.
Link
coffee-grinder
  • 27.7k
  • 19
  • 59
  • 82

Allowed_hosts django SyntaxError: invalid syntax in ALLOWED_HOSTS on Django 1.6

deleted 571 characters in body
Source Link

I'm writing a new django project on 1.6 version but when I go to sync the database the settings.py returns this error:

 Traceback (most recent call last): mod File= "manageimportlib.py", line 10, in <module> execute_from_command_lineimport_module(sysself.argvSETTINGS_MODULE) File "/usr/local/lib/python2.7/dist-packages/django/core/managementutils/__init__importlib.py", line 39940, in execute_from_command_lineimport_module utility.execute__import__(name) File "/usr/localhome/libyabir/python2.7Documentos/dist-packagespython/djangoproject_vine/corevine/managementvine/__init__settings.py", line 392, in execute29 self.fetch_command(subcommand).run_from_argv(self.argv) FileALLOWED_HOSTS "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",= line[]  261, in fetch_command  commands = get_commands()  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 107, in get_commands^  SyntaxError: invalid syntax 

my settings.py before the error

import appsos BASE_DIR = settingsos.INSTALLED_APPS File "/usr/local/lib/python2path.7/dist-packages/django/conf/__init__dirname(os.py", line 54, in __getattr__ selfpath._setupdirname(name__file__))  File # "/usr/local/lib/python2.7/distQuick-packages/django/conf/__init__.py", line 49, in _setup start development settings - self._wrappedunsuitable =for Settings(settings_module)production  # FileSee "https:/usr/localdocs.djangoproject.com/liben/python21.76/dist-packageshowto/djangodeployment/confchecklist/__init__.py", # lineSECURITY 128,WARNING: inkeep __init__ the secret key used modin production secret! SECRET_KEY = importlib.import_module(self.SETTINGS_MODULE)'*******************'  # SECURITY FileWARNING: "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",don't linerun 40,with debug turned on in import_moduleproduction! DEBUG = True TEMPLATE_DEBUG = __import__(name)True   TEMPLATE_DIRS File= "/home/yabir/Documentos/python/project_vine/vine/vine/settings(os.py"path.join(BASE_DIR, line 29'templates')    ALLOWED_HOSTS = [] ^ SyntaxError: invalid syntax 

I'm writing a new django project on 1.6 version but when I go to sync the database the settings.py returns this error:

 Traceback (most recent call last):  File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command  commands = get_commands()  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 107, in get_commands   apps = settings.INSTALLED_APPS File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__ self._setup(name)  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup  self._wrapped = Settings(settings_module)   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 128, in __init__  mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module __import__(name)   File "/home/yabir/Documentos/python/project_vine/vine/vine/settings.py", line 29  ALLOWED_HOSTS = [] ^ SyntaxError: invalid syntax 

I'm writing a new django project on 1.6 version but when I go to sync the database the settings.py returns this error:

 mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module __import__(name) File "/home/yabir/Documentos/python/project_vine/vine/vine/settings.py", line 29 ALLOWED_HOSTS = []  ^ SyntaxError: invalid syntax 

my settings.py before the error

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.6/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '*******************'  # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True TEMPLATE_DEBUG = True  TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'templates')   ALLOWED_HOSTS = [] 
Source Link

Allowed_hosts django 1.6

I'm writing a new django project on 1.6 version but when I go to sync the database the settings.py returns this error:

 Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 261, in fetch_command commands = get_commands() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 107, in get_commands apps = settings.INSTALLED_APPS File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__ self._setup(name) File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup self._wrapped = Settings(settings_module) File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 128, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module __import__(name) File "/home/yabir/Documentos/python/project_vine/vine/vine/settings.py", line 29 ALLOWED_HOSTS = [] ^ SyntaxError: invalid syntax