19 changed files with 137 additions and 346 deletions
@ -1,22 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-02-28 18:43 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
initial = True |
|||
|
|||
dependencies = [ |
|||
('content', '0001_initial'), |
|||
('users', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='content', |
|||
name='school_owner', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.SchoolProfile'), |
|||
), |
|||
] |
|||
@ -1,28 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-03-01 10:47 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('settings', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='sitesettings', |
|||
name='event_poster', |
|||
field=models.ImageField(null=True, upload_to='', verbose_name="Affiche de l'événement"), |
|||
), |
|||
migrations.AddField( |
|||
model_name='sitesettings', |
|||
name='min_number_of_categories', |
|||
field=models.PositiveIntegerField(default=0, verbose_name='Nombre minimal de catégories dans laquelle participer'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='sitesettings', |
|||
name='site_logo', |
|||
field=models.ImageField(null=True, upload_to='', verbose_name='Logo du site'), |
|||
), |
|||
] |
|||
@ -1,23 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-03-01 11:09 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('settings', '0002_auto_20180301_1047'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='sitesettings', |
|||
name='event_poster', |
|||
field=models.ImageField(blank=True, null=True, upload_to='', verbose_name="Affiche de l'événement"), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='sitesettings', |
|||
name='site_logo', |
|||
field=models.ImageField(blank=True, null=True, upload_to='', verbose_name='Logo du site'), |
|||
), |
|||
] |
|||
@ -1,16 +1,18 @@ |
|||
""" |
|||
WSGI config for site_tps project. |
|||
import os |
|||
import sys |
|||
|
|||
It exposes the WSGI callable as a module-level variable named ``application``. |
|||
VIRTUALENV_LOC = '/var/www/site_tps/env_site' |
|||
|
|||
For more information on this file, see |
|||
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ |
|||
""" |
|||
# Activation de l'environnement virtuel |
|||
activate_env=os.path.join(VIRTUALENV_LOC, 'bin/activate_this.py') |
|||
exec(compile(open(activate_env, "rb").read(), activate_env, 'exec'), {'__file__':activate_env}) |
|||
|
|||
import os |
|||
# Ajout du répertoire du site au PATH |
|||
sys.path.append('/var/www/site_tps') |
|||
sys.path.append('/var/www/site_tps/site_tps') |
|||
|
|||
# Les trucs par défaut de Django |
|||
from django.core.wsgi import get_wsgi_application |
|||
|
|||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "site_tps.settings") |
|||
|
|||
application = get_wsgi_application() |
|||
|
|||
@ -1,44 +0,0 @@ |
|||
from django.contrib import admin |
|||
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin |
|||
from django.contrib.auth.admin import GroupAdmin as BaseGroupAdmin |
|||
from django.contrib.auth.models import User, Group |
|||
|
|||
from .models import UserProfile, SchoolProfile |
|||
|
|||
# Define an inline admin descriptor for Employee model |
|||
# which acts a bit like a singleton |
|||
|
|||
|
|||
class UserInline(admin.StackedInline): |
|||
model = UserProfile |
|||
can_delete = False |
|||
verbose_name_plural = 'user profiles' |
|||
|
|||
# Define a new User admin |
|||
|
|||
|
|||
class UserAdmin(BaseUserAdmin): |
|||
inlines = (UserInline, ) |
|||
|
|||
# Define an inline admin descriptor for Employee model |
|||
# which acts a bit like a singleton |
|||
|
|||
|
|||
class SchoolInline(admin.StackedInline): |
|||
model = SchoolProfile |
|||
can_delete = False |
|||
verbose_name_plural = 'schools' |
|||
fk_name = 'admins' |
|||
|
|||
# Define a new User admin |
|||
|
|||
|
|||
class GroupAdmin(BaseGroupAdmin): |
|||
inlines = (SchoolInline, ) |
|||
|
|||
|
|||
# Re-register UserAdmin |
|||
admin.site.unregister(User) |
|||
admin.site.register(User, UserAdmin) |
|||
admin.site.unregister(Group) |
|||
admin.site.register(Group, GroupAdmin) |
|||
@ -1,20 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-03-01 07:16 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('auth', '0009_alter_user_last_name_max_length'), |
|||
('users', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='schoolprofile', |
|||
name='admins', |
|||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='admin_of', to='auth.Group'), |
|||
), |
|||
] |
|||
@ -1,19 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-03-01 09:33 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('users', '0002_schoolprofile_admins'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='schoolprofile', |
|||
name='group', |
|||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='school', to='auth.Group'), |
|||
), |
|||
] |
|||
@ -1,19 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-03-01 09:52 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('users', '0003_auto_20180301_0933'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='schoolprofile', |
|||
name='group', |
|||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='school', to='auth.Group'), |
|||
), |
|||
] |
|||
@ -1,19 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-03-01 10:29 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('users', '0004_auto_20180301_0952'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='userprofile', |
|||
name='school', |
|||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.SchoolProfile'), |
|||
), |
|||
] |
|||
@ -1,18 +0,0 @@ |
|||
# Generated by Django 2.0.1 on 2018-03-01 23:28 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('users', '0005_auto_20180301_1029'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='schoolprofile', |
|||
name='phone', |
|||
field=models.CharField(help_text='Visible uniquement des administrateurs', max_length=10, null=True, verbose_name='Numéro de téléphone pour contacter le responsable des productions'), |
|||
), |
|||
] |
|||
Loading…
Reference in new issue