Add profile model, update requirements, readme and gitignore

This commit is contained in:
Andrew Smirnov 2021-02-04 20:37:58 +03:00
parent 6056a1e85b
commit 234669242f
No known key found for this signature in database
GPG Key ID: 0EFE318E5BB2A82A
7 changed files with 33 additions and 2 deletions

2
.gitignore vendored
View File

@ -12,7 +12,7 @@ __pycache__/
local_settings.py
db.sqlite3
db.sqlite3-journal
media
media/
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
# in your Git repository. Update and uncomment the following line accordingly.

View File

@ -42,3 +42,4 @@ pip install -r requirements.txt
## Read more
- Zenpy: [http://docs.facetoe.com.au](http://docs.facetoe.com.au)
- Zendesk API: [https://developer.zendesk.com/rest_api/docs/](https://developer.zendesk.com/rest_api/docs/)

View File

@ -124,3 +124,5 @@ STATIC_URL = '/static/'
STATICFILES_DIRS = [
'static'
]
MEDIA_ROOT = BASE_DIR / 'media'

View File

@ -0,0 +1,22 @@
# Generated by Django 3.1.6 on 2021-02-04 17:36
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('role', models.IntegerField()),
('image', models.ImageField(upload_to='media/user_avatars')),
],
),
]

View File

@ -1,3 +1,8 @@
import os
from django.db import models
# Create your models here.
class UserProfile(models.Model):
role = models.IntegerField()
image = models.ImageField(upload_to=os.path.join('media', 'user_avatars'))

0
media/.gitkeep Normal file
View File

View File

@ -1 +1,2 @@
Django==3.1.6
Pillow==8.1.0