Trending
Heat Index
All posts by Simon Parker
Most Recent
 
Read More
May 24, 2020

Redirect Nginx Magento front end to new website while maintaining admin access on old website

I had a client who wanted their old Magento based site to redirect all front end users to their new domain while still maintining admin access so they could continue to use their Amazon integration for managing orders and stock.

This is actually fairly straightforward with Nginx but needs a couple of entries to ensure it works.

You will have an entire nginx conf file for this site but qwe will just be modifying the following line

location / { try_files $uri $uri/ /index.php?$args; }

This line usually just sends all requests to be processed by php and we want to change that so that all instead redirected to the new domain

We do this by changing this [...]

62
 
Read More
April 26, 2020

How to use Blueprint static folders correctly in Python – Flask

In a sentence. Static folders don’t inherit as templates do. Ill explain.

In Flask you have a concept called Blueprints.

In most Flask tutorials you see throughout the web they will have a single file which contains everything including your routes, models and any other code. You may do some includes to pull in additional functions but that is probably it.

As your Flask application grows in size this is obviously not feasible and the different sections of code need to be separated out into different folders or separations of concerns as it were.

For this, you can use Blueprints. you create a folder for example /lists/ and in there you define an [...]

3710
 
Read More
February 26, 2020

Python Flask SQLalchemy Mixins at the end of existing columns

A mixin can add specific fields to another model in Flask,

Example model

# User Class class User(db.Model): __tablename__ = 'User' id = db.Column(Integer, primary_key=True) username = db.Column(String(32), unique=True) email = db.Column(String(32), unique=True) password = db.Column(Binary) role = db.Column(String(32), default="Member") # Define the relationship to Role via UserRoles def __init__(self, **kwargs): for property, value in kwargs.items(): # depending on whether value is an iterable or not, we must # unpack it's value (when **kwargs is request.form, some values [...]
966
 
Read More
September 4, 2019

WordPress Plugin Developers – Please Stop Auto Enabling Google Maps Api’s

I have wasted another day finding a hidden setting in another plugin that includes the Google Maps Api js without a key.

At Coffee Black we have a sort of rolling default setup for new WordPress websites.

It includes all of the plugins we always use and some tweaks and other nice to haves which make our lives so much simpler and makes us more efficient when creating a new site.

We use WP Bakery Page builder on all of our client sites and several addons for this.

Over the past 6 months, I have now spent an inordinate amount of time troubleshooting Google Maps API errors.

That seems like a simple thing to do right?

Here lies the issue. When you [...]

65
Latest Headlines
 
 
 

Trending Topics
Web
Python
Flask
Uncategorized
valve
sqlalchemy
Jquery
wordpress
Tech
Top Stories
 
 
 
 
 
 
 
 
Right Now
 
 
 
 
 
 
Top Five
Heat Index
 
1
How to use Blueprint static folders correctly in Python – Flask
 
2
How to forward emails to Freshdesk correctly in Office Exchange 365
 
3
Hass.io Homeassistant Rfxtrx setup for LightwaveRF Devices
 
4
Nginx proxy caching with multiple php pools and WordPress
 
5
Python Flask SQLalchemy Mixins at the end of existing columns