2016-06-26 5 views
-3

Ich begann ein Django-Tutorial lernen, und wenn ichPython manage.py runserver Fehler django.core.exceptions.ImproperlyConfigured: T

python manage.py runserver 

gibt es eine Menge Fehler Traceback (jüngste Aufforderung ausführen möchten zuletzt): Datei "manage.py", Zeile 10, in execute_from_command_line (sys.argv) Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/core/management/ init .py ", Zeile 338, in execute_from_command_line utility.execute() Datei" /home/sarfraz/.local/lib/python 2.7/site-packages/django/core/Management/init Py "Linie 330, in ausführen self.fetch_command (subcommand) .run_from_argv (self.argv) File" /home/sarfraz/.local/lib /python2.7/site-packages/django/core/management/ init Py "Linie 190, in fetch_command klass = load_command_class (app_name, subcommand) File" /home/sarfraz/.local/lib/python2 .7/site-packages/django/core/management/init .py ", Zeile 40, in load_command_class module = import_module ('% s.management.commands.% S'% (app_name, name)) Datei "/usr/lib/python2.7/importlib/ Init .py", Zeile 37, in Import_Module Import (name) File "/home/sarfraz/.local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", Zeile 14, in von django.db .migration.executor Import MigrationExecutor Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/db/migrations/executor.py", Zeile 6, in von .loader import MigrationLoader Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/db/migrations/loader.py", Zeile 10, in von django.db.migrations.recorder import MigrationRecorder Datei "/ home /sarfraz/.local/lib/python2.7/site-packages/django/db/migrations/recorder.py ", Zeile 9, in Klasse MigrationRecorder (Objekt): Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/db/migrations/recorder.py", Zeile 23, in MigrationRecorder Klasse Migration (models.Model): Datei "/ home /sarfraz/.local/lib/python2.7/site-packages/django/db/migrations/recorder.py ", Zeile 24, in Migration app = models.CharField (max_length = 255) Datei"/home/sarfraz /.local/lib/python2.7/site-packages/django/db/models/fields/ init .py ", Zeile 1081, in init Super (CharField, selbst). init (* args, ** kwargs) File "/home/sarfraz/.local/lib/python2.7/site-packages/django/db/models/fields/ init Py", Linie 161, in init self.db_tablespace = db_tablespace oder settings.DEFAULT_INDEX_TABLESPACE File "/home/sarfraz/.local/lib/python2.7/site-packages/django/conf/ init Py", Zeile 48, in getattr self._setup (name) File "/home/sarfraz/.local/lib/python2.7/site-packages/django/conf/ init Py", Zeile 44, in _setup selbst. _wrapped = Einstellungen (s ettings_module) Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/conf/ init.py“, Linie 108, in init ‚Bitte Ihre Einstellungen reparieren‘% Einstellung) django.core.exceptions.ImproperlyConfigured:... Die TEMPLATE_DIRS Einstellung muss ein Tupel sein Bitte Ihre Einstellungen beheben Traceback (jüngste Aufforderung zuletzt): Datei "manage.py", Zeile 10, in execute_from_command_line (sys.argv) Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/core/management/ init Py“, Linie 338, in execute_from_command_line utility.execute() File "/home/sarfraz/.local/lib/python2.7/site-packages/django/core/management/ init Py", Zeile 330, in Ausführung self.fetch_command (Unterbefehl) .run_from_argv (self.argv) Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/core/management/ init .py", Zeile 190 , in fetch_command klass = load_command_class (app_name, Unterbefehl) Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/core/management/ init .py", Zeile 40, in load_command_class module = import_module ('% s.management.commands.% s' % (app_name, Name)) File "/usr/lib/python2.7/importlib/ init Py", Zeile 37, in import_module importieren (Name) Datei "/home/sarfraz/.loca l/lib/python2.7/site-packages/django/core/management/commands/runserver.py ", Zeile 14, in von django.db.migrations.executor Import MigrationExecutor Datei" /home/sarfraz/.local /lib/python2.7/site-packages/django/db/migrations/executor.py ", Zeile 6, in von .loader import MigrationLoader Datei" /home/sarfraz/.local/lib/python2.7/site -packages/django/db/migrations/loader.py ", Zeile 10, in von django.db.migrations.recorder import MigrationRecorder Datei" /home/sarfraz/.local/lib/python2.7/site-packages/ django/db/migrations/recorder.py ", Zeile 9, in Klasse MigrationRecorder (Objekt): Datei" /home/sarfraz/.local/lib/python2.7/site-packages/django/db/migrations/recorder .py ", Zeile 23, in MigrationRecorder Klasse M Einwanderung (models.Model): Datei "/home/sarfraz/.local/lib/python2.7/site-packages/django/db/migrations/recorder.py", Zeile 24, in Migration app = models.CharField (max_length = 255) File "/home/sarfraz/.local/lib/python2.7/site-packages/django/db/models/fields/ init Py", Zeile 1081, in init Super (CharField, selbst). init (* args, ** kwargs) File "/home/sarfraz/.local/lib/python2.7/site-packages/django/db/models/fields/ init Py", Linie 161, in init self.db_tablespace = db_tablespace oder settings.DEFAULT_INDEX_TABLESPACE File "/home/sarfraz/.local/lib/python2.7/site-packages/django/conf/ init Py", Zeile 48, in getattr self._setup (name) File "/home/sarfraz/.local/lib/python2.7/site-packages/django/conf/ init Py", Zeile 44, in _setup selbst. _wrapped = Einstellungen (s ettings_module) File "/home/sarfraz/.local/lib/python2.7/site-packages/django/conf/ init Py", Linie 108, in init "Bitte Ihre Einstellungen beheben." % Einstellung) django.core.exceptions.ImproperlyConfigured: Die Einstellung TEMPLATE_DIRS muss ein Tupel sein. Bitte korrigieren Sie Ihre Einstellungen.

Und es gibt die ligne in meinem Projekt/settings.py TEMPLATE_DIRS = ( "/ home/Sarfraz/django/crepes_bretonnes/templates /" )

Hoffe, es war klar.

Antwort

1

ein Komma am Ende des ansonsten zwischen Klammer geschlossen Wertes hinzufügt es keinen tuple ist:

TEMPLATE_DIRS = ("/home/sarfraz/django/crepes_bretonnes/templates/",)

es das Problem lösen soll. Hoffe, dass es hilft.

+0

Ich füge ein Komma, aber es funktioniert nicht, der gleiche Fehler erscheint. –

+0

Oups, ich habe ein Komma vor dem doppelten Zitat hinzugefügt, ich ändere das und weiß, dass es funktioniert! Vielen Dank –