{"id":25480002,"url":"https://github.com/dehongi/bash_django_install","last_synced_at":"2026-04-13T01:09:26.120Z","repository":{"id":277719948,"uuid":"933290104","full_name":"dehongi/bash_django_install","owner":"dehongi","description":"A bash script for automating installing Django on Ubuntu and deploying using Gunicorn, Nginx and Postgresql.","archived":false,"fork":false,"pushed_at":"2025-02-15T16:22:29.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T17:24:08.966Z","etag":null,"topics":["django","gunicorn","nginx","postgresql","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dehongi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-15T15:57:18.000Z","updated_at":"2025-02-15T16:22:32.000Z","dependencies_parsed_at":"2025-02-15T17:24:19.107Z","dependency_job_id":"119d115b-6381-46a2-88fa-e9dcc0772025","html_url":"https://github.com/dehongi/bash_django_install","commit_stats":null,"previous_names":["dehongi/bash_django_install"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehongi%2Fbash_django_install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehongi%2Fbash_django_install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehongi%2Fbash_django_install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dehongi%2Fbash_django_install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dehongi","download_url":"https://codeload.github.com/dehongi/bash_django_install/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239495591,"owners_count":19648354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","gunicorn","nginx","postgresql","ubuntu"],"created_at":"2025-02-18T15:26:45.375Z","updated_at":"2025-11-06T15:30:35.322Z","avatar_url":"https://github.com/dehongi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bash Django Install\n\nThis repository contains a bash script to automate the deployment of a Django application on an Ubuntu server using PostgreSQL, Gunicorn, and Nginx. The script simplifies the setup process by handling dependency installation, database configuration, and server setup.\n\n## Features\n\n- Automates the deployment of Django projects on Ubuntu.\n- Configures PostgreSQL as the database backend.\n- Sets up Gunicorn as the application server.\n- Configures Nginx as a reverse proxy.\n- Secures the application with Let's Encrypt SSL.\n- Handles user input for project-specific configurations.\n\n## Prerequisites\n\n- An Ubuntu server (tested on Ubuntu 20.04/22.04).\n- A Django project hosted on a GitHub repository.\n- A domain name pointed to your server's IP address.\n- SSH access to the server with sudo privileges.\n\n## Usage\n\n### 1. Clone the Repository\n\nClone this repository to your local machine or directly to your server:\n\n```bash\ngit clone https://github.com/dehongi/bash_django_install.git\ncd bash_django_install\n```\n\n### 2. Make the Script Executable\n\nEnsure the script is executable:\n\n```bash\nchmod +x deploy_django.sh\n```\n\n### 3. Run the Script\n\nExecute the script with `sudo`:\n\n```bash\nsudo ./deploy_django.sh\n```\n\nThe script will prompt you for the following information:\n\n- **Project Name**: The name of your Django project (e.g., `myproject`).\n- **GitHub Repository URL**: The URL of your Django project's GitHub repository.\n- **Domain Name**: The domain name for your application (e.g., `example.com`).\n- **Server IP Address**: The IP address of your server.\n- **PostgreSQL Database Name**: The name of the PostgreSQL database.\n- **PostgreSQL Username**: The username for the PostgreSQL database.\n- **PostgreSQL Password**: The password for the PostgreSQL database.\n- **Django Secret Key**: (Optional) Your Django secret key. If left empty, a secure key will be generated.\n- **Email for Let's Encrypt**: Your email address for Let's Encrypt SSL certificate.\n\n### 4. Follow the Prompts\n\nThe script will automatically:\n\n1. Install required dependencies (Python, PostgreSQL, Nginx, etc.).\n2. Configure PostgreSQL and create a database.\n3. Clone your Django project from GitHub.\n4. Set up a virtual environment and install dependencies.\n5. Configure Django settings (database, secret key, allowed hosts, etc.).\n6. Set up Gunicorn as a systemd service.\n7. Configure Nginx as a reverse proxy.\n8. Secure the application with Let's Encrypt SSL.\n9. Restart services and finalize the setup.\n\n### 5. Verify Deployment\n\nOnce the script completes, visit your domain (e.g., `https://example.com`) to verify the deployment.\n\n---\n\n## Customization\n\nIf your Django project has specific requirements or configurations, you may need to modify the script:\n\n- **Environment Variables**: If your project uses environment variables for sensitive data, update the script to include them.\n- **Static and Media Files**: Ensure your Django project is configured to serve static and media files correctly.\n- **Additional Dependencies**: Add any additional dependencies to the `requirements.txt` file in your Django project.\n\n---\n\n## Example\n\nHere’s an example of running the script:\n\n```bash\n$ sudo ./deploy_django.sh\nEnter project name (e.g., myproject): myawesomeproject\nEnter GitHub repository URL: https://github.com/username/myawesomeproject.git\nEnter your domain name (e.g., example.com): myawesomeproject.com\nEnter server IP address: 192.168.1.100\nEnter PostgreSQL database name: myawesomeproject_db\nEnter PostgreSQL username: myawesomeproject_user\nEnter PostgreSQL password: ********\nEnter Django secret key (leave empty to generate): \nEnter email for Let's Encrypt SSL: admin@myawesomeproject.com\n```\n\n---\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Acknowledgments\n\n- Inspired by [Bastakiss's Django Deployment Guide](https://bastakiss.com/blog/django-6/deploy-django-on-ubuntu-using-postgresql-gunicorn-nginx-174).\n- Thanks to the Django, PostgreSQL, Gunicorn, and Nginx communities for their excellent documentation.\n\n---\n\n## Support\n\nIf you encounter any issues or have questions, feel free to open an issue in this repository.\n\n---\n\nEnjoy deploying your Django projects with ease! 🚀\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdehongi%2Fbash_django_install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdehongi%2Fbash_django_install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdehongi%2Fbash_django_install/lists"}