Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database migration failed #17

Open
zongxindu opened this issue Jan 1, 2022 · 3 comments
Open

Database migration failed #17

zongxindu opened this issue Jan 1, 2022 · 3 comments

Comments

@zongxindu
Copy link

zongxindu commented Jan 1, 2022

I just followed the installation steps. when I am running this command:
python manage.py migrate
The program throws an exception:
django.core.exceptions.ImproperlyConfigured: Set the SECRET_KEY environment variable
This is defined in the setting.py file:
SECRET_KEY = env('SECRET_KEY')
then randomly generated a string of text as the SECRET_KEY:
SECRET_KEY='2ap4_#)wk@5)3lsh6idzxwaouy6)*(5z#w(3atk0%a5!+-29j-
but, when I am running the command: python manage.py migrate
The program throws another exception:
django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL environment variable
I am sorry, I tried to learn the basics of Django, but I didn't know anything about Web development, or database, and after looking at some of the basics of Django, I still didn't know how to Debug this error.

@SanaNazari
Copy link

I get the same error. Did you manage to solve this?

@bitmman
Copy link

bitmman commented Sep 8, 2022

Same error here.

@jamnicki
Copy link

  • create .env file as follows or set the environment variables:

    annotation/AlpacaTag/app/.env

    SECRET_KEY=<your-key>
    DATABASE_URL=postgres://doccano_admin:doccano_pass@localhost:5432/doccano?sslmode=disable
  • set up the database (most propably creators implemented AlpacaTag along with doccano with postgres db)

    https://doccano.github.io/doccano/install_and_upgrade_doccano/#use-postgresql-as-a-database

  • run the app with --insecure flag by python manage.py runserver 0.0.0.0:8000 --insecure

    why? - read here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants