Giter VIP home page Giter VIP logo

proj6-mongo's Introduction

Proj6-mongo

This is a class project. It uses mongodb to store text memos. Memos are created using a web forum. The webpage is created with Flask and Jinja2

Author

Jared Paeschke, [email protected]

Overview

This project has two pages the first is used to display memos. It lists them in ascending order of date. Each memo has a checkbox next to it which if selected will be deleted when the user hits the “Delete Selected” button at the top.

The second page of the Flask app allows creation of memos. When creating you must specify a date and then a message that will be stored into the database.

Installation

When writing and testing this program, the test machine was a Raspberry Pi 3 running Raspian Jesse. This is the best sure fire way that the install will go smoothly. However you should have success as long as you have bash and make on your server machine. You will also need to have MongoDB installed and setup. Setup and use of MongoDB will not be covered here, see the MongoDB documentation if you need assistance.

  1. git clone https://github.com/mahananaka/proj5-mongo.git < install directory >
  2. cd < install directory >
  3. bash ./configure
  4. You will need to create a a folder called secrets. Inside of secrets folder you will need two files
  • client_secrets.py which will need 3 lines, the quotes must be included.
    • db = “dbname” //this is the name of the database you created
    • db_user = “username” //a username with readWrite access to db
    • db_user_pw = “pwd” //pwd for db_user on db
  • admin_secrets.py which will need 3 lines, the quotes must be included.
    • port = “number” //port mongo is listening for connections on
    • host = “address” //address of mongodb, for example localhost
    • admin_user = “username” //optional, required to run create_db.py and destroy_db.py
    • admin_pw = “pwd //optional, required to run create_db.py and destroy_db.py
  1. make run

The program should then sit idle and wait for page requests. The default port is port 5000, to get the main page surf to http://yourserverip:5000/ or if you're on the server machine http://localhost:5000/. To stop the program at any time use ctrl+c.

Usage

Usage is pretty self explanatory, error messages will pop up if there is an issue. It is a simple web forum otherwise

Testing

A few test cases have been created. If you would like to run the tests yourself this can be done with the command make test. This will use nose to run all tests that have been written. These tests are located in the test_flask_main.py file. Right now it tests date time formatting as well as insertion, retrieval, and deletion from the database.

proj6-mongo's People

Contributors

mahananaka avatar michalyoung avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.