DEV Community

Discussion on: How to add sitemap.xml to your Django Blog and make it work on Heroku (SEO)

radualexandrub profile image
Radu-Alexandru B Author

Do you have any "Sites" model when you are accessing the admin panel from (from deployment)? If not, you should open your terminal and call (after you added sitemap configurations as shown in this post):

> heroku run bash
$ python migrate
> heroku restart

This was my solution to fixing the problem that you have. However, if you do have a "Sites" model in your admin panel, try accessing it and change the first entry from to Furthermore, check that you have the corresponding settings in YourDjangoApp/

SECRET_KEY = os.environ.get('SECRET_KEY')
DEBUG = (os.environ.get("DEBUG_VALUE") == "True")

Also, recheck your MainApp/ as shown in this post's mini-tutorial.
Hope you will find a solution to your problem... Good luck!

dumdum profile image
dum dum

I've checked everything, I did what you told me.
Still got error 500 in production. :(

Argh.. I spent months finding this solutions.
Also, I have another problem about environment variables in Windows.
I put my secret key in my environment variables, I set my, then I ran py runserver.

I got error "django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty."

I don't know what to do. :(