This repository contains tools for configuring a Django project for deployment on Vercel. It includes scripts to set up and reverse configurations needed for a smooth deployment process.
This project provides two key scripts:
setup.py
: Configures a Django project for deployment on Vercel. This includes setting debug flags, configuring static files, installing necessary packages, and more.reverse.py
: Reverts changes made bysetup.py
in case you need to undo the configuration. This ensures that your project can return to its previous state if something goes wrong.
To run these scripts, you need to have pyyaml
installed. You can install it using:
pip install pyyaml
The config.yaml
file contains project configuration settings for the deployment setup. Here's a brief overview of the options:
project_name
: Specify your Django project name. If left blank, the script will automatically find the project name.set_debug_false
: Set totrue
to configure Django withDEBUG = False
.generate_requirements
: Set totrue
to generate arequirements.txt
file usingpip freeze
.configure_static_files
: Set totrue
to configure static files, install Whitenoise, and set up static files storage.configure_database
: Set totrue
to remove SQLite configuration and prepare for a production database.
-
Ensure
config.yaml
is configured according to your needs. -
Run the setup script:
python setup.py
This script will configure your Django project for deployment on Vercel according to the settings in config.yaml
.
If you need to revert the changes made by setup.py
, use the reverse.py
script:
python reverse.py
This will undo the changes made during the setup process based on the deployment history.
If you encounter any issues, please open an issue in this repository. We appreciate your feedback and will work to address any problems as quickly as possible.
Contributions are welcome! If you have ideas for improvements or optimizations, feel free to fork the repository and submit a pull request. We encourage you to optimize and enhance the code.
- Settings Backup: The
reverse.py
script will remove the deployment history log once the configuration is reversed. If the reverse process fails, the settings are saved in the same folder for manual recovery. - Optimizations: The provided scripts are designed as a starting point. You are encouraged to optimize and adapt them to better fit your specific needs.
This project is licensed under the MIT License. See the LICENSE file for details.