Git Product home page Git Product logo

pasonalblog's Introduction

๐Ÿ˜PERSONAL BLOG๐Ÿ˜

AUTHOR: BRIGHTON ASUMANI

ABOUT APPLICATION

this is an application that enables a user to sign and create a blog of his choice other users can be able to log in and comment your account.

DEPLOYMENT TO HEROKU

  1. $ heroku apps:destroy

This removes your application so that we can start a fresh

  1. $ heroku create

to create the application name

  1. $ heroku addons:create heroku-postgresql:hobby-dev

to create a new postgresql in the heroku database which is an addons application...i think..but the application will not have your current data in your localhost

  1. $ heroku run python3.6

just to make it clear the application we would like to make in the heroku website will not be based in your localhost..it will be in the heroku database so your DATABASE_URL will > change.Looking like it will be encrypted or something.that is why we are running run python.

we first import the os to get the necessary methods

  • import os
  • os.environ.get("DATABASE_URL")
  • you will get a foreign url like

'postgres://sahkwiwajjbmmm:40aea754da09ca490ed37e87c04aa36b931a04aa1713569561ab9d062c8c0131@ec2-54-235-196-250.compute-1.amazonaws.com:5432/d3f9jva5utjk0t' this is a good sign....it means progress Then paste it to the exports in the start.sh

export DATABASE_URL='postgres://komkrhtvhkqhpf:d1f780c5d2f7b58754ef26f4b85a8dbd6934d59cba70f8400ffca2845f5bb1b7@ec2-54-227-247-225.compute-1.amazonaws.com:5432/d6bgqi19ennurv' python3.6 manage.py server

afterward we do this in the ProdConfig function in the config.py this line of code class ProdConfig(Config): SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") and this will help you to recieve the localhost in Heroku. we then run this in our terminal after doing the git stuff... $ git add . $ git commit -m "Deploying to heroku" $ git push heroku master $ heroku run python3.6 manage.py shell this will head us to our shell where we need to create the db so as to run it right? db.create_all() exit() now we have created our database so we will need to export everything to our heroku if you had exports such as MAIL,PASSWORDS,SECRET_KEY $ heroku config:set the line of export may be like SECRET_KEY='MoringaSchool' PLease make sure you have no error to confirm if your psql is working run $ heroku pg:psql

for any queries please contact @ [email protected]

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.