This project has been moved https://gitlab.com/spec-sa-ar/sgc-web.
-
Install python 3.8 (or high) x64 adding to PATH
-
Install git (if don't have it)
-
Clone this repository:
> git clone https://github.com/lucaslucyk/sgc-web.git
> cd scg-web
> cd scg
- Install dependencies:
> python -m pip install requirements.txt -r
- Generate and run migrations:
> python manage.py makemigrations
> python manage.py migrate
> python manage.py migrate --database=help
- (ERROR ONLY) Repare conection between poroject and database:
> python manage.py migrate --run-syncdb
- Create superuser completing specific data:
> python manage.py createsuperuser
...
- Run server:
> python manage.py runserver
- For stop server, use CTRL+C.
* To use a third party database or web-server, use the corresponding settings
* Scheduled tasks don't work on UNIX OS's
- Watch on YouTube: Deploy Django on Windows using Microsoft IIS
-
Install IIS on your VM or machine, and enable CGI
-
Clone repository in
C:/inetpub/wwwroot/
-
Install Python 3.8 in
C:/Python38
, and install dependences withrequirements.txt
. -
Navigate to
C:/
, right-click onPython38
, and editProperties
. Under Security, addIIS AppPool\DefaultAppPool
.DefaultAppPool
is the default app pool. ** Ensure the location is local and replicate this forC:/inetpub/wwwroot/sgc-web/
directory. -
Enable wfastcgi
-
Open a CMD terminal as Administrator, change directory with
cd C:\
and run the commandwfastcgi-enable
. -
Copy the Python path, and replace the
scriptProcessor="<to be filled in>"
in config/iis/web-config-template with the Python path returned bywfastcgi-enable
.
-
-
Edit the remaining settings in
web-config-template
then save it asweb.config
in theC:/inetpub/wwwroot/
directory. It should NOT sit insidesgc-web/
. Other settings can be modified ifsgc-web
does NOT sit atC:/inetpub/wwwroot/
-
Edit project
PYTHONPATH
(path to your project what includesmanage.py
) -
Edit
WSGI_HANDLER
(located in yourwsgi.py
) -
Edit
DJANGO_SETTINGS_MODULE
(yoursettings.py
module)
-
-
Open Internet Information Services (IIS) Manager. Under connections select the server, then in the center pane under Management select Configuration Editor. Under Section select system.webServer/handlers. Under Section select Unlock Section. This is required because the
C:/inetpub/wwwroot/web.config
creates a route handler for our project. -
Run
manage.py collectstatic
for load all staticfiles inpublish/static/
folder. -
Create folder
publish/media/
and copyweb.config
file frompublish/static/
. -
Add Virtual Directory. In order to enable serving static files map a static alias to the static directory,
C:/inetpub/wwwroot/sgc-web/publish/static/
-
Add Virtual Directory. In order to enable serving media files map a media alias to the media directory,
C:/inetpub/wwwroot/sgc-web/publish/media/
-
Refresh the server and navigate to
localhost
...