Laravel can’t access database

I cvurrently have a laravel application running on heroku, the issue here is, I keep getting the error that I can’t connect to the database: SQLSTATE[HY000] [1045] Access denied for user ‘user’@’ec2-54-74-209-179.eu-west-1.compute.amazonaws.com’ (using password: YES). Now the host is wrong here, the environment files are TOTALLY different (except for the username) then what the error…

Details

Scraping data using BeautifulSoup

I’m trying scrape the data into a dictionary from this site, from bs4 import BeautifulSoup import requests from pprint import pprint page = requests.get(‘https://rspo.org/members/2857/2M-Holdings-Limited’) soup = BeautifulSoup(page.text, “lxml”) info = [] for x in range(1,7): items = soup.findAll(“div”,{“class”:f”info{x}”}) info.append(items) however, the HTML tags are not being removed. The final output should look like this #…

Details

Group by value of keys where values can be a list

So I’m trying to group the following object: staffs={ “James”:[“basket_ball”,”swimming”], “Cook”:”swimming”, “Peter”:”basket_ball”, “Ben”:”coding”, “Joe”:”coding” } Where the expected output should be: { “basket_ball”: [“James”,”Peter”], “swimming”:[“Cook”,”James”], “coding”:[“Ben”, “Joe”] } Following is what I have done: def group_by_hobby(staffs): hobbies = staffs.values() obj = {} for h in hobbies: if(isinstance(h, list)): for i in h: obj[i] = [k…

Details