Herramientas de usuario

Herramientas del sitio


wiki2:python:django:project

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
wiki2:python:django:project [2020/12/25 10:21]
alfred [models.py]
wiki2:python:django:project [2021/02/08 18:45] (actual)
Línea 9: Línea 9:
 poetry add django poetry add django
  
-poetry run django-admin startproject {project}+poetry run django-admin startproject {project} ​.
  
 - fix directory generation - - fix directory generation -
Línea 42: Línea 42:
  
 - Configure whitenoise - Configure whitenoise
 +
 +- Add STATIC_ROOT = os.path.join(BASE_DIR,​ '​static'​)
  
 poetry env list --full-path poetry env list --full-path
Línea 81: Línea 83:
  
 - Add to INSTALLED_APPS:​ daauth & {project} - Add to INSTALLED_APPS:​ daauth & {project}
 +
 +- Add the next lines to settings/​default.py:​
 +AUTH_USER_MODEL = '​{project}.User'​
 +LOGIN_REDIRECT_URL = '/'​
  
 python manage.py migrate python manage.py migrate
Línea 93: Línea 99:
  
 - Add to repository those last files - Add to repository those last files
 +
 +git commit
 +
 +mkdir -p {project}/​templates
 +
 +touch {project}/​templates/​base.html
 +
 +
 +
  
 </​code>​ </​code>​
Línea 217: Línea 232:
  
 <​code>​ <​code>​
- <​!DOCTYPE html>+<​!DOCTYPE html>
 <!--[if lte IE 6]><​html class="​preIE7 preIE8 preIE9"><​![endif]-->​ <!--[if lte IE 6]><​html class="​preIE7 preIE8 preIE9"><​![endif]-->​
 <!--[if IE 7]><​html class="​preIE8 preIE9"><​![endif]-->​ <!--[if IE 7]><​html class="​preIE8 preIE9"><​![endif]-->​
 <!--[if IE 8]><​html class="​preIE9"><​![endif]-->​ <!--[if IE 8]><​html class="​preIE9"><​![endif]-->​
 <!--[if gte IE 9]><​!--><​html><​!--<​![endif]-->​ <!--[if gte IE 9]><​!--><​html><​!--<​![endif]-->​
 + {% load dutils %}
   <​head>​   <​head>​
     <meta charset="​UTF-8">​     <meta charset="​UTF-8">​
Línea 230: Línea 246:
   <meta name="​description"​ content="​description here">​   <meta name="​description"​ content="​description here">​
   <meta name="​keywords"​ content="​keywords,​here">​   <meta name="​keywords"​ content="​keywords,​here">​
-  <link rel="​stylesheet"​ href="​stylesheet.css"​ type="​text/​css">​+  <link rel="​stylesheet"​ href="{% dstatic '​styles/​stylesheet.css' %}" type="​text/​css">​
   </​head>​   </​head>​
   <​body>​   <​body>​
-  ​+    aaaaa
   </​body>​   </​body>​
 </​html>​ </​html>​
 </​code>​ </​code>​
wiki2/python/django/project.1608891693.txt.gz · Última modificación: 2020/12/25 11:21 (editor externo)