Reliable sharing of Django project across GitHub
I have developed two small Django projects using a Desktop at home and a Desktop at work. I need to work on it at both locations, but the local files are stored on different directories. I copied files from home to a repository on GitHub. I then cloned the GitHub repository onto the work computer. This worked fine for one iteration. Then, I updated the project on the work computer and the software (which ran on the home computer) no longer functioned correctly
Error: No module named 'NadiasGarden_project', which is the name of the directory.
I do not know where this module is supposed to reside?
I removed the local repository and re-cloned the working GitHub repository. Again, the same error.
I used the default .gitignore
Any suggestions as to how to obtain reliable project sharing across GitHub?
Please sign in to leave a comment.
Hi,
>Error: No module named 'NadiasGarden_project
You have an unresolved import somewhere in your code. You should see from where it is being imported, and if the module is actually located there.
In searching for the calling module, I am having a big problem diagnosing the Error from the extended output; Initially, I had an error associated with the .virtualenvironment. I deleted all of those environments and setup a new clone with a new pipenv. However, there still seems to be an incorrect module call. From this extended output, which file should I investigate?
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run
self.check(display_num_errors=True)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\checks\registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\urls\resolvers.py", line 399, in check
for pattern in self.url_patterns:
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\urls\resolvers.py", line 584, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\urls\resolvers.py", line 577, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\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 'NadiasGarden_project'
Traceback (most recent call last):
File "C:/Users/lyleb/Documents/Git/NadiasGarden_project/manage.py", line 21, in <module>
main()
File "C:/Users/lyleb/Documents/Git/NadiasGarden_project/manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 598, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 583, in start_django
reloader.run(django_main_thread)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 301, in run
self.run_loop()
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 307, in run_loop
next(ticker)
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 347, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 363, in snapshot_files
for file in self.watched_files():
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 262, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\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 "C:\Users\lyleb\.virtualenvs\NadiasGarden_project\lib\site-packages\django\utils\autoreload.py", line 139, in iter_modules_and_files
if not path.exists():
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\pathlib.py", line 1329, in exists
self.stat()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\pathlib.py", line 1151, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Process finished with exit code 1