Está en la página 1de 4

Configuración

Instalar Apache 2.2.21

https://olex-secure.openlogic.com/content/openlogic/apache/2.2.21/openlogic-apache-
2.2.21-windows-ia32-ins-OpenSSL-Included-1.zip

Descargar modwsgi

https://modwsgi.googlecode.com/files/mod_wsgi-win32-ap22py27-3.3.so

Descomprimir y copiar mod_wsgi.so en “C:\Program Files (x86)\Apache Software


Foundation\Apache2.2\modules”

Abrimos en “C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf” el


archivo httpd.conf, y agregamos la linea

Descargamos desde un repositorio el proyecto, lo descomprimimos y lo pegamos en


“C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs”

Ahora configuramos en “C:\Program Files (x86)\Apache Software


Foundation\Apache2.2\conf\extra” el archivo “httpd-vhosts” agregango las siguientes líneas
<VirtualHost *:80>
WSGIScriptAlias / 'c:/Program Files x86/Apache Software
Foundation/Apache2.2/htdocs/Dyuyay/Dyuyay/wsgi.py'
Alias /templates/ 'c:/Program Files x86/Apache Software
Foundation/Apache2.2/htdocs/Dyuyay/templates/'
Alias /static/ 'c:/Program Files x86/Apache Software
Foundation/Apache2.2/htdocs/Dyuyay/static/'
<Directory "c:/Program Files x86/Apache Software
Foundation/Apache2.2/htdocs/Dyuyay/static">
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
<Directory "c:/Program Files x86/Apache Software
Foundation/Apache2.2/htdocs/Dyuyay/templates">
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>

Luego httpd.conf ubicado en “C:\Program Files (x86)\Apache Software


Foundation\Apache2.2\conf” se le hace los siguientes cambios incluyendo la linea

Ahora configurar l archivo wsgi.py ubicado en “C:\Program Files (x86)\Apache Software


Foundation\Apache2.2\htdocs\Dyuyay\Dyuyay”
import sys
import os
sys.path.append('C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\htdocs\Dyuyay\Dyuyay')
sys.path.append('C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\htdocs\Dyuyay')
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"Dyuyay.settings")
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Ahora configurar el archivo settings.py ubicado en “C:\Program Files (x86)\Apache Software


Foundation\Apache2.2\htdocs\Dyuyay\Dyuyay”
# Build paths inside the project like this:
os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See
https://docs.djangoproject.com/en/1.6/howto/deployment/checklist
/
# SECURITY WARNING: keep the secret key used in production
secret!
SECRET_KEY =
'xa2lkldc(xvuz(tia^zvihv0yf1e8f+t@kgkt7v&o=500nc0hf'
# SECURITY WARNING: don't run with debug turned on in
production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
STATIC_ROOT='C:/Program Files (x86)/Apache Software
Foundation/Apache2.2/htdocs/Dyuyay/static/'
STATICFILES_DIRS=(
'C:/Program Files (x86)/Apache Software
Foundation/Apache2.2/htdocs/Dyuyay/static',
#os.path.join(BASE_DIR, "static"),
#os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', 'static')).replace('\\','/'),
)
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'appPrincipal',
'appAdministrativa',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'Dyuyay.urls'
WSGI_APPLICATION = 'Dyuyay.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'dbdyuyay'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)

Luego nuevamente el archivo httpd.conf unbicado “C:\Program Files (x86)\Apache Software


Foundation\Apache2.2\conf” para agregar el dominio,

También podría gustarte