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
""" | |
Django settings for brain project. | |
Generated by 'django-admin startproject' using Django 2.1.2. | |
For more information on this file, see | |
https://docs.djangoproject.com/en/2.1/topics/settings/ | |
For the full list of settings and their values, see | |
https://docs.djangoproject.com/en/2.1/ref/settings/ |
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
TemplateDoesNotExist at /bra/ | |
base1.html | |
Request Method: GET | |
Request URL: http://127.0.0.1:8000/bra/ | |
Django Version: 2.2.4 | |
Exception Type: TemplateDoesNotExist | |
Exception Value: | |
base1.html | |
Exception Location: /usr/local/lib/python3.7/site-packages/django/template/backends/django.py in reraise, line 84 | |
Python Executable: /usr/local/bin/python |
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
{% block content %} | |
<h1 class='mb-5'> </h1> | |
<div class="card mb-5" style="width:400px; border-radius: 8px;"> | |
{% if post.image %} | |
<img class="img-responsive" src="{{ post.image.thumbnail.400x400 }}" style="border-radius: 8px;" alt="Card image" font-size:8px;> | |
{% endif %} | |
<div class="card-body"> | |
<h4 class="card-title">{{ post.title }}</h4> | |
<p class="card-text">{{ post.body1 }}</p> | |
<p class="card-text">{{ post.body2 }}</p> |
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
class Post(models.Model): # Books | |
user = models.ForeignKey(User, on_delete=models.CASCADE) | |
image = VersatileImageField( | |
'Image', | |
upload_to='media_my/',null=True, | |
blank=True | |
) | |
title = models.CharField(max_length=150, db_index=True) | |
slug = models.SlugField(max_length=150, unique=True, blank=True) | |
tags = models.ManyToManyField('Tag', blank=True, related_name='posts') |
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
from django.db import models | |
from django.shortcuts import reverse | |
from django.utils.text import slugify | |
from time import time | |
from django.contrib.auth.models import User | |
from django.utils import timezone | |
from django.conf import settings | |
from versatileimagefield.fields import VersatileImageField | |
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
Operations to perform: | |
Apply all migrations: accounts, admin, auth, contenttypes, face, sessions | |
Running migrations: | |
Applying contenttypes.0001_initial...Traceback (most recent call last): | |
File "/home/daniel/Projects/dj/venv/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 392, in cmd_query | |
raw_as_string=raw_as_string) | |
_mysql_connector.MySQLInterfaceError: Table 'django_content_type' already exists | |
During handling of the above exception, another exception occurred: |