Well, you could generate a SECRET KEY here:
https://www.miniwebtool.com/django-secret-key-generator/

Then in your settings.py file you need to add this line:
SECRET_KEY = “[insert secret key here]”

https://docs.djangoproject.com/en/dev/ref/settings/#secret-key


From: [email protected] [mailto:[email protected]] On 
Behalf Of Ramandeep Kaur
Sent: Wednesday, August 8, 2018 8:50 AM
To: [email protected]
Subject: Re: django models

I am new at Django so I don't know how to create secret key. please explain me.

On Wed, Aug 8, 2018, 1:20 PM Gerald Brown 
<[email protected]<mailto:[email protected]>> wrote:

The last line of the error message tells you what to do.  Create a Secret Key 
in your settings.py file because it says it is now empty.

On Wednesday, 08 August, 2018 02:43 PM, Ramandeep Kaur wrote:
when i run this ./manage.py makemigrations it gives some error. Don't know what 
to do.

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
353, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
195, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 
39, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File 
"C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py",
 line 8, in <module>
    from django.db.migrations.autodetector import MigrationAutodetector
  File "C:\Python27\lib\site-packages\django\db\migrations\autodetector.py", 
line 13, in <module>
    from django.db.migrations.questioner import MigrationQuestioner
  File "C:\Python27\lib\site-packages\django\db\migrations\questioner.py", line 
12, in <module>
    from .loader import MigrationLoader
  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 10, 
in <module>
    from django.db.migrations.recorder import MigrationRecorder
  File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
12, in <module>
    class MigrationRecorder(object):
  File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
26, in MigrationRecorder
    class Migration(models.Model):
  File "C:\Python27\lib\site-packages\django\db\migrations\recorder.py", line 
27, in Migration
    app = models.CharField(max_length=255)
  File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 1072, in __init__
    super(CharField, self).__init__(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", 
line 166, in __init__
    self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 55, in 
__getattr__
    self._setup(name)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 43, in 
_setup
    self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 120, in 
__init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be 
empty.

On Wed, Aug 8, 2018 at 6:22 AM, Gerald Brown 
<[email protected]<mailto:[email protected]>> wrote:

Just delete the code in models.py and run ./manage.py makemigrations and 
./manage.py migrate.

On Wednesday, 08 August, 2018 01:14 AM, Ramandeep Kaur wrote:
My question is that how to delete models in django?
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/42e646fa-af94-4250-b04a-5765e2975c3e%40googlegroups.com<https://groups.google.com/d/msgid/django-users/42e646fa-af94-4250-b04a-5765e2975c3e%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ebb428c7-b1cd-46e2-e139-9fe96a884353%40gmail.com<https://groups.google.com/d/msgid/django-users/ebb428c7-b1cd-46e2-e139-9fe96a884353%40gmail.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL18nxmkKT9JPrvxnzQ3n1hs-KXXEUzBSX0YYqr-PP69K_PPJw%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAL18nxmkKT9JPrvxnzQ3n1hs-KXXEUzBSX0YYqr-PP69K_PPJw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f04ab2c6-1eea-9430-f05c-a51b4f2d7fc0%40gmail.com<https://groups.google.com/d/msgid/django-users/f04ab2c6-1eea-9430-f05c-a51b4f2d7fc0%40gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL18nx%3D5uzirrxr0kJAHKZ0B3ubHWo82e7hP5AjRNQO4ZeCRYw%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAL18nx%3D5uzirrxr0kJAHKZ0B3ubHWo82e7hP5AjRNQO4ZeCRYw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/229da8adeb1d4fe7b006648c29decbcc%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to