Coder Social home page Coder Social logo

info3180-lab5-starter's Introduction

Lab 5 Starter Code

Starter code for Lab 5

To begin using this app you can do the following:

  1. Clone the repository to your local machine.
  2. Create a Python virtual environment e.g. python -m venv venv (You may need to use python3 instead)
  3. Enter the virtual environment using source venv/bin/activate (or .\venv\Scripts\activate on Windows)
  4. Install the dependencies using Pip. e.g. pip install -r requirements.txt. Note: Ensure you have PostgreSQL already installed and a database created.
  5. Edit the app/__init__.py file and enter your database credentials and database name.
  6. Run the migrations by typing python manage.py db upgrade
  7. Start the development server using python run.py.

Separate Config file

I have included a separate config file app/config.py that can be used for setting up configuration for different environments e.g. Development and Production

Using this separate config file will also require you to set environment variables on your local computer or server at the command line. For example on Linux or MacOS:

export SECRET_KEY="my-super-secret-key"
export DATABASE_URL="postgresql://yourusername:yourpassword@localhost/databasename"

Or on Windows:

set SECRET_KEY="my-super-secret-key"
set DATABASE_URL="postgresql://yourusername:yourpassword@localhost/databasename"

If using PowerShell on Windows try the following:

$env:SECRET_KEY="YourRandomSecretKey"
$env:DATABASE_URL="postgresql://yourusername:yourpassword@localhost/databasename"

And on Heroku:

heroku config:set SECRET_KEY="my-super-secret-key"
heroku config:set DATABASE_URL="postgresql://yourusername:yourpassword@localhost/databasename"

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.