mezzanine-themes
mezzanine-themes copied to clipboard
"SECRET_KEY setting must not be empty"
Hey there!
I just tried downloading and running this but was met with the below exception:
Traceback (most recent call last):
File "manage.py", line 28, in
Any thoughts of where this might be coming from? I'm very new to Mezzanine so would appreciate any help.
Cheers!
Rich
Hi,
I'm also new to Django/Mezzanine and have also got the same error.
This is what I did:
- Started a new env.
- Copied your project files in to the env's project folder.
-
pip install -r requirements.txt
- Edited settings.py
- Tried to run
python manage.py syncdb --migrate
which gave the following error:
Traceback (most recent call last):
File "manage.py", line 28, in <module>
execute_from_command_line(sys.argv)
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 9, in <module>
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal, emit_pre_sync_signal
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/core/management/sql.py", line 9, in <module>
from django.db import models
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/__init__.py", line 5, in <module>
from django.db.models.query import Q
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/query.py", line 17, in <module>
from django.db.models.deletion import Collector
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/deletion.py", line 4, in <module>
from django.db.models import signals, sql
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/sql/__init__.py", line 4, in <module>
from django.db.models.sql.subqueries import *
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/sql/subqueries.py", line 12, in <module>
from django.db.models.sql.query import Query
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 22, in <module>
from django.db.models.sql import aggregates as base_aggregates_module
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/sql/aggregates.py", line 9, in <module>
ordinal_aggregate_field = IntegerField()
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 116, in __init__
self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/conf/__init__.py", line 54, in __getattr__
self._setup(name)
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
self._wrapped = Settings(settings_module)
File "/home/rik/.virtualenvs/wg/local/lib/python2.7/site-packages/django/conf/__init__.py", line 151, in __init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
I would be super grateful if someone could let me know if I'm missing something here. Is this the proper way to install/run someone else's project?
All the best, ~ Rik
Soooo what so we do here? I would like to look at the templates however need to set KEY!!
I got the same problem..
Same problem here. I see this is ongoing. Helllllpppp somebody.
I just solved it.
- create your environment/ source myenv/bin/activate
- install from the requirement.txt with "pip2.7 install -r requirements.txt" from requirements directory (i think python 3.5 is too high)
- Generate a key online for django from http://www.miniwebtool.com/django-secret-key-generator/ then input in the settings.py as ( SECRET_KEY = "yj6o@&vrar6^l1u68!bxumj@xr4&5)zzk!h1qw&63^&@2d3w@#")
- edit the DATABASE SECTION in settings. ENGINE: django.db.backends.sqlite3 (append sqlite3) NAME: "dev.db" (or any name you like)
- Enable DEBUG = True (in settings.py) to see detailed debugs
- run python2.7 manage.py createdb --noinput
- run python2.7 manage.py changepassword admin
- Enter new password
- run python2.7 manage.py runserver you can shoot me a mail if you get stuck. Seems to require some experience setting up django.
Hi!
Got through this stage, got an additional compatibility issue (solved), but I can't understand what is going wrong on the creation of the database. Apparently an issue with the template loader. Any help much appreciated.
`Traceback (most recent call last):
File "D:\Gdrive\website\Mezza\web00\lib\site-packages\django\template\base.py", line 1333, in import_library
mod = import_module(taglib_module)
File "D:\Gdrive\website\Mezza\web00\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Gdrive\website\Mezza\web00\mezzthemes\manage.py", line 10, in 'find_template_loader'
Add SECRET_KEY = "yj6o@&vrar6^l1u68!bxumj@xr4&5)zzk!h1qw&63^&@2d3w@#"
in settings.py
work for me
On an additional note, for security purposes please don't use same secret keys as the ones you posted online! :)
Hi guys I need your help to fix my problem. first all, I don't Idea to edith the file of "settings.py" to put my SECRET_KEY. Graphite don't run. When I saw in my error log file I get this.
[Mon Jun 25 10:55:11.611665 2018] [:error] [pid 25414] ImproperlyConfigured: The SECRET_KEY setting must not be empty.
[Mon Jun 25 10:55:11.640350 2018] [:error] [pid 25415] mod_wsgi (pid=25415): Target WSGI script '/opt/graphite/conf/graphite.wsgi' cannot be loaded as Python module.
[Mon Jun 25 10:55:11.640462 2018] [:error] [pid 25415] mod_wsgi (pid=25415): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
[Mon Jun 25 10:55:11.640512 2018] [:error] [pid 25415] Traceback (most recent call last):
[Mon Jun 25 10:55:11.640550 2018] [:error] [pid 25415] File "/opt/graphite/conf/graphite.wsgi", line 7, in
Thank you for your help
in my case, I removed some unused import which helps me (Somehow I imported my db_route.py and there is some circle referencing in it.