Михаиллл
Михаиллл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 осталась.
Скажите пожалуйста почему так и как исправит.

We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.

Do you like it? Share on social networks!

2
Evgenii Legotckoi
  • June 24, 2019, 5:36 a.m.

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

    Михаиллл
    • June 24, 2019, 6:07 a.m.

    Ошибки:

    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
    
    

      Comments

      Only authorized users can post comments.
      Please, Log in or Sign up
      AD

      C ++ - Test 004. Pointers, Arrays and Loops

      • Result:50points,
      • Rating points-4
      m

      C ++ - Test 004. Pointers, Arrays and Loops

      • Result:80points,
      • Rating points4
      m

      C ++ - Test 004. Pointers, Arrays and Loops

      • Result:20points,
      • Rating points-10
      Last comments
      i
      innorwallNov. 14, 2024, 11:27 p.m.
      Release of C++/Qt and QML application deployment utility CQtDeployer v1.4.0 (Binary Box) optionally substituted alkoxy, optionally substituted alkenyloxy, optionally substituted alkynyloxy, optionally substituted aryloxy, OCH, OC H, OC H, OC H, OC H, OC H, OC H, O C CH, OCH CH OH, O…
      i
      innorwallNov. 14, 2024, 6:26 p.m.
      Qt/C++ - Lesson 031. QCustomPlot – The build of charts with time buy generic priligy We can just chat, and we will not lose too much time anyway
      i
      innorwallNov. 14, 2024, 4:03 p.m.
      Qt/C++ - Lesson 060. Configuring the appearance of the application in runtime I didnt have an issue work colors priligy dapoxetine 60mg revia cost uk August 3, 2022 Reply
      i
      innorwallNov. 14, 2024, 9:07 a.m.
      Circuit switching and packet data transmission networks Angioedema 1 priligy dapoxetine
      i
      innorwallNov. 14, 2024, 8:42 a.m.
      How to Copy Files in Linux If only females relatives with DZ offspring were considered these percentages were 23 order priligy online uk
      Now discuss on the forum
      i
      innorwallNov. 14, 2024, 12:39 a.m.
      добавить qlineseries в функции priligy amazon canada 93 GREB1 protein GREB1 AB011147 6
      i
      innorwallNov. 11, 2024, 7:55 a.m.
      Всё ещё разбираюсь с кешем. priligy walgreens levitra dulcolax carbs The third ring was found to be made up of ultra relativistic electrons, which are also present in both the outer and inner rings
      9
      9AnonimOct. 25, 2024, 6:10 a.m.
      Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…

      Follow us in social networks