Failure to Create User During Installation

32 views
Skip to first unread message

Simon Leung

unread,
Mar 6, 2019, 6:23:29 AM3/6/19
to NetBox

  I want to install NetBox in Ubuntu Server 18.04 by referring to https://netbox.readthedocs.io/en/stable/installation/2-netbox/. Still, errors showed when I run command to create the user during the installation as follows. Could anyone give me any solutions?


root@ip-172-31-43-67:/opt/netbox/netbox# python3 manage.py createsuperuser
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 204, in fetch_command
    app_name = commands[subcommand]
KeyError: 'createsuperuser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 211, in fetch_command
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.6/dist-packages/django/conf/__init__.py", line 57, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.6/dist-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.6/dist-packages/django/conf/__init__.py", line 126, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.



Henrik Johansson

unread,
Mar 6, 2019, 6:26:45 AM3/6/19
to NetBox

Your error is reported on the last line: The SECRET_KEY setting must not be empty

 

https://netbox.readthedocs.io/en/stable/installation/2-netbox/#secret_key

 

/Henrik

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/7034c07f-6e12-46ff-af53-e293b6f31447%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Leung

unread,
Mar 6, 2019, 8:34:29 PM3/6/19
to NetBox
Dear Henrik,

  How do I set up SECRET_KEY?

Luis N

unread,
Mar 6, 2019, 9:45:59 PM3/6/19
to Simon Leung, NetBox
😑 instructions 

Sent from my iPhone

Brian Candler

unread,
Mar 7, 2019, 2:50:41 AM3/7/19
to NetBox
It's not 100% clear in the documentation, but SECRET_KEY is just another setting in configuration.py

You put any very long random string in there.  The instructions show how to run a utility which can generate a random string for you. Then you find the SECRET_KEY = '' line in configuration.py, and you paste the random value between the quotes.

Frank Mogaddedi

unread,
Mar 7, 2019, 6:22:22 AM3/7/19
to NetBox

Simon,

 

As the instructions suggest, you can either come up with a 50-character key yourself (my cats have walked across my keyboard often enough, that could work), or you could use the suggested/included tool as per the instructions

Let’s assume your netbox install directory is “/opt/netbox”

 

-       Log in to your netbox server

-       cd /opt/netbox

-       cd netbox (no leading slash “/”, this puts you in /opt/netbox/netbox)

-       ./generate_secret_key.py       (that executes the key generator in the current directory. And yes, the command is dot-slash-generate…)

-       Copy the key that’s shown to you

-       cd netbox        (again, yes, that puts you in /opt/netbox/netbox/netbox, which is where the configuration file is)

-       edit the file “configuration.py” At or near line 27, where it says “SECRET_KEY”, edit it to reflect your previously generated secret key
For example, if your key is “1234abcd”, the line should read
SECRET_KEY = ‘1234abcd’
Of course, the key should be 50 characters long.

 

The section of the instructions that starts where it tells you to edit “configuration.py” (https://netbox.readthedocs.io/en/stable/installation/2-netbox/#configuration) and the following paragraphs are quite important and need to be closely followed.

 

Hope that helped,

 

            Frank

Luis N

unread,
Mar 7, 2019, 7:23:21 AM3/7/19
to Brian Candler, NetBox
You may use the script located at netbox/generate_secret_key.py to generate a suitable key.” says it right in that page u sent

Sent from my iPhone

On Mar 7, 2019, at 2:50 AM, Brian Candler <b.ca...@pobox.com> wrote:

It's not 100% clear in the documentation, but SECRET_KEY is just another setting in configuration.py

You put any very long random string in there.  The instructions show how to run a utility which can generate a random string for you. Then you find the SECRET_KEY = '' line in configuration.py, and you paste the random value between the quotes.

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages