June 18, 2019, 12:59 p.m.

Как подключить snippets в Django

Добрый день.
В этом учебнике представлен код

INSTALLED_APPS = (
    ...
    'rest_framework',
    'snippets.apps.SnippetsConfig',
)

На строчке

'snippets.apps.SnippetsConfig',

получаю ошибки.
В PyCharm пробовал прописать

python manage.py startapp snippets

при этом что-то выполнялось и наверно подключалось, но ошибка с snippets осталась.
Скажите пожалуйста почему так и как исправит.

Virtual hosting with 10 percent discount
Virtual hosting with 10 percent discount
EVILEG offers reliable hosting with a 10% discount for virtual hosting and 5% for VPS
2

Добрый день! А какие ошибки-то? Можете показать листинг ошибок?

0

Ошибки:

E:\Programs\Python\Python37\python.exe E:/PytonProjects/myDjangoTest2/manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "E:\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "E:\Programs\Python\Python37\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
    raise _exception[1]
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 337, in execute
    autoreload.check_errors(django.setup)()
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "E:\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "E:\Programs\Python\Python37\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "E:\Programs\Python\Python37\lib\site-packages\django\apps\config.py", line 116, in create
    mod = import_module(mod_path)
  File "E:\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'snippets'

Traceback (most recent call last):
  File "E:/PytonProjects/myDjangoTest2/manage.py", line 21, in <module>
    main()
  File "E:/PytonProjects/myDjangoTest2/manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
    super().execute(*args, **options)
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
    self.run(**options)
  File "E:\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 585, in run_with_reloader
    start_django(reloader, main_func, *args, **kwargs)
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 570, in start_django
    reloader.run(django_main_thread)
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 288, in run
    self.run_loop()
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 294, in run_loop
    next(ticker)
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 334, in tick
    for filepath, mtime in self.snapshot_files():
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 350, in snapshot_files
    for file in self.watched_files():
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 249, in watched_files
    yield from iter_all_python_module_files()
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
    return iter_modules_and_files(modules, frozenset(_error_files))
  File "E:\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 136, in iter_modules_and_files
    if not path.exists():
  File "E:\Programs\Python\Python37\lib\pathlib.py", line 1339, in exists
    self.stat()
  File "E:\Programs\Python\Python37\lib\pathlib.py", line 1161, in stat
    return self._accessor.stat(self)
OSError: [WinError 123] Синтаксическая ошибка в имени файла, имени папки или метке тома: '<frozen importlib._bootstrap>'

Process finished with exit code 1

0

Comments

Only authorized users can post comments.
Please, Log in or Sign up
AS
July 22, 2019, 4:32 p.m.
Aleksandr Spiridonov

C++ - Test 001. The first program and data types

  • Result:46points,
  • Rating points-6
AS
July 22, 2019, 4:21 p.m.
Aleksandr Spiridonov

Qt - Test 001. Signals and slots

  • Result:73points,
  • Rating points1
July 22, 2019, 10 a.m.
Pavel K.

C++ - Test 006. Enumerations

  • Result:50points,
  • Rating points-4
Last comments
July 21, 2019, 6:03 a.m.
Evgenij Legotskoj

да, наверное, 32-х разрядную поддержку уже давно поа было выкинуть. К слову, у вас много проектов под Android? Часто много где вижу вопросы о том, пишет ли кто-то вообще на Qt под мобильные сист…
July 20, 2019, 2:41 p.m.
Andrej Jankovich

Очень полезная информация, увы уже выкинул поддержку 32 битных бедняг.
July 20, 2019, 9:31 a.m.
Mihailll

Вот так qDebug()<<"position:"<<event->scenePos();
July 20, 2019, 8:49 a.m.
Mihailll

Добрый день. Как можно узнать координату на графической сцене при отпускании клавиши мыши?
Now discuss on the forum
July 22, 2019, 10:50 a.m.
Pavel K.

Благодарю.Буду пробовать.
July 22, 2019, 10:10 a.m.
Pavel K.

Скорее всего в коде не правильно потоки используются. на форуме пишут кое что интересное - https://stackoverflow.com/questions/18112027/qt-5-1-qml-property-through-threads
July 22, 2019, 3:58 a.m.
Evgenij Legotskoj

Добрый день! Нужен совет сообщества по разработке функционала проверки орфографии. Одна из идей - добавить проверку орфографии при наборе текста статей. Полагаю, что наиболее аде…
July 22, 2019, 3:01 a.m.
Evgenij Legotskoj

Возможно, если при сохранении файла установить права доступа на файл. Что-то такое должно быть у QFile
Looking for a Job?
5,000.00 руб. - 15,000.00 руб.
Дизайнер
Moskovskiy, Moscow, Russia
25,000.00 руб. - 30,000.00 руб.
Разработчик Qt/C++
Barnaul, Altai Krai, Russia

For registered users on the site there is a minimum amount of advertising

EVILEG
About
Services
Join us
© EVILEG 2015-2019
Recommend hosting TIMEWEB