Python3 manage.py runserver not working (on mac)


#1

after creating my project and my app this error shows after trying to run my server
ps: my secret key isn’t empty

Traceback (most recent call last):
File “manage.py”, line 21, in
main()
File “manage.py”, line 17, in main
execute_from_command_line(sys.argv)
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/core/management/init.py”, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/core/management/base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options)
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/core/management/commands/runserver.py”, line 60, in execute
super().execute(*args, **options)
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/core/management/commands/runserver.py”, line 67, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/conf/init.py”, line 79, in getattr
self._setup(name)
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/conf/init.py”, line 66, in _setup
self._wrapped = Settings(settings_module)
File “/Users/mac/Desktop/smm/SmmS-App-kaou-22/back/env/lib/python3.7/site-packages/django/conf/init.py”, line 176, in init
raise ImproperlyConfigured(“The SECRET_KEY setting must not be empty.”)
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.


#2

Can you double check that your settings file and everything else is in the right place? For example, matching this: https://github.com/hellowebbooks/hellowebapp-code/tree/chapter-3

Also make sure that you’re in your virtual environment. :)