Skip to content

Commit

Permalink
add new urls and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
urmatovnaa committed Nov 26, 2022
1 parent 74d24ba commit 7380cc1
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ venv
__pycache__
db.sqlite3
identifier.sqlite
.env
.env
media
56 changes: 56 additions & 0 deletions event_app/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Generated by Django 4.1.3 on 2022-11-26 10:51

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
],
options={
'verbose_name': 'Категория',
'verbose_name_plural': 'Категории',
},
),
migrations.CreateModel(
name='Speakers',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('fullname', models.CharField(max_length=255, verbose_name='ФИО')),
('position', models.CharField(max_length=255, verbose_name='Должность')),
('country', models.CharField(max_length=150, verbose_name='Страна')),
],
options={
'verbose_name': 'Спикер',
'verbose_name_plural': 'Спикеры',
},
),
migrations.CreateModel(
name='Events',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True, verbose_name='Название')),
('photo', models.ImageField(upload_to='event_photo')),
('time', models.CharField(max_length=255, verbose_name='Время')),
('description', models.TextField(verbose_name='Чему вы научитесь?')),
('about', models.TextField(verbose_name='О программе')),
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='event_app.category', verbose_name='Категория')),
('speaker', models.ManyToManyField(blank=True, to='event_app.speakers', verbose_name='Спикеры')),
],
options={
'verbose_name': 'Мероприятие',
'verbose_name_plural': 'Мероприятия',
},
),
]
6 changes: 0 additions & 6 deletions main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@
'DEFAULT_FILTER_BACKENDS': [
'django_filters.rest_framework.DjangoFilterBackend'
],
# 'DEFAULT_PERMISSION_CLASSES': [
# 'rest_framework.permissions.IsAuthenticated',
# ],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
],
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 10000
}
Expand Down
4 changes: 3 additions & 1 deletion main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('account_app.urls'))

]

0 comments on commit 7380cc1

Please sign in to comment.