Commit e076627c authored by BERJON Matthieu's avatar BERJON Matthieu
Browse files

Reorganize the application tree



In order to follow good practices for a Django app development I
reorganized the tree.
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent 447562b2

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
# -*- coding: utf-8 -*-
""" Top-level package for Allgo. """
__version__ = '0.1.0'
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-03-23 16:42
# Generated by Django 1.11 on 2018-03-27 13:29
from __future__ import unicode_literals
from django.conf import settings
......@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='allgouser', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'allgo_user',
'db_table': 'dj_users',
},
),
migrations.CreateModel(
......@@ -38,7 +38,7 @@ class Migration(migrations.Migration):
('docker_name', models.CharField(blank=True, max_length=255)),
],
options={
'db_table': 'docker_os',
'db_table': 'dj_docker_os',
},
),
migrations.CreateModel(
......@@ -54,10 +54,10 @@ class Migration(migrations.Migration):
('access_token', models.CharField(blank=True, max_length=255, null=True)),
('state', models.IntegerField()),
('result', models.IntegerField()),
('container_id', models.IntegerField(blank=True, null=True)),
('dj_container_id', models.IntegerField(blank=True, null=True)),
],
options={
'db_table': 'jobs',
'db_table': 'dj_jobs',
},
),
migrations.CreateModel(
......@@ -71,7 +71,7 @@ class Migration(migrations.Migration):
('is_default', models.IntegerField()),
],
options={
'db_table': 'job_queues',
'db_table': 'dj_job_queues',
},
),
migrations.CreateModel(
......@@ -84,10 +84,10 @@ class Migration(migrations.Migration):
('job_file_content_type', models.CharField(blank=True, max_length=255)),
('job_file_file_size', models.IntegerField(blank=True, null=True)),
('job_file_updated_at', models.DateTimeField(auto_now_add=True, null=True)),
('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobuploadjob', to='poc.Job')),
('dj_job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobuploadjob', to='poc.Job')),
],
options={
'db_table': 'job_uploads',
'db_table': 'dj_job_uploads',
},
),
migrations.CreateModel(
......@@ -97,10 +97,10 @@ class Migration(migrations.Migration):
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('quantity', models.BigIntegerField(blank=True, null=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotauser', to=settings.AUTH_USER_MODEL)),
('dj_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotauser', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'quotas',
'db_table': 'dj_quotas',
},
),
migrations.CreateModel(
......@@ -116,7 +116,6 @@ class Migration(migrations.Migration):
('logo_content_type', models.CharField(blank=True, max_length=255, null=True)),
('logo_file_size', models.IntegerField(blank=True, null=True)),
('logo_updated_at', models.DateTimeField(blank=True, null=True)),
('user_other', models.IntegerField(blank=True, null=True)),
('default_quota', models.IntegerField(blank=True, null=True)),
('docker_name', models.CharField(blank=True, max_length=255)),
('readme', models.IntegerField(blank=True, null=True)),
......@@ -126,12 +125,12 @@ class Migration(migrations.Migration):
('access_token', models.CharField(blank=True, max_length=255, null=True)),
('sandbox_state', models.IntegerField(null=True)),
('memory_limit', models.BigIntegerField(blank=True, null=True)),
('dj_job_queue', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='webappjobqueue', to='poc.JobQueue')),
('docker_os', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='webappdockeros', to='poc.DockerOs')),
('job_queue', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='webappjobqueue', to='poc.JobQueue')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='webappuser', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'webapps',
'db_table': 'dj_webapps',
},
),
migrations.CreateModel(
......@@ -146,7 +145,7 @@ class Migration(migrations.Migration):
('webapp', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='webappparameters', to='poc.Webapp')),
],
options={
'db_table': 'webapp_parameters',
'db_table': 'dj_webapp_parameters',
},
),
migrations.CreateModel(
......@@ -160,30 +159,30 @@ class Migration(migrations.Migration):
('docker_image_size', models.FloatField(blank=True, null=True)),
('state', models.IntegerField(null=True)),
('published', models.IntegerField()),
('webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='webappversion', to='poc.Webapp')),
('dj_webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='webappversion', to='poc.Webapp')),
],
options={
'db_table': 'webapp_versions',
'db_table': 'dj_webapp_versions',
},
),
migrations.AddField(
model_name='quota',
name='webapp',
name='dj_webapp',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotawebapp', to='poc.Webapp'),
),
migrations.AddField(
model_name='job',
name='queue',
name='dj_queue',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobqueue', to='poc.JobQueue'),
),
migrations.AddField(
model_name='job',
name='user',
name='dj_user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobuser', to='poc.AllgoUser'),
),
migrations.AddField(
model_name='job',
name='webapp',
name='dj_webapp',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobwebapp', to='poc.Webapp'),
),
]
"""
Django settings for allgo project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'hv@@v0dt@@1^bhjbt!r0ovyz&4-+fj099825+tr4y)y5d#kely'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'poc',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'allgo.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'allgo.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'allgo',
'USER': 'allgo',
'HOST': 'localhost',
}
}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
# COMPRESS_ENABLED = True
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
# STATICFILES_FINDERS = (
# 'django.contrib.staticfiles.finders.FileSystemFinder',
# 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#
# 'compressor.finders.CompressorFinder',
# )
#
# COMPRESS_PRECOMPILERS = (
# ('text/x-scss', 'django_libsass.SassCompiler'),
# )
LOGIN_REDIRECT_URL = 'poc_home'
LOGOUT_REDIRECT_URL = 'poc_home'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment