Quellcode durchsuchen

Cambio d eestructura y arreglos para funcionar

Celestino Rey vor 1 Jahr
Ursprung
Commit
0ea167457d
100 geänderte Dateien mit 90 neuen und 0 gelöschten Zeilen
  1. 33 0
      Dockerfile
  2. 32 0
      nginx/default.conf
  3. 0 0
      src/accounts/.gitignore
  4. 0 0
      src/accounts/__init__.py
  5. 0 0
      src/accounts/admin.py
  6. 0 0
      src/accounts/apps.py
  7. 0 0
      src/accounts/models.py
  8. 0 0
      src/accounts/tests.py
  9. 0 0
      src/accounts/urls.py
  10. 0 0
      src/accounts/views.py
  11. 25 0
      src/config/entrypoint.sh
  12. 0 0
      src/lyrics/__init__.py
  13. 0 0
      src/lyrics/admin.py
  14. 0 0
      src/lyrics/apps.py
  15. 0 0
      src/lyrics/forms.py
  16. 0 0
      src/lyrics/management/commands/__init__.py
  17. 0 0
      src/lyrics/management/commands/borra_lyrics.py
  18. 0 0
      src/lyrics/management/commands/importa_album.py
  19. 0 0
      src/lyrics/management/commands/importa_artista.py
  20. 0 0
      src/lyrics/management/commands/importa_song.py
  21. 0 0
      src/lyrics/migrations/0001_initial.py
  22. 0 0
      src/lyrics/migrations/__init__.py
  23. 0 0
      src/lyrics/models.py
  24. 0 0
      src/lyrics/tests.py
  25. 0 0
      src/lyrics/urls.py
  26. 0 0
      src/lyrics/views.py
  27. 0 0
      src/manage.py
  28. 0 0
      src/mediafiles/profile_images/default.jpg
  29. 0 0
      src/mediafiles/profile_images/gravatar-tino.jpeg
  30. 0 0
      src/mediafiles/profile_images/gravatar-tino_jqB0Vq4.jpeg
  31. 0 0
      src/mediafiles/vehiculos/bmw.jpg
  32. 0 0
      src/mediafiles/vehiculos/bmw.png
  33. 0 0
      src/mediafiles/vehiculos/bmw_PMjCK7Q.png
  34. 0 0
      src/mediafiles/vehiculos/bmw_cSbhRuf.png
  35. 0 0
      src/mediafiles/vehiculos/bmw_x00n9W7.png
  36. 0 0
      src/mediafiles/vehiculos/bmw_yVyuq4g.jpg
  37. 0 0
      src/repostajes/.gitignore
  38. 0 0
      src/repostajes/__init__.py
  39. 0 0
      src/repostajes/admin.py
  40. 0 0
      src/repostajes/apps.py
  41. 0 0
      src/repostajes/forms.py
  42. 0 0
      src/repostajes/management/commands/borra_repostajes.py
  43. 0 0
      src/repostajes/models.py
  44. 0 0
      src/repostajes/static/css/portal.css
  45. 0 0
      src/repostajes/static/images/app-logo.svg
  46. 0 0
      src/repostajes/static/images/background/background-1.jpg
  47. 0 0
      src/repostajes/static/images/background/background-2.jpg
  48. 0 0
      src/repostajes/static/images/background/background-3.jpg
  49. 0 0
      src/repostajes/static/images/background/background-palmeras.jpg
  50. 0 0
      src/repostajes/static/images/doc-thumb-1.jpg
  51. 0 0
      src/repostajes/static/images/doc-thumb-2.jpg
  52. 0 0
      src/repostajes/static/images/favicon.ico
  53. 0 0
      src/repostajes/static/images/favicon.png
  54. 0 0
      src/repostajes/static/images/portal-logo.svg
  55. 0 0
      src/repostajes/static/images/profiles/profile-1.png
  56. 0 0
      src/repostajes/static/images/profiles/profile-2.png
  57. 0 0
      src/repostajes/static/images/profiles/profile-3.png
  58. 0 0
      src/repostajes/static/images/profiles/profile-4.png
  59. 0 0
      src/repostajes/static/images/profiles/profile-5.png
  60. 0 0
      src/repostajes/static/images/profiles/profile-6.png
  61. 0 0
      src/repostajes/static/images/reymota-logo.svg
  62. 0 0
      src/repostajes/static/images/user.png
  63. 0 0
      src/repostajes/static/images/users/user-1.jpg
  64. 0 0
      src/repostajes/static/images/users/user-2.jpg
  65. 0 0
      src/repostajes/static/images/users/user-3.jpg
  66. 0 0
      src/repostajes/static/images/users/user-4.jpg
  67. 0 0
      src/repostajes/static/images/users/user-5.jpg
  68. 0 0
      src/repostajes/static/images/users/user-6.jpg
  69. 0 0
      src/repostajes/static/images/users/user-7.jpg
  70. 0 0
      src/repostajes/static/images/users/user-8.jpg
  71. 0 0
      src/repostajes/static/images/users/user-9.jpg
  72. 0 0
      src/repostajes/static/js/app.js
  73. 0 0
      src/repostajes/static/js/charts-demo.js
  74. 0 0
      src/repostajes/static/js/index-charts.js
  75. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.css
  76. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.css.map
  77. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.min.css
  78. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.min.css.map
  79. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.css
  80. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.css.map
  81. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.min.css
  82. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.min.css.map
  83. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.css
  84. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.css.map
  85. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.min.css
  86. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.min.css.map
  87. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.css
  88. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.css.map
  89. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.min.css
  90. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.min.css.map
  91. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.css
  92. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.css.map
  93. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.min.css
  94. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.min.css.map
  95. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.css
  96. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.css.map
  97. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.min.css
  98. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.min.css.map
  99. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap.css
  100. 0 0
      src/repostajes/static/plugins/bootstrap/css/bootstrap.css.map

+ 33 - 0
Dockerfile

@@ -0,0 +1,33 @@
+# yup, python 3.11!
+FROM python:3.11-slim
+
+# install nginx
+RUN apt-get update && apt-get install nginx netcat-openbsd -y
+# copy our nginx configuration to overwrite nginx defaults
+RUN rm /etc/nginx/sites-enabled/default
+RUN rm /etc/nginx/sites-available/default
+COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
+# link nginx logs to container stdout
+RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
+
+# copy the django code
+COPY ./src ./app
+
+RUN chgrp -R 0 ./app && chmod -R g=u ./app
+RUN chgrp -R 0 /var/lib/nginx && chmod -R g=u /var/lib/nginx
+
+# change our working directory to the django projcet roo
+WORKDIR /app
+
+# create virtual env (notice the location?)
+# update pip
+# install requirements
+RUN python -m venv /opt/venv && \
+    /opt/venv/bin/python -m pip install pip --upgrade && \
+    /opt/venv/bin/python -m pip install -r requirements.txt
+
+# make our entrypoint.sh executable
+RUN chmod +x config/entrypoint.sh
+
+# execute our entrypoint.sh file
+CMD ["./config/entrypoint.sh"]

+ 32 - 0
nginx/default.conf

@@ -0,0 +1,32 @@
+upstream django_project {
+    server localhost:8000;
+}
+
+error_log /var/log/nginx/error.log;
+
+server {
+    listen       80;
+
+    access_log /var/log/nginx/access.log;
+
+    location / {
+        proxy_pass http://django_project;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header Host $host;
+        proxy_redirect off;
+        client_max_body_size 100M;
+    }
+
+    location /static/ {
+        alias /app/staticfiles/;
+    }
+
+    location /media/ {
+        alias /app/mediafiles/;
+    }
+
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+}

+ 0 - 0
accounts/.gitignore → src/accounts/.gitignore


+ 0 - 0
accounts/__init__.py → src/accounts/__init__.py


+ 0 - 0
accounts/admin.py → src/accounts/admin.py


+ 0 - 0
accounts/apps.py → src/accounts/apps.py


+ 0 - 0
accounts/models.py → src/accounts/models.py


+ 0 - 0
accounts/tests.py → src/accounts/tests.py


+ 0 - 0
accounts/urls.py → src/accounts/urls.py


+ 0 - 0
accounts/views.py → src/accounts/views.py


+ 25 - 0
src/config/entrypoint.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+RUN_PORT="8000"
+DATABASE=postgres
+SQL_HOST=postgresql
+SQL_PORT=5432
+
+if [ "$DATABASE" = "postgres" ]
+then
+    echo "Waiting for postgres..."
+
+    while ! nc -z $SQL_HOST $SQL_PORT; do
+      sleep 0.1
+    done
+
+    echo "PostgreSQL started"
+
+	/opt/venv/bin/python manage.py migrate --no-input
+	/opt/venv/bin/python manage.py collectstatic --no-input
+
+	/opt/venv/bin/gunicorn reymota.wsgi:application --bind "0.0.0.0:${RUN_PORT}" --daemon
+
+	nginx -g 'daemon off;'
+else
+    echo "la base de datos no es postgres: '$DATABASE'"
+fi

+ 0 - 0
lyrics/__init__.py → src/lyrics/__init__.py


+ 0 - 0
lyrics/admin.py → src/lyrics/admin.py


+ 0 - 0
lyrics/apps.py → src/lyrics/apps.py


+ 0 - 0
lyrics/forms.py → src/lyrics/forms.py


+ 0 - 0
lyrics/management/commands/__init__.py → src/lyrics/management/commands/__init__.py


+ 0 - 0
lyrics/management/commands/borra_lyrics.py → src/lyrics/management/commands/borra_lyrics.py


+ 0 - 0
lyrics/management/commands/importa_album.py → src/lyrics/management/commands/importa_album.py


+ 0 - 0
lyrics/management/commands/importa_artista.py → src/lyrics/management/commands/importa_artista.py


+ 0 - 0
lyrics/management/commands/importa_song.py → src/lyrics/management/commands/importa_song.py


+ 0 - 0
lyrics/migrations/0001_initial.py → src/lyrics/migrations/0001_initial.py


+ 0 - 0
lyrics/migrations/__init__.py → src/lyrics/migrations/__init__.py


+ 0 - 0
lyrics/models.py → src/lyrics/models.py


+ 0 - 0
lyrics/tests.py → src/lyrics/tests.py


+ 0 - 0
lyrics/urls.py → src/lyrics/urls.py


+ 0 - 0
lyrics/views.py → src/lyrics/views.py


+ 0 - 0
manage.py → src/manage.py


+ 0 - 0
mediafiles/profile_images/default.jpg → src/mediafiles/profile_images/default.jpg


+ 0 - 0
mediafiles/profile_images/gravatar-tino.jpeg → src/mediafiles/profile_images/gravatar-tino.jpeg


+ 0 - 0
mediafiles/profile_images/gravatar-tino_jqB0Vq4.jpeg → src/mediafiles/profile_images/gravatar-tino_jqB0Vq4.jpeg


+ 0 - 0
mediafiles/vehiculos/bmw.jpg → src/mediafiles/vehiculos/bmw.jpg


+ 0 - 0
mediafiles/vehiculos/bmw.png → src/mediafiles/vehiculos/bmw.png


+ 0 - 0
mediafiles/vehiculos/bmw_PMjCK7Q.png → src/mediafiles/vehiculos/bmw_PMjCK7Q.png


+ 0 - 0
mediafiles/vehiculos/bmw_cSbhRuf.png → src/mediafiles/vehiculos/bmw_cSbhRuf.png


+ 0 - 0
mediafiles/vehiculos/bmw_x00n9W7.png → src/mediafiles/vehiculos/bmw_x00n9W7.png


+ 0 - 0
mediafiles/vehiculos/bmw_yVyuq4g.jpg → src/mediafiles/vehiculos/bmw_yVyuq4g.jpg


+ 0 - 0
repostajes/.gitignore → src/repostajes/.gitignore


+ 0 - 0
repostajes/__init__.py → src/repostajes/__init__.py


+ 0 - 0
repostajes/admin.py → src/repostajes/admin.py


+ 0 - 0
repostajes/apps.py → src/repostajes/apps.py


+ 0 - 0
repostajes/forms.py → src/repostajes/forms.py


+ 0 - 0
repostajes/management/commands/borra_repostajes.py → src/repostajes/management/commands/borra_repostajes.py


+ 0 - 0
repostajes/models.py → src/repostajes/models.py


+ 0 - 0
repostajes/static/css/portal.css → src/repostajes/static/css/portal.css


+ 0 - 0
repostajes/static/images/app-logo.svg → src/repostajes/static/images/app-logo.svg


+ 0 - 0
repostajes/static/images/background/background-1.jpg → src/repostajes/static/images/background/background-1.jpg


+ 0 - 0
repostajes/static/images/background/background-2.jpg → src/repostajes/static/images/background/background-2.jpg


+ 0 - 0
repostajes/static/images/background/background-3.jpg → src/repostajes/static/images/background/background-3.jpg


+ 0 - 0
repostajes/static/images/background/background-palmeras.jpg → src/repostajes/static/images/background/background-palmeras.jpg


+ 0 - 0
repostajes/static/images/doc-thumb-1.jpg → src/repostajes/static/images/doc-thumb-1.jpg


+ 0 - 0
repostajes/static/images/doc-thumb-2.jpg → src/repostajes/static/images/doc-thumb-2.jpg


+ 0 - 0
repostajes/static/images/favicon.ico → src/repostajes/static/images/favicon.ico


+ 0 - 0
repostajes/static/images/favicon.png → src/repostajes/static/images/favicon.png


+ 0 - 0
repostajes/static/images/portal-logo.svg → src/repostajes/static/images/portal-logo.svg


+ 0 - 0
repostajes/static/images/profiles/profile-1.png → src/repostajes/static/images/profiles/profile-1.png


+ 0 - 0
repostajes/static/images/profiles/profile-2.png → src/repostajes/static/images/profiles/profile-2.png


+ 0 - 0
repostajes/static/images/profiles/profile-3.png → src/repostajes/static/images/profiles/profile-3.png


+ 0 - 0
repostajes/static/images/profiles/profile-4.png → src/repostajes/static/images/profiles/profile-4.png


+ 0 - 0
repostajes/static/images/profiles/profile-5.png → src/repostajes/static/images/profiles/profile-5.png


+ 0 - 0
repostajes/static/images/profiles/profile-6.png → src/repostajes/static/images/profiles/profile-6.png


+ 0 - 0
repostajes/static/images/reymota-logo.svg → src/repostajes/static/images/reymota-logo.svg


+ 0 - 0
repostajes/static/images/user.png → src/repostajes/static/images/user.png


+ 0 - 0
repostajes/static/images/users/user-1.jpg → src/repostajes/static/images/users/user-1.jpg


+ 0 - 0
repostajes/static/images/users/user-2.jpg → src/repostajes/static/images/users/user-2.jpg


+ 0 - 0
repostajes/static/images/users/user-3.jpg → src/repostajes/static/images/users/user-3.jpg


+ 0 - 0
repostajes/static/images/users/user-4.jpg → src/repostajes/static/images/users/user-4.jpg


+ 0 - 0
repostajes/static/images/users/user-5.jpg → src/repostajes/static/images/users/user-5.jpg


+ 0 - 0
repostajes/static/images/users/user-6.jpg → src/repostajes/static/images/users/user-6.jpg


+ 0 - 0
repostajes/static/images/users/user-7.jpg → src/repostajes/static/images/users/user-7.jpg


+ 0 - 0
repostajes/static/images/users/user-8.jpg → src/repostajes/static/images/users/user-8.jpg


+ 0 - 0
repostajes/static/images/users/user-9.jpg → src/repostajes/static/images/users/user-9.jpg


+ 0 - 0
repostajes/static/js/app.js → src/repostajes/static/js/app.js


+ 0 - 0
repostajes/static/js/charts-demo.js → src/repostajes/static/js/charts-demo.js


+ 0 - 0
repostajes/static/js/index-charts.js → src/repostajes/static/js/index-charts.js


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.min.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.min.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.min.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.min.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.min.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.min.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.min.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-grid.rtl.min.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.min.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.min.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.min.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.min.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.min.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.min.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.min.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-reboot.rtl.min.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.min.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.min.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.min.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.min.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.min.css → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.min.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.min.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap-utilities.rtl.min.css.map


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap.css → src/repostajes/static/plugins/bootstrap/css/bootstrap.css


+ 0 - 0
repostajes/static/plugins/bootstrap/css/bootstrap.css.map → src/repostajes/static/plugins/bootstrap/css/bootstrap.css.map


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.