Browse Source

añado foto de perfil por defecto

politica
Celestino Rey 1 year ago
parent
commit
5194828330
12 changed files with 17 additions and 16 deletions
  1. +0
    -1
      RepostajesDj/vehiculos/.gitignore
  2. +1
    -0
      RepostajesDj/vehiculos/accounts/.gitignore
  3. +0
    -0
      RepostajesDj/vehiculos/accounts/migrations/__init__.py
  4. +2
    -2
      RepostajesDj/vehiculos/entornoPruebas.sh
  5. BIN
      RepostajesDj/vehiculos/mediafiles/profile_images/default.jpg
  6. BIN
      RepostajesDj/vehiculos/mediafiles/profile_images/gravatar-tino.jpeg
  7. BIN
      RepostajesDj/vehiculos/mediafiles/profile_images/gravatar-tino_jqB0Vq4.jpeg
  8. BIN
      RepostajesDj/vehiculos/mediafiles/vehiculos/bmw.jpg
  9. +9
    -9
      RepostajesDj/vehiculos/repostajes/migrations/0001_initial.py
  10. +1
    -1
      RepostajesDj/vehiculos/repostajes/models.py
  11. +3
    -2
      RepostajesDj/vehiculos/vehiculos/settings.py
  12. +1
    -1
      RepostajesDj/vehiculos/vehiculos/urls.py

+ 0
- 1
RepostajesDj/vehiculos/.gitignore View File

@ -13,4 +13,3 @@ Thumbs.db
*.log
db.sqlite3
mediafiles/

+ 1
- 0
RepostajesDj/vehiculos/accounts/.gitignore View File

@ -0,0 +1 @@
migrations/

+ 0
- 0
RepostajesDj/vehiculos/accounts/migrations/__init__.py View File


+ 2
- 2
RepostajesDj/vehiculos/entornoPruebas.sh View File

@ -1,5 +1,5 @@
export CSRF_TRUSTED_ORIGINS="localhost"
export DEBUG=1
export CSRF_TRUSTED_ORIGINS="http://localhost"
export DEBUG="True"
export SECRET_KEY="hola"
export DJANGO_ALLOWED_HOSTS="localhost"


BIN
RepostajesDj/vehiculos/mediafiles/profile_images/default.jpg View File

Before After
Width: 826  |  Height: 826  |  Size: 20 KiB

BIN
RepostajesDj/vehiculos/mediafiles/profile_images/gravatar-tino.jpeg View File

Before After
Width: 256  |  Height: 256  |  Size: 29 KiB

BIN
RepostajesDj/vehiculos/mediafiles/profile_images/gravatar-tino_jqB0Vq4.jpeg View File

Before After
Width: 256  |  Height: 256  |  Size: 29 KiB

BIN
RepostajesDj/vehiculos/mediafiles/vehiculos/bmw.jpg View File

Before After
Width: 500  |  Height: 500  |  Size: 18 KiB

+ 9
- 9
RepostajesDj/vehiculos/repostajes/migrations/0001_initial.py View File

@ -1,4 +1,4 @@
# Generated by Django 4.2 on 2024-08-29 08:38
# Generated by Django 4.2 on 2024-09-02 10:06
from django.db import migrations, models
import django.db.models.deletion
@ -28,13 +28,13 @@ class Migration(migrations.Migration):
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('fecha', models.DateField()),
('kms', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('litros', models.DecimalField(blank=True, decimal_places=2, max_digits=4, null=True)),
('descuento', models.DecimalField(blank=True, decimal_places=2, max_digits=4, null=True)),
('importe', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True)),
('precioxlitro', models.DecimalField(blank=True, decimal_places=2, max_digits=4, null=True)),
('kmsrecorridos', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)),
('consumo', models.DecimalField(blank=True, decimal_places=2, max_digits=4, null=True)),
('kms', models.DecimalField(blank=True, decimal_places=0, max_digits=10, null=True)),
('litros', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('descuento', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('importe', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('precioxlitro', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('kmsrecorridos', models.DecimalField(blank=True, decimal_places=0, max_digits=10, null=True)),
('consumo', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('vehiculo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='repostajes.vehiculo')),
],
),
@ -46,7 +46,7 @@ class Migration(migrations.Migration):
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
('foto', models.ImageField(blank=True, upload_to='profile_images')),
('foto', models.ImageField(blank=True, default='profile_images/default.jpg', upload_to='profile_images')),
('is_staff', models.BooleanField(default=False)),
('is_active', models.BooleanField(default=True)),
('nombre', models.CharField(blank=True, max_length=200, null=True)),


+ 1
- 1
RepostajesDj/vehiculos/repostajes/models.py View File

@ -42,7 +42,7 @@ class Repostaje(models.Model):
class ReyMotaUser(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(_("email address"), unique=True)
foto = models.ImageField(upload_to="profile_images", blank=True)
foto = models.ImageField(upload_to="profile_images", default="profile_images/default.jpg", blank=True)
is_staff = models.BooleanField(default=False)
is_active = models.BooleanField(default=True)
nombre = models.CharField(max_length=200, blank=True, null=True)


+ 3
- 2
RepostajesDj/vehiculos/vehiculos/settings.py View File

@ -25,6 +25,7 @@ SECRET_KEY = os.environ.get("SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ["DEBUG"] == 'True'
print("DEBUG: ", DEBUG)
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
@ -143,5 +144,5 @@ AUTH_USER_MODEL = "repostajes.ReyMotaUser"
MEDIA_ROOT = BASE_DIR / "mediafiles"
MEDIA_URL = '/media/'
# if DEBUG is False:
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")
if DEBUG is False:
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")

+ 1
- 1
RepostajesDj/vehiculos/vehiculos/urls.py View File

@ -31,7 +31,7 @@ urlpatterns = [
path("", TemplateView.as_view(template_name="repostajes/index.html"),
name="principal"), # new
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if not settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL,


Loading…
Cancel
Save