Coder Social home page Coder Social logo

blog-site's Introduction

Report shop site

This is a project for report shopping site using:

  • Python3.7.6
  • Flask 1.1
  • Flask-Admin 1.5.4
  • Flask-Mail 0.9.1
  • Flask-msearch 0.2.9
  • SQLAlchemy 1.3.17

Run

run.py

To deploy on Heroku

  • To install heroku command
    • brew tap heroku/brew && brew install heroku
  • To install psycopg2 to use PostgreSQL via SQLAlchemy
    • conda install -c anaconda psycopg2
  • To install gunicorn to run on WSGI server for Python
    • conda install -c anaconda gunicorn
  • To export requirements (Didn't use pip freeze to avoid including direct references)
    • pip list --format=freeze > requirements.txt *Remove some modules if you face some issues during the installation on heroku
  • To create Procfile (this command is used when gunicorn run)
    • create Procfile under the project and include "web: gunicorn run:app"
  • To create runtime.txt
    • create runtime.txt under the project and include python version
  • To login heroku
    • heroku login
  • To create app on heroku
    • heroku create {appname}
  • Add addon for postgresql
    • heroku addons:create heroku-postgresql:hobby-dev
  • To update database URI for postgres on Heroku
    • SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
  • To commit on git (example)
    • git add .
    • git commit
  • To push to Heroku
    • git push heroku master *Remove some modules on requirements.txt if you face some issues during the installation on heroku
  • To check if the DB is PostgreSQL
    • heroku run python
      • import os
      • a = os.environ.get('DATABASE_URL')
      • print(a) * you can see the postgres://*****
    • To create table
      • from flaskblog import create_app, db
      • app = create_app()
      • app.app_context().push()
      • db.create_all()
  • To use email
    • heroku config:set MAIL_USERNAME={your username}
    • heroku config:set MAIL_PASSWORD={your password}

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.