Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ryancheley/gcp-django-demo

Helper files needed for GCP Django Windows Server Setup
https://github.com/ryancheley/gcp-django-demo

Last synced: about 1 month ago
JSON representation

Helper files needed for GCP Django Windows Server Setup

Awesome Lists containing this project

README

        

# Guide to Deploy Django on IIS using wfastcgi

1. Open a Powershell terminal in Admin mode

2. Browse to c:\inetweb\wwwroot

3. Delete the IIS start files in the c:\inetweb\wwwroot\ directory

4. Checkout the code from the repo:
```
git clone https://github.com/ryancheley/gcp-django-demo mywebsite
```

5. Open VS Code as Admin

6. Open Folder c:\inetweb\wwwroot\mywebsite

7. Trust the Code if given the prompt

8. Open terminal

9. Create a virtual environment:
```
python -m venv venv
```

10. Activate the virtual environment:
```
.\venv\Scripts\activate
```

11. Install the requirements from the requirements.txt file:
```
pip install -r requirements.txt
```

12. Run `wfastcgi-enable` command:
```
wfastcgi-enable
```

13. Update `web.config` to put in needed values (e.g. server name, path to python executable, and path to the Django application):
```















```

14. Run `migrate` command:
```
python manage.py migrate
```

15. Run development server:
```
python manage.py runserver
```

16. Verify that the site works by opening a web browser and navigating to `http://localhost:8000/`.

17. Stop the development server

18. Collect static files:
```
python manage.py collectstatic
```

19. Grant Full Permissions for web directory to IIS AppPool\DefaultAppPool

20. Go to IIS Manager

21. Add Virtual Directory to Static Folder

22. Unlock the configuration manager

23. Move `web.config` to parent directory c:\inetweb\wwwroot\

24. Restart the WebSite

That's it! Your Django application should now be deployed and running on IIS.