Open jakubgrad opened 3 months ago
Sweet, thanks for the feedback. Also sorry for the mixup with the psql instructions, mistakenly left the local address in there that I'm using, but seems that you got it working either way. Cleaned up the instructions updated the commands that need to be executed. Cheers.
Peer review per instructions Tied to the course
Hey! It seems like the app is going well. I had a major problem with database connection and I think it can't work by default on any computer, but I added some suggestions on how to fix it.
Minor things:
README
: “Create a new username or login with a previously created username and password.” What does it mean? There is a few grammatical and spelling mistakes in there that could be fixed with a quick proofreading.“/db-and-web-dev/sovellus$ psql < schema.sql psql: error: could not connect to server: No such file or directory. Is the server running locally and accepting connections on Unix domain socket "/home/<username>/pgsql/sock/.s.PGSQL.5432"?
It would be nice to include instructions on how to start the psql, a reminder to run start-pg.sh, or at least link to the instructions in course material.
-Also if you added a note to run
flask run
inside thesovellus
directory that'd be greatProblem with database url and solution:
After setting the secret file according to the instructions in the repository, starting psql and running the flask app I can go to the website on localhost. However, when I try to sign up the terminal window that runs the app prints:
The terminal window that I started
start-pg.ssh
in says:So it seems like it didn't even realize something was trying to connect to it. My hunch is that you need to write an initialization scheme for the database or change
DATABASE_URL
to something more universal, because:Seems to be using a username
pajar
that’s unknown by my psql and a databasewebdev_db
that wasn’t yet created. These are probably familiar to your computer but not mine. To make it work on the my university[VMware Cubbli](https://helpdesk.it.helsinki.fi/ohjeet/tietokone-ja-tulostaminen/etakaytettavat-tyopoydat-vdi) I fired up
psql`:Then changed the
db_url.env
to:This way:
Codewise:
__init__.py
! In another course I've seen a link to some good instructions on modules and importing and if I understand correctly the init.py only has any text in it when the project grows pretty advanced. Simply puting__init__.py
files seems to work just fine most of the timeroutes.py
, there is no file for any specific entity. E.g. there is nousers.py
, noposts.py
, nothing similar that would support an easy expansion of the code. In your shoes I would refactor to different actions indb_actions.py
to files namedusers
,threads
,messages
etc. -db_models.py
looks like a very handy implementation of handling objects in your code, congrats! -I'm also surprised you usedLoginManager
fromFlask
, I didn't know such a thing existed... Nevertheless you if you're considering refactoring the code, you could moveuser_loader
and related functionalities to auser.py
Otherwise:
I like how the app looks! There’s definitely a lot of features running already, and the UI feels intuitive. In a moment of free time you could add a few
<br />
newlines to separate the links and text in the UI, but apart from that it seems to be going in a great direction :))