I want to use cookiecutter-flask template to create a local interface for a python app. I want to create a registration system with a database.
You can create a cookiecutter project by running
cookiecutter https://github.com/cookiecutter-flask/cookiecutter-flask.git
I edited .env by putting :
DATABASE_URL=sqlite:///dev.db
Then I filled the database dev.db by creating a table users using command shell :
sqlite3 dev.db
CREATE TABLE users ( id INTEGER PRIMARY KEY, username VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, created_at TIMESTAMP NOT NULL, first_name VARCHAR(255), last_name VARCHAR(255), active BOOLEAN NOT NULL, is_admin BOOLEAN NOT NULL );
I don't understand why when I want to register a new user, I get sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: users
I tried to create a new database, completely delete the project and make a new one.
I also tried to use absolute path but it created a new error sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
Problem solved : I had to run in the shell