Flask Relocator is a reusable Flask application designed to inform users of a server's new IP address or location. If you've migrated your server and don't want to take your application offline, Flask Relocator can dynamically inform users where to find the new site.
- Simple Integration: Easily integrate with any existing Flask application.
- Dynamic Redirection: Customize the message and redirection URL based on your new server location.
- Security Focused: Ensures that redirection notices are handled securely to prevent misuse.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them:
pip install flask
A step-by-step series of examples that tell you how to get a development environment running:
- Clone the repository:
git clone https://github.com/andytubeee/flask-relocator.git
cd flask-relocator
- Setup virtualenv and activate it
python -m venv venv
source venv\bin\activate # or whatever OS you are using
- Install requirements:
pip install -r requirements.txt
- Run the application:
python app.py
First make a copy of .env.example
to .env
and populate the appropriate port number and new server location.
Add Flask Relocator in your app:
from relocator.relocator import relocator_blueprint
app = Flask(__name__)
app.register_blueprint(relocator_blueprint, url_prefix='/')
Feel free to modify and contribute if you feel additional features are necessary
This project is licensed under the MIT License