-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update instalacion.md #214
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,8 @@ Ahora que ya tenemos el entorno virtual el siguiente paso es instalar las depend | |
|
||
Antes de seguir con la aplicación, instalaremos Apache y el módulo [wsgi](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface) para que pueda servir nuestra aplicación Python a través de él. | ||
|
||
Además instalaremos la base de datos que usará django-aula y su conector python correspondiente, se recomienda instalar la aplicación sobre postgresql pero también es posible hacerlo sobre Mysql. | ||
Además instalaremos la base de datos que usará django-aula y su conector python correspondiente, se recomienda instalar la aplicación sobre postgresql. | ||
En Django se pueden utilizar los siguientes gestores de bases de datos: PostgreSQL, MariaDB, MySQL, Oracle, SQLite. | ||
|
||
**Postgresql (recomenat):** | ||
|
||
|
@@ -62,12 +63,6 @@ apt-get install apache2 libapache2-mod-wsgi-py3 python3-psycopg2 postgresql post | |
pip3 install wheel psycopg2 | ||
``` | ||
|
||
**Mysql (no recomenat):** | ||
|
||
```bash | ||
apt-get install apache2 libapache2-mod-wsgi-py3 python3-mysqldb mysql-server libmysqlclient-dev | ||
pip3 install wheel mysqlclient | ||
``` | ||
|
||
Una vez elegido el motor de base de datos, hay que crear la base de datos de la aplicación, y crear un usuario que la pueda administrar. | ||
|
||
|
@@ -84,20 +79,6 @@ GRANT ALL PRIVILEGES ON DATABASE djau2022 TO djau2022; | |
exit | ||
``` | ||
|
||
**Para Mysql** | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tampoc esborraria aquest exemple. |
||
``` | ||
sudo su | ||
mysql | ||
CREATE DATABASE djau2022 CHARACTER SET utf8; | ||
CREATE USER 'djau2022'@'localhost' IDENTIFIED BY 'XXXXXXXX'; | ||
GRANT ALL PRIVILEGES ON djau2022.* TO 'djau2022'@'localhost'; | ||
USE djau2022; | ||
SET default_storage_engine=INNODB; | ||
QUIT | ||
exit | ||
``` | ||
|
||
### Configurando Private Storage | ||
|
||
Hay información que la aplicación guarda en ficheros y que no debe estar en el servidor web. | ||
|
@@ -124,6 +105,8 @@ Django Aula tiene 3 archivos principales de configuración | |
|
||
A continuación dejo una configuración válida para los 2 archivos citados anteriormente, simplemente copia, pega y adáptalo a tus necesidades. | ||
|
||
Es imprescindible que cambies los campos que estan comentados con #CAMBIAR URGENTE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Proposo fer servir l'adjectiu OBLIGATORI/OBLIGATORIO. CAMBIO OBLIGATORIO. |
||
|
||
Los archivos están comentados para entenderlos mejor. | ||
|
||
**`/opt/djau2022/aula/settings_local.py"`** | ||
|
@@ -139,7 +122,7 @@ from .settings import CUSTOM_PORTAL_FAMILIES_TUTORIAL | |
DEBUG = True | ||
|
||
#Información del Centro | ||
NOM_CENTRE = 'Centre de Demo' | ||
NOM_CENTRE = 'Centre de Demo' #CAMBIAR URGENTE al nombre de tu centro | ||
LOCALITAT = u"Badia del Vallés" | ||
|
||
#Per a fer importació de la preinscripció | ||
|
@@ -156,15 +139,15 @@ ACCES_RESTRINGIT_A_GRUPS = None # ó be = ['direcció','administradors'] durant | |
|
||
#Datos del usuario administrador | ||
ADMINS = ( | ||
('admin', '[email protected]'), | ||
('admin', '[email protected]'), #CAMBIAR URGENTE a los datos del administrador | ||
) | ||
|
||
#Configuracion del Correo Relay SMTP y IMAP de la Aplicación | ||
EMAIL_HOST='smtp.gmail.com' | ||
EMAIL_HOST_IMAP="imap.gmail.com" | ||
EMAIL_HOST_USER='[email protected]' | ||
EMAIL_HOST_PASSWORD='xxxx xxxx xxxx xxxx' | ||
DEFAULT_FROM_EMAIL = 'El meu centre <[email protected]>' | ||
EMAIL_HOST_USER='[email protected]' #CAMBIAR URGENTE correo desde donde se enviaran los correos | ||
EMAIL_HOST_PASSWORD='xxxx xxxx xxxx xxxx' #CAMBIAR URGENTE contraseña del correo | ||
DEFAULT_FROM_EMAIL = 'El meu centre <[email protected]>' #CAMBIAR URGENTE | ||
EMAIL_PORT=587 | ||
EMAIL_USE_TLS=True | ||
SERVER_EMAIL='[email protected]' | ||
|
@@ -173,7 +156,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' | |
# Per proves, envia a la consola | ||
#EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | ||
|
||
EMAIL_SUBJECT_PREFIX = '[DEMO AULA] ' | ||
EMAIL_SUBJECT_PREFIX = '[DJANGO-AULA] ' | ||
|
||
#True si se activa el HTTPS | ||
SESSION_COOKIE_SECURE=False | ||
|
@@ -198,9 +181,9 @@ COMPRESS_ENABLED = False | |
|
||
#Passphrase que usara la app para cifrar las credenciales | ||
# changeit --> python manage.py generate_secret_key | ||
SECRET_KEY = 'j*y^6816ynk5$phos1y*sf$)3o#m(1^u-j63k712keu4fjh$lc' | ||
SECRET_KEY = 'j*y^6816ynk5$phos1y*sf$)3o#m(1^u-j63k712keu4fjh$lc' #CAMBIAR URGENTE | ||
|
||
CUSTOM_RESERVES_API_KEY = 'sxxxxxxm' | ||
CUSTOM_RESERVES_API_KEY = 'sxxxxxxm' | ||
|
||
#Componente que utilizará Django para serializar los objetos | ||
SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer' | ||
|
@@ -213,13 +196,12 @@ CUSTOM_KEY_COMERÇ = 'xxxxxx' | |
#Configuración de la Base de datos | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': location( 'db.sqlite'), | ||
'USER': '', | ||
'PASSWORD': '', | ||
'HOST': '', | ||
'PORT': '', | ||
'ATOMIC_REQUESTS': True, | ||
'ENGINE': 'django.db.backends.postgresql', | ||
'NAME': 'djau2022', | ||
'USER': 'djau2022', | ||
'PASSWORD': "XXXXXXXXXX", #CAMBIAR URGENTE a la contraseña puesta en la instalacion de postgres | ||
'HOST': 'localhost', | ||
'PORT': '5432', | ||
} | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No esborraria aquest exemple.