Reputation: 8360
The name of my django app was always workout. Then, when I started to deploy it, I thought it'd be a good idea to change the name to workoutcalendar. So I started a new git repo and put my project files in there (not starting a new django project). The only things I changed were the name of the folder workout
(the first one of the django project where settings.py is located) to workoutcalendar
as well as changing the DJANGO_SETTINGS_MODULE
environment variable.
Now, I'm running into problems. It seems that parts of my app are looking for a workout
module, which they can't find. Example:
2018-01-15T13:06:40.615612+00:00 app[web.1]: Traceback (most recent call last):
2018-01-15T13:06:40.615613+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 135, in handle
2018-01-15T13:06:40.615614+00:00 app[web.1]: self.handle_request(listener, req, client, addr)
2018-01-15T13:06:40.615615+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
2018-01-15T13:06:40.615616+00:00 app[web.1]: respiter = self.wsgi(environ, resp.start_response)
2018-01-15T13:06:40.615617+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 146, in __call__
2018-01-15T13:06:40.615618+00:00 app[web.1]: response = self.get_response(request)
2018-01-15T13:06:40.615619+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 81, in get_response
2018-01-15T13:06:40.615620+00:00 app[web.1]: response = self._middleware_chain(request)
2018-01-15T13:06:40.615621+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
2018-01-15T13:06:40.615622+00:00 app[web.1]: response = response_for_exception(request, exc)
2018-01-15T13:06:40.615623+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
2018-01-15T13:06:40.615624+00:00 app[web.1]: response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
2018-01-15T13:06:40.615626+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
2018-01-15T13:06:40.615627+00:00 app[web.1]: callback, param_dict = resolver.resolve_error_handler(500)
2018-01-15T13:06:40.615628+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/resolvers.py", line 549, in resolve_error_handler
2018-01-15T13:06:40.615629+00:00 app[web.1]: callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
2018-01-15T13:06:40.615629+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/functional.py", line 36, in __get__
2018-01-15T13:06:40.615630+00:00 app[web.1]: res = instance.__dict__[self.name] = self.func(instance)
2018-01-15T13:06:40.615631+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/resolvers.py", line 529, in urlconf_module
2018-01-15T13:06:40.615632+00:00 app[web.1]: return import_module(self.urlconf_name)
2018-01-15T13:06:40.615633+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
2018-01-15T13:06:40.615634+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2018-01-15T13:06:40.615635+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2018-01-15T13:06:40.615638+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
2018-01-15T13:06:40.615636+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2018-01-15T13:06:40.615639+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2018-01-15T13:06:40.615640+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2018-01-15T13:06:40.615640+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2018-01-15T13:06:40.615641+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
2018-01-15T13:06:40.615717+00:00 app[web.1]: 10.31.130.110 - - [15/Jan/2018:13:06:40 +0000] "GET /favicon.ico HTTP/1.1" 500 - "-" "-"
2018-01-15T13:06:40.615642+00:00 app[web.1]: ModuleNotFoundError: No module named 'workout'
I don't know how to change all the relevant parts of my project. Where are the places where workout
will be mentioned, and I need to change it to workoutcalendar
?
Upvotes: 0
Views: 43
Reputation: 308909
The problem could be your ROOT_URLCONF
in settings.py
.
ROOT_URLCONF = 'workoutcalendar.urls'
If you still get problems after that, then run git grep workout
in your project directory and review the matches to see if there are any other changes you have to make.
Upvotes: 1