CorrelAid / kn_stolpersteine_survey

kn_stolpersteine_survey
0 stars 0 forks source link

How do I run this locally?

You can run this locally, setting up the database the first time is the hardest part:

  1. First, if you haven't already, install MongoDB: https://docs.mongodb.com/manual/administration/install-community/

    NOTE: For Arch Linux, install mongodb-bin from the AUR and see this if you run into an error when executing mongod.

  2. Start the server / MongoDB shell by running mongod on the command line

    NOTE: MongoDB actually doesn't create the database/document until an entry is inputted. So you don't have to do anything in the shell, although you could run show dbs later to verify the database was created.

  3. Create a .env file with the local MONGODB_URI in it along with the PORT you want to run the survey on 8080, e.g.:
    touch .env
    echo "MONGODB_URI=localhost:27017" > .env
    echo "PORT=8080" >> .env
    echo "LOCAL=True" >> .env
    echo "USERNAME=scrambled4421" >> .env
    echo "PASSWORD=$2VseJ#bYmVPxu" >> .env

    HINT: This username and password combo is simply for development.

  4. Install the python requirements (best to do in a virtual environment):
    pip install -r requirements.txt
  5. Run main.py (python main.py on the command line)
  6. Open up 0.0.0.0:8000 in your web browser

How is the data saved?

Example (null, True/False might be slightly inaccurate, will have to check):

User Management

  1. Run the app (main.py)
  2. Go to http://0.0.0.0:8080/admin/users (login if necessary with the credentials in .env)
  3. You should be able to manage users there: ![](documentation/Screenshot 2022-06-26 at 23.01.32.png)
  4. You can add many different users, random credentials will be generated: ![](documentation/Screenshot 2022-06-26 at 23.05.04.png)
  5. If you didn't save the password, click on the user to reset their password (you won't be able to see their old password, so this is how you would do it if a person forgot their own password.) ![](documentation/Screenshot 2022-06-26 at 23.05.16.png)
  6. Try logging in as a user, you should also be able to reset your password in a similar way: ![](documentation/Screenshot 2022-06-26 at 23.18.00.png)