How to customize a requirements.txt for multiple environments?

You can cascade your requirements files and use the “-r” flag to tell pip to include the contents of one file inside another. You can break out your requirements into a modular folder hierarchy like this: `– django_project_root |– requirements | |– common.txt | |– dev.txt | `– prod.txt `– requirements.txt The files’ contents would … Read more

Getting “[archiver] unsupported version (1.13) in file header” when running pg_restore

You need to upgrade your local postgres to get the last security patch from the 2018-03-01, like Heroku did the 1st march. You need one of the last releases 10.3, 9.6.8, 9.5.12, 9.4.17, and 9.3.22. The security patch can be found here https://www.postgresql.org/about/news/1834/. It seems the patch modified pg_dump, that’s probably why we can’t use … Read more

Heroku free account limited?

Heroku provides, for free, a 5MB database Heroku provides, for free, 1 dyno. A dyno is an instance of your application running and responding to requests. If each instance of your application can serve each request in 100ms, then you get 600 requests/minute with the free account. Your application code and its assets (the slug) … Read more

How to solve error “Missing `secret_key_base` for ‘production’ environment” (Rails 4.1)

I had the same problem and solved it by creating an environment variable to be loaded every time I logged in to the production server, and made a mini-guide of the steps to configure it: I was using Rails 4.1 with Unicorn v4.8.2 and when I tried to deploy my application it didn’t start properly … Read more

What does “./bin/www” do in Express 4.x?

In Express 3.0, you normally would use app.configure() (or app.use()) to set up the required middleware you need. Those middleware you specified are bundled together with Express 3.0. Example: var express = require(‘express’); var routes = require(‘./routes’); var user = require(‘./routes/user’); var http = require(‘http’); var path = require(‘path’); var app = express(); // all … Read more

Heroku/devise – Missing host to link to! Please provide :host parameter or set default_url_options[:host]

You need to add this to your environment.rb config.action_mailer.default_url_options = { :host => ‘localhost’ } Make sure you change host to your production url and keep it localhost for development. This is for the mailer, it needs a default email to send out notices such as confirmations etc… You should check the logs on the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)