GithubHelp home page GithubHelp logo

vestigia's Introduction

CSC336 DATABASE PROJECT

PROJECT NAME: VESTIGIA

  1. Clone this repository

  2. From command line cd Vestigia

  3. Run command: set FLASK_APP=main.py

  4. Run command: set FLASK_DEBUG=1

  5. Run command: flask run

  6. In your browser head to http://localhost:5000/

  7. Or run from PyCharm and go to browser

In doing so, any changes you make will be reflected upon refreshing the browser, that way you don't have to constantly restart the web server

Used python program to design an web application with python flask and MYSQL

Requirements

  • Download and install Python, We used Python 3.7.1, make sure to check the box Add Python to PATH on the installation setup screen.
  • Download and install MySQL Community Server and MySQL Workbench, you can skip this step if you already have a MySQL server set up.
  • Install Python Flask with the command: pip install flask
  • Install Flask-MySQLdb with the command: pip install flask-mysqldb
  • ALSO, All requirements package will be on the requirements.txt and here is the references to check python flask installation: https://flask.palletsprojects.com/en/1.1.x/installation/

File Structure & Setup

Each file will contain the following:

  • \-- vestigia
       |-- main.py
    •  \-- static
          |-- style.css
          |-- base.css
    •   \-- templates
           |-- index.html
           |-- register.html
           |-- login.html
           |-- profile.html
           |-- layout.html
           |-- reply.html
           |-- post.html
  • main.py — This will be our main project file, all our Python code will be in this file (Routes, MySQL connection, validation, etc).
  • index.html — home page created with HTML5 and CSS3.
  • register.html — Registration form created with HTML5 and CSS3.
  • login.html — Login form created with HTML5 and CSS3.
  • profile.html - profile page created with HTML5 and CSS3.
  • post.html - post page created with HTML5 and CSS3.
  • reply.html - reply page created with HTML5 and CSS3.
  • layout.html - The layout template for the home and profile templates.

The below instruction will start your web server (Windows):

  • Make sure your MySQL server is up and running, it should have automatically started if you installed it via the installer.
  • Make sure the database connection details below (in python) and your database should follow:
  • app.secret_key = '111'
  • app.config['MYSQL_HOST'] = 'localhost'
  • app.config['MYSQL_USER'] = 'root'
  • app.config['MYSQL_PASSWORD'] = '111111'
  • app.config['MYSQL_DB'] = 'database_project'
  • Open Command Prompt, make sure you have the project directory selected, you can do this with the command cd c:\your_project_folder_destination\python main.py on Windows.

If you see the following information, you have successfully run the web application

  • Serving Flask app "test" (lazy loading)
  • Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
  • Debug mode: on
  • Restarting with stat
  • Debugger is active!
  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Click http://127.0.0.1:5000/ or copy it to your browser

vestigia's People

Contributors

sqiu001 avatar yifengjin89 avatar

Stargazers

Silvija Skemaite avatar

Watchers

James Cloos avatar  avatar Silvija Skemaite avatar

Forkers

skemaite nalam004

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.