Commit 99f8d783 authored by Florent Chehab's avatar Florent Chehab

App renamed from rex to backend to be clearer

parent 55e35f6d
from django.contrib import admin
from reversion_compare.admin import CompareVersionAdmin
from rex.models.location import Country, City
from backend.models.location import Country, City
from rex.models.location import CountryCulture
from rex.models.location import CountryHealthInsurance
from rex.models.location import CountryOtherInsurance
from rex.models.location import CountryTransport
from rex.models.location import CountryTourism
from rex.models.location import CountryOtherStuff
from rex.models.location import CountryVisaAdministrative
from rex.models.location import CountryPhoto
from rex.models.location import CountryScholarship
from rex.models.location import CountryDri
from backend.models.location import CountryCulture
from backend.models.location import CountryHealthInsurance
from backend.models.location import CountryOtherInsurance
from backend.models.location import CountryTransport
from backend.models.location import CountryTourism
from backend.models.location import CountryOtherStuff
from backend.models.location import CountryVisaAdministrative
from backend.models.location import CountryPhoto
from backend.models.location import CountryScholarship
from backend.models.location import CountryDri
from rex.models.location import CityTransport
from rex.models.location import CityTourism
from rex.models.location import CityOtherStuff
from backend.models.location import CityTransport
from backend.models.location import CityTourism
from backend.models.location import CityOtherStuff
from rex.models.university import University, Campus, UniversityScholarship
from backend.models.university import University, Campus, UniversityScholarship
from rex.models.university import UniversityInfo
from rex.models.university import UniversitySemestersDates
from rex.models.university import UniversityInsurance
from rex.models.university import UniversityCourses
from rex.models.university import UniversityCulture
from rex.models.university import UniversityOtherStuff
from rex.models.university import UniversitySpecialOffer
from rex.models.university import UniversityPhoto
from rex.models.university import UniversityDri
from backend.models.university import UniversityInfo
from backend.models.university import UniversitySemestersDates
from backend.models.university import UniversityInsurance
from backend.models.university import UniversityCourses
from backend.models.university import UniversityCulture
from backend.models.university import UniversityOtherStuff
from backend.models.university import UniversitySpecialOffer
from backend.models.university import UniversityPhoto
from backend.models.university import UniversityDri
from rex.models.university import CampusTransport
from rex.models.university import CampusAccommodation
from rex.models.university import CampusCultureAndStudentLife
from rex.models.university import CampusOtherStuff
from backend.models.university import CampusTransport
from backend.models.university import CampusAccommodation
from backend.models.university import CampusCultureAndStudentLife
from backend.models.university import CampusOtherStuff
from rex.models.module import Currency
from rex.models.otherCore import Department
from rex.models.otherCore import Offer
from rex.models.otherCore import Semester
from rex.models.otherCore import Specialty
from backend.models.module import Currency
from backend.models.otherCore import Department
from backend.models.otherCore import Offer
from backend.models.otherCore import Semester
from backend.models.otherCore import Specialty
from rex.models.user import Recommendation
from rex.models.user import RecommendationList
from rex.models.user import PreviousDeparture
from rex.models.user import PreviousDepartureFeedback
from rex.models.user import UserData
from backend.models.user import Recommendation
from backend.models.user import RecommendationList
from backend.models.user import PreviousDeparture
from backend.models.user import PreviousDepartureFeedback
from backend.models.user import UserData
CLASSIC_MODELS = [
Country,
......
from django.apps import AppConfig
class RexConfig(AppConfig):
name = 'rex'
class BackendConfig(AppConfig):
name = 'backend'
This diff is collapsed.
from django.db import models
from rest_framework import serializers, permissions
from rex.models.tools import DictModeViewSet
from rex.models.location import Country
from backend.models.tools import DictModeViewSet
from backend.models.location import Country
# Data model based on : https://unstats.un.org/unsd/methodology/m49/overview/
......
from django.db import models
from rex.models.module import BasicModule
from rex.models.location import City
from backend.models.module import BasicModule
from backend.models.location import City
from rest_framework import viewsets, permissions
from rex.models.module import BasicModuleSerializer
from backend.models.module import BasicModuleSerializer
####################
......
from django.db import models
from rex.models.location import City
from rex.models.module import VersionnedModuleSerializer
from rex.models.module import Photo
from backend.models.location import City
from backend.models.module import VersionnedModuleSerializer
from backend.models.module import Photo
from rest_framework import viewsets, permissions
......
from django.db import models
from rest_framework import serializers, permissions
from rex.models.tools import DictModeViewSet
from backend.models.tools import DictModeViewSet
# Data model based on : https://unstats.un.org/unsd/methodology/m49/overview/
......
from django.db import models
from rex.models.module import BasicModule
from rex.models.location import Country
from backend.models.module import BasicModule
from backend.models.location import Country
from rest_framework import viewsets, permissions
from rex.models.module import BasicModuleSerializer
from backend.models.module import BasicModuleSerializer
####################
......
from django.db import models
from rex.models.location import Country
from rex.models.module import DriRestrictedModule, DriRestrictedModuleSerializer
from backend.models.location import Country
from backend.models.module import DriRestrictedModule, DriRestrictedModuleSerializer
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.location import Country
from rex.models.module import VersionnedModuleSerializer
from rex.models.module import Photo
from backend.models.location import Country
from backend.models.module import VersionnedModuleSerializer
from backend.models.module import Photo
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.location import Country
from rex.models.module import Scholarship, BasicModuleSerializer
from backend.models.location import Country
from backend.models.module import Scholarship, BasicModuleSerializer
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.tools import UsefullLinksField
from rex.models.module import VersionnedModule, VersionnedModuleSerializer
from backend.models.tools import UsefullLinksField
from backend.models.module import VersionnedModule, VersionnedModuleSerializer
class BasicModule(VersionnedModule):
......
from rex.models.module import BasicModule, BasicModuleSerializer
from backend.models.module import BasicModule, BasicModuleSerializer
class DriRestrictedModule(BasicModule):
......
from django.db import models
from rex.models.module import VersionnedModule
from rex.utils.friendly_path import friendly_path
from backend.models.module import VersionnedModule
from backend.utils.friendly_path import friendly_path
path_and_rename = friendly_path("uploads/universities/photos/", 'title')
......
from django.db import models
from rex.models.module import BasicModule
from backend.models.module import BasicModule
from .currency import Currency
from rest_framework import serializers
from django.core.validators import MinValueValidator
......
from django.db import models
from rest_framework import serializers, viewsets, permissions
from rex.models.university import University
from rex.models.otherCore import Semester, Specialty
from backend.models.university import University
from backend.models.otherCore import Semester, Specialty
class Offer(models.Model):
......
from django.db import models
from rest_framework import serializers, viewsets, permissions
from rex.models.otherCore import Department
from backend.models.otherCore import Department
class Specialty(models.Model):
......
from django.contrib.postgres.fields import JSONField
from rest_framework import serializers
from rex.models.tools.validateWithRestFramework import validate_with_rest_framework
from backend.models.tools.validateWithRestFramework import validate_with_rest_framework
class UrlAndDescriptionSerializer(serializers.Serializer):
......
from django.db import models
from rex.models.module import BasicModule, BasicModuleSerializer
from rex.models.location import City
from rex.models.university import University
from backend.models.module import BasicModule, BasicModuleSerializer
from backend.models.location import City
from backend.models.university import University
from django.core.validators import MinValueValidator, MaxValueValidator
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.module import BasicModule
from rex.models.university import Campus
from backend.models.module import BasicModule
from backend.models.university import Campus
from rest_framework import viewsets, permissions
from rex.models.module import BasicModuleSerializer
from backend.models.module import BasicModuleSerializer
####################
# CultureAndStudentLife
......
from django.db import models
from rex.models.module import VersionnedModule
from rex.utils.friendly_path import friendly_path
from backend.models.module import VersionnedModule
from backend.utils.friendly_path import friendly_path
path_and_rename = friendly_path("uploads/universities/logos/", 'name')
......
from rex.models.university import University
from backend.models.university import University
from rest_framework import serializers, viewsets, permissions
from rex.models.university.campus import CampusSerializer
from backend.models.university.campus import CampusSerializer
class UniversitySerializer(serializers.ModelSerializer):
......
from django.db import models
from rex.models.module import BasicModule
from rex.models.university import University
from backend.models.module import BasicModule
from backend.models.university import University
from rest_framework import viewsets, permissions
from rex.models.module import BasicModuleSerializer
from backend.models.module import BasicModuleSerializer
####################
# Insurance
......
from django.db import models
from rex.models.university import University
from rex.models.module import DriRestrictedModule, DriRestrictedModuleSerializer
from backend.models.university import University
from backend.models.module import DriRestrictedModule, DriRestrictedModuleSerializer
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.module import BasicModule, BasicModuleSerializer
from rex.models.university import University
from rex.models.module import Currency
from backend.models.module import BasicModule, BasicModuleSerializer
from backend.models.university import University
from backend.models.module import Currency
from django.core.validators import MinValueValidator
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.university import University
from rex.models.module import VersionnedModuleSerializer
from rex.models.module import Photo
from backend.models.university import University
from backend.models.module import VersionnedModuleSerializer
from backend.models.module import Photo
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.university import University
from rex.models.module import Scholarship, BasicModuleSerializer
from backend.models.university import University
from backend.models.module import Scholarship, BasicModuleSerializer
from rest_framework import viewsets, permissions
......
from django.db import models
from rex.models.module import BasicModule, BasicModuleSerializer
from rex.models.university import University
from backend.models.module import BasicModule, BasicModuleSerializer
from backend.models.university import University
from rest_framework import serializers, viewsets, permissions
......
from django.db import models
from rest_framework import viewsets, permissions, serializers
from rex.models.otherCore.specialty import Specialty
from rex.models.otherCore.semester import Semester
from rex.models.university import University
from backend.models.otherCore.specialty import Specialty
from backend.models.otherCore.semester import Semester
from backend.models.university import University
from django.contrib.auth.models import User
from django.contrib.postgres.fields import JSONField
......
......@@ -2,8 +2,8 @@ from django.db import models
from rest_framework import viewsets, permissions
from django.core.validators import MaxValueValidator
from rex.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
from rex.models.user import PreviousDeparture
from backend.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
from backend.models.user import PreviousDeparture
from django.contrib.postgres.fields import JSONField
......
......@@ -2,11 +2,11 @@ from django.db import models
from rest_framework import viewsets, permissions
from django.core.validators import MaxValueValidator
from rex.models.university import University
from rex.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
from rex.models.otherCore import Specialty
from backend.models.university import University
from backend.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
from backend.models.otherCore import Specialty
from rex.models.user import RecommendationList
from backend.models.user import RecommendationList
class Recommendation(UserRestrictedModule):
......
from django.db import models
from rest_framework import viewsets, permissions
from rex.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
from backend.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
class RecommendationList(UserRestrictedModule):
......
from django.db import models
from rest_framework import viewsets, permissions
from rex.models.tools import UsefullLinksField
from backend.models.tools import UsefullLinksField
from django.contrib.postgres.fields import JSONField
from rex.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
from backend.models.user import UserRestrictedModule, UserRestrictedModuleSerializer
class UserData(UserRestrictedModule):
......
from django.conf.urls import url, include
from rex import views
from backend import views
from rest_framework import routers
from rex.models.location import CountryViewSet
from rex.models.location import CityViewSet
from rex.models.module import CurrencyViewSet
from rex.models.otherCore import DepartmentViewSet
from rex.models.otherCore import OfferViewSet
from rex.models.otherCore import SemesterViewSet
from rex.models.otherCore import SpecialtyViewSet
from rex.models.location import CountryCultureViewSet
from rex.models.location import CountryHealthInsuranceViewSet
from rex.models.location import CountryOtherInsuranceViewSet
from rex.models.location import CountryTransportViewSet
from rex.models.location import CountryTourismViewSet
from rex.models.location import CountryOtherStuffViewSet
from rex.models.location import CountryVisaAdministrativeViewSet
from rex.models.location import CountryPhotoViewSet
from rex.models.location import CountryScholarshipViewSet
from rex.models.location import CountryDriViewSet
from rex.models.location import CityTransportViewSet
from rex.models.location import CityTourismViewSet
from rex.models.location import CityOtherStuffViewSet
from rex.models.location import CityPhotoViewSet
from rex.models.university import UniversityViewSet
from rex.models.university import CampusViewSet
from rex.models.university import UniversityScholarshipViewSet
from rex.models.university import UniversityInfoViewSet
from rex.models.university import UniversitySemestersDatesViewSet
from rex.models.university import UniversityInsuranceViewSet
from rex.models.university import UniversityCoursesViewSet
from rex.models.university import UniversityCultureViewSet
from rex.models.university import UniversityOtherStuffViewSet
from rex.models.university import UniversitySpecialOfferViewSet
from rex.models.university import UniversityPhotoViewSet
from rex.models.university import UniversityDriViewSet
from rex.models.university import CampusTransportViewSet
from rex.models.university import CampusAccommodationViewSet
from rex.models.university import CampusCultureAndStudentLifeViewSet
from rex.models.university import CampusOtherStuffViewSet
from rex.models.user import RecommendationViewSet
from rex.models.user import RecommendationListViewSet
from rex.models.user import PreviousDepartureViewSet
from rex.models.user import PreviousDepartureFeedbackViewSet
from rex.models.user import UserDataViewSet
from backend.models.location import CountryViewSet
from backend.models.location import CityViewSet
from backend.models.module import CurrencyViewSet
from backend.models.otherCore import DepartmentViewSet
from backend.models.otherCore import OfferViewSet
from backend.models.otherCore import SemesterViewSet
from backend.models.otherCore import SpecialtyViewSet
from backend.models.location import CountryCultureViewSet
from backend.models.location import CountryHealthInsuranceViewSet
from backend.models.location import CountryOtherInsuranceViewSet
from backend.models.location import CountryTransportViewSet
from backend.models.location import CountryTourismViewSet
from backend.models.location import CountryOtherStuffViewSet
from backend.models.location import CountryVisaAdministrativeViewSet
from backend.models.location import CountryPhotoViewSet
from backend.models.location import CountryScholarshipViewSet
from backend.models.location import CountryDriViewSet
from backend.models.location import CityTransportViewSet
from backend.models.location import CityTourismViewSet
from backend.models.location import CityOtherStuffViewSet
from backend.models.location import CityPhotoViewSet
from backend.models.university import UniversityViewSet
from backend.models.university import CampusViewSet
from backend.models.university import UniversityScholarshipViewSet
from backend.models.university import UniversityInfoViewSet
from backend.models.university import UniversitySemestersDatesViewSet
from backend.models.university import UniversityInsuranceViewSet
from backend.models.university import UniversityCoursesViewSet
from backend.models.university import UniversityCultureViewSet
from backend.models.university import UniversityOtherStuffViewSet
from backend.models.university import UniversitySpecialOfferViewSet
from backend.models.university import UniversityPhotoViewSet
from backend.models.university import UniversityDriViewSet
from backend.models.university import CampusTransportViewSet
from backend.models.university import CampusAccommodationViewSet
from backend.models.university import CampusCultureAndStudentLifeViewSet
from backend.models.university import CampusOtherStuffViewSet
from backend.models.user import RecommendationViewSet
from backend.models.user import RecommendationListViewSet
from backend.models.user import PreviousDepartureViewSet
from backend.models.user import PreviousDepartureFeedbackViewSet
from backend.models.user import UserDataViewSet
from rest_framework.documentation import include_docs_urls
......
from django.shortcuts import render
from rex.models.university import Campus
from backend.models.university import Campus
def home(request):
......
......@@ -13,6 +13,6 @@ Pour charger des données dans l'application, tout se passe via l'API du site.
- Lancer les scripts pour insérer les données :
```
./rex/utils/insert_country.py -t <Token> [-a <server adress>]
./rex/utils/insert_universities.py-t <Token> [-a <Adresse-de-l'API>]
./backend/utils/insert_country.py -t <Token> [-a <server adress>]
./backend/utils/insert_universities.py-t <Token> [-a <Adresse-de-l'API>]
```
......@@ -32,7 +32,7 @@ INSTALLED_APPS = [
'rest_framework',
'rest_framework.authtoken',
'main_website',
'rex'
'backend'
]
MIDDLEWARE = [
......
......@@ -16,5 +16,5 @@ urlpatterns = [
url(r'^user/callback$',
django_cas_ng.views.callback,
name='cas_ng_proxy_callback'),
url(r'', include('rex.urls')),
url(r'', include('backend.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# Generated by Django 2.0.3 on 2018-08-19 16:53
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import rex.utils.friendly_path
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Campus',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_main_campus', models.BooleanField()),
('name', models.CharField(max_length=200, null=True)),
('comment', models.TextField(blank=True, null=True)),
('lat', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-85.05112878), django.core.validators.MaxValueValidator(85.05112878)])),
('lon', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
],
),
migrations.CreateModel(
name='City',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('local_name', models.CharField(blank=True, max_length=200, null=True)),
('area', models.CharField(blank=True, max_length=200, null=True)),
],
),
migrations.CreateModel(
name='Country',
fields=[
('name', models.CharField(max_length=200)),
('iso_alpha2_code', models.CharField(max_length=2, primary_key=True, serialize=False)),
('iso_alpha3_code', models.CharField(max_length=3, unique=True)),
('region_name', models.CharField(max_length=200)),
('region_un_code', models.CharField(max_length=3)),
('sub_region_name', models.CharField(blank=True, max_length=200, null=True)),
('sub_region_un_code', models.CharField(blank=True, max_length=3, null=True)),
('intermediate_region_name', models.CharField(blank=True, max_length=200, null=True)),
('intermediate_region_un_code', models.CharField(blank=True, max_length=3, null=True)),
],
),
migrations.CreateModel(
name='University',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('acronym', models.CharField(blank=True, max_length=20, null=True)),
('logo', models.ImageField(default='path/to/my/default/image.jpg', max_length=250, upload_to=rex.utils.friendly_path.friendly_path('uploads/universities/logos/', 'name'))),
('website', models.URLField(null=True)),
],
options={
'abstract': False,
},
),
migrations.A