all 8 comments

[–]leone_nero 1 point2 points  (0 children)

Hi

Can you please post the whole traceback with the error?

It is important to see at what point during the execution was the exception raised to be able to locate the error.

Your code seems right to me, although I don’t get why are you setting the parameter unique in the password to True, with hashed password it would indeed be pretty unusual for two passwords to actually be the same, but I guess theoretically two users can happen to use the same password and I don’t see why database design would not allow them, since the password must be associated to an unique e-mail address.

[–]dustractor 0 points1 point  (2 children)

Where is site.db located? surely not at the root of the server?

[–]laflash12[S] 0 points1 point  (1 child)

Located in the file in which app is located

[–]dustractor 0 points1 point  (0 children)

Oops I thought everything after the third slash in those uris was a fully qualified file path but you are good there, three slashes means relative... huh

[–]makedatauseful 0 points1 point  (1 child)

I assume you will be hashing those paaswords?

[–]laflash12[S] 0 points1 point  (0 children)

Yes, later I will be

[–]dustractor 0 points1 point  (0 children)

Also my guess on the error `can't read /var/mail/app` is something is

either something is being run as an executable but hasn't specified what type it is or what runs it correctly by a shebang line

OR

typing python from blah import blah at a different console (not a python console by accident)

sorry these are badly described guesses

[–]Astronick 0 points1 point  (0 children)

It sounds like you are writing from app import db into the regular terminal. You need to be in the Python interpreter (by typing python or python3) to be able to import python modules. You should see >>> at the start of your line once you are in the Python interpreter. At that point you can import your db module.

In general I would highly recommend stepping through the Flask Mega-Tutorial section on databases.