diff --git a/ippisite/db.sqlite3 b/ippisite/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..d7af3c51bb79c322ce6fc7f3abdf063b5e007092 Binary files /dev/null and b/ippisite/db.sqlite3 differ diff --git a/ippisite/ippidb/__init__.py b/ippisite/ippidb/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ippisite/ippidb/admin.py b/ippisite/ippidb/admin.py new file mode 100644 index 0000000000000000000000000000000000000000..c4cbdb9209e9642c46c21d8e4c64b13939482be4 --- /dev/null +++ b/ippisite/ippidb/admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin + +from .models import Bibliography + +admin.site.register(Bibliography) diff --git a/ippisite/ippidb/apps.py b/ippisite/ippidb/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..14866c2805c3929882ae2537078fd701b84cf9e5 --- /dev/null +++ b/ippisite/ippidb/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class IppidbConfig(AppConfig): + name = 'ippidb' diff --git a/ippisite/ippidb/migrations/0001_initial.py b/ippisite/ippidb/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..fa2e4ae08f7a4fd81e287daf2707caa38b8b1efe --- /dev/null +++ b/ippisite/ippidb/migrations/0001_initial.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-02-14 11:12 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Bibliography', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('source', models.CharField(choices=[('PM', 'PubMed article'), ('PT', 'Patent')], max_length=2, verbose_name='Bibliographic type')), + ('id_source', models.CharField(max_length=25, verbose_name='Bibliographic ID')), + ('title', models.CharField(max_length=300, verbose_name='Title')), + ('journal_name', models.CharField(max_length=50, verbose_name='Journal name')), + ('authors_list', models.CharField(max_length=500, verbose_name='Authors list')), + ('biblio_year', models.PositiveSmallIntegerField(verbose_name='Year')), + ('cytotox', models.BooleanField(verbose_name='Cytotoxicity data')), + ('in_silico', models.BooleanField(verbose_name='in silico study performed')), + ('in_vitro', models.BooleanField(verbose_name='in vitro study performed')), + ('in_vivo', models.BooleanField(verbose_name='in vivo study performed')), + ('in_cellulo', models.BooleanField(verbose_name='in cellulo study performed')), + ('pharmacokinetic', models.BooleanField(verbose_name='pharmacokinetic study performed')), + ('xray', models.BooleanField(verbose_name='contains xray data')), + ], + ), + migrations.CreateModel( + name='BindingSite', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + ), + migrations.CreateModel( + name='Complex', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('copy_nb', models.IntegerField(verbose_name='Number of copies')), + ], + ), + migrations.CreateModel( + name='Domain', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('pfam_acc', models.CharField(max_length=10, unique=True, verbose_name='Pfam Accession')), + ('pfam_id', models.CharField(max_length=20, verbose_name='Pfam Family Identifier')), + ('pfam_description', models.CharField(max_length=100, verbose_name='Pfam Description')), + ('domainfamily', models.CharField(max_length=25, verbose_name='')), + ], + ), + migrations.CreateModel( + name='MolecularFunction', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('go_id', models.CharField(max_length=10, unique=True, verbose_name='Gene Ontology ID')), + ('description', models.CharField(max_length=500, verbose_name='description')), + ], + ), + migrations.CreateModel( + name='Ppi', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('binding_site_id_1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='binding_site_id_1', to='ippidb.BindingSite')), + ('binding_site_id_2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='binding_site_id_2', to='ippidb.BindingSite')), + ('complex_id_1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cplx_id_1', to='ippidb.Complex')), + ('complex_id_2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cplx_id_2', to='ippidb.Complex')), + ], + ), + migrations.CreateModel( + name='PpiArchitecture', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('pdb_id', models.CharField(max_length=4, verbose_name='PDB ID')), + ('ppi_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ippidb.Ppi')), + ], + ), + migrations.CreateModel( + name='Protein', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('uniprot_id', models.CharField(max_length=10, unique=True, verbose_name='Uniprot ID')), + ('recommended_name_long', models.CharField(max_length=75, verbose_name='Uniprot Recommended Name (long)')), + ('short_name', models.CharField(max_length=50, verbose_name='Short name')), + ('gene_name', models.CharField(max_length=30, unique=True, verbose_name='Gene name')), + ('entry_name', models.CharField(max_length=30, verbose_name='Entry name')), + ('molecular_functions', models.ManyToManyField(to='ippidb.MolecularFunction')), + ], + ), + migrations.CreateModel( + name='Taxonomy', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('taxonomy_id', models.DecimalField(decimal_places=0, max_digits=4, unique=True, verbose_name='NCBI TaxID')), + ('name', models.CharField(max_length=200, verbose_name='Organism name')), + ], + ), + migrations.AddField( + model_name='protein', + name='organism', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ippidb.Taxonomy'), + ), + migrations.AddField( + model_name='complex', + name='protein_id', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ippidb.Protein'), + ), + migrations.AddField( + model_name='bindingsite', + name='domain_id', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ippidb.Domain'), + ), + migrations.AddField( + model_name='bindingsite', + name='protein_id', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ippidb.Protein'), + ), + ] diff --git a/ippisite/ippidb/migrations/__init__.py b/ippisite/ippidb/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ippisite/ippidb/models.py b/ippisite/ippidb/models.py new file mode 100644 index 0000000000000000000000000000000000000000..661967d8b8c1f3d1ce2541097e61a5e3f0225551 --- /dev/null +++ b/ippisite/ippidb/models.py @@ -0,0 +1,469 @@ +from __future__ import unicode_literals + +from django.db import models +from django.forms import ModelForm + +class Bibliography(models.Model): + """ + Bibliography data table + """ + SOURCES = ( + ('PM', 'PubMed article'), + ('PT', 'Patent') + ) + source = models.CharField('Bibliographic type', max_length=2, choices=SOURCES) + id_source = models.CharField('Bibliographic ID', max_length=25) + title = models.CharField('Title', max_length=300) + journal_name = models.CharField('Journal name', max_length=50) + authors_list = models.CharField('Authors list', max_length=500) + biblio_year = models.PositiveSmallIntegerField('Year') + cytotox = models.BooleanField('Cytotoxicity data') + in_silico = models.BooleanField('in silico study performed') + in_vitro = models.BooleanField('in vitro study performed') + in_vivo = models.BooleanField('in vivo study performed') + in_cellulo = models.BooleanField('in cellulo study performed') + pharmacokinetic = models.BooleanField('pharmacokinetic study performed') + xray = models.BooleanField('contains xray data') + + def get_absolute_url(self): + return reverse('bibliography-detail', args=[str(self.id)]) + + def save(self, *args, **kwargs): + pubmed_info = get_pubmed_info(self.id_source) + self.title = pubmed_info['title'] + self.journal_name = pubmed_info['journal_name'] + self.authors_list = pubmed_info['authors_list'] + self.biblio_year = pubmed_info['biblio_year'] + super(Bibliography, self).save(*args, **kwargs) + +class BibliographyForm(ModelForm): + class Meta: + model = Bibliography + fields = '__all__' + +class Taxonomy(models.Model): + taxonomy_id = models.DecimalField('NCBI TaxID', unique=True, max_digits=4, decimal_places=0) + name = models.CharField('Organism name', max_length=200) + +class MolecularFunction(models.Model): + go_id = models.CharField('Gene Ontology ID', unique=True, max_length=10) # GO term id format: 'GO:0000000' + description = models.CharField('description', max_length=500) + +class Protein(models.Model): + uniprot_id = models.CharField('Uniprot ID', unique=True, max_length=10) + recommended_name_long = models.CharField('Uniprot Recommended Name (long)', max_length=75) + short_name = models.CharField('Short name', max_length=50) + gene_name = models.CharField('Gene name', unique=True, max_length=30) + entry_name = models.CharField('Entry name', max_length=30) + organism = models.ForeignKey('Taxonomy') + molecular_functions = models.ManyToManyField(MolecularFunction) + +class Domain(models.Model): + pfam_acc = models.CharField('Pfam Accession', max_length=10, unique=True) + pfam_id = models.CharField('Pfam Family Identifier', max_length=20) + pfam_description = models.CharField('Pfam Description', max_length=100) + domainfamily = models.CharField('', max_length=25) #TODO: what is this field? check database contents + +class BindingSite(models.Model): + protein_id = models.ForeignKey('Protein') + domain_id = models.ForeignKey('Domain') + +class Complex(models.Model): + protein_id = models.ForeignKey('Protein') + copy_nb = models.IntegerField('Number of copies') + +class Ppi(models.Model): + complex_id_1 = models.ForeignKey(Complex, related_name='cplx_id_1') + complex_id_2 = models.ForeignKey(Complex, related_name='cplx_id_2') + binding_site_id_1 = models.ForeignKey(BindingSite, related_name='binding_site_id_1') + binding_site_id_2 = models.ForeignKey(BindingSite, related_name='binding_site_id_2') + +class PpiArchitecture(models.Model): + ppi_id = models.ForeignKey(Ppi) + pdb_id = models.CharField('PDB ID', max_length=4) + +""" + + + + + +class Actionevidencetest(models.Model): + idcmpdaction = models.ForeignKey('Cmpdaction', models.DO_NOTHING, db_column='IDCmpdAction') # Field name made lowercase. + idtestactivity = models.ForeignKey('Testactivitydescription', models.DO_NOTHING, db_column='IDTestActivity') # Field name made lowercase. + nbcopycompound = models.IntegerField(db_column='NbCopyCompound', blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'actionEvidenceTest' + unique_together = (('idcmpdaction', 'idtestactivity'),) + + +class Actionevidencexray(models.Model): + idcmpdaction = models.ForeignKey('Cmpdaction', models.DO_NOTHING, db_column='IDCmpdAction') # Field name made lowercase. + codepdb = models.CharField(db_column='CodePDB', max_length=4) # Field name made lowercase. + nbcopycompound = models.IntegerField(db_column='NbCopyCompound') # Field name made lowercase. + idbindingsite = models.ForeignKey('Bindingsite', models.DO_NOTHING, db_column='IDBindingSite') # Field name made lowercase. + idbiblio = models.ForeignKey('Biblio', models.DO_NOTHING, db_column='IDBiblio', blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'actionEvidenceXRay' + unique_together = (('idcmpdaction', 'codepdb'),) + + +class Biblio(models.Model): + idbiblio = models.AutoField(db_column='IDBiblio', primary_key=True) # Field name made lowercase. + source = models.CharField(db_column='Source', max_length=7) # Field name made lowercase. + idsource = models.CharField(db_column='IDSource', max_length=25) # Field name made lowercase. + title = models.CharField(db_column='Title', max_length=300) # Field name made lowercase. + listauthor = models.CharField(db_column='ListAuthor', max_length=500) # Field name made lowercase. + yearbiblio = models.IntegerField(db_column='YearBiblio') # Field name made lowercase. + cytotox = models.CharField(db_column='Cytotox', max_length=1) # Field name made lowercase. + insilico = models.CharField(db_column='InSilico', max_length=1) # Field name made lowercase. + invitro = models.CharField(db_column='InVitro', max_length=1) # Field name made lowercase. + invivo = models.CharField(db_column='InVivo', max_length=1) # Field name made lowercase. + incellulo = models.CharField(db_column='InCellulo', max_length=1) # Field name made lowercase. + pharmacokinetic = models.CharField(db_column='Pharmacokinetic', max_length=1) # Field name made lowercase. + xray = models.CharField(db_column='XRay', max_length=1) # Field name made lowercase. + journalname = models.CharField(db_column='JournalName', max_length=50, blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'biblio' + unique_together = (('source', 'idsource'),) + + +class Bindingsite(models.Model): + idbindingsite = models.IntegerField(db_column='IDBindingSite') # Field name made lowercase. + idprotein = models.ForeignKey('Protein', models.DO_NOTHING, db_column='IDProtein') # Field name made lowercase. + iddomain = models.ForeignKey('Domain', models.DO_NOTHING, db_column='IDDomain') # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'bindingSite' + unique_together = (('idbindingsite', 'idprotein', 'iddomain'),) + + +class Bindingsiteevidence(models.Model): + idppi = models.ForeignKey('Ppi', models.DO_NOTHING, db_column='IDPPI') # Field name made lowercase. + idbindingsite = models.ForeignKey(Bindingsite, models.DO_NOTHING, db_column='IDBindingSite') # Field name made lowercase. + codepdb = models.CharField(db_column='CodePDB', max_length=4) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'bindingSiteEvidence' + unique_together = (('idppi', 'idbindingsite'),) + + +class Cmpdaction(models.Model): + idcmpdaction = models.AutoField(db_column='IDCmpdAction', primary_key=True) # Field name made lowercase. + idcomplexebound = models.ForeignKey('Complexe', models.DO_NOTHING, db_column='IDComplexeBound') # Field name made lowercase. + idcompound = models.ForeignKey('Compound', models.DO_NOTHING, db_column='IDCompound') # Field name made lowercase. + activationmode = models.CharField(db_column='ActivationMode', max_length=11) # Field name made lowercase. + modulationtype = models.CharField(db_column='ModulationType', max_length=10) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'cmpdAction' + + +class Cmpdactiveresult(models.Model): + idcompound = models.ForeignKey('Compound', models.DO_NOTHING, db_column='IDCompound') # Field name made lowercase. + idtestactivity = models.ForeignKey('Testactivitydescription', models.DO_NOTHING, db_column='IDTestActivity') # Field name made lowercase. + activitytype = models.CharField(db_column='ActivityType', max_length=5) # Field name made lowercase. + activity = models.DecimalField(db_column='Activity', max_digits=4, decimal_places=2) # Field name made lowercase. + pourcentinhib = models.IntegerField(db_column='PourcentInhib', blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'cmpdActiveResult' + unique_together = (('idcompound', 'idtestactivity', 'activitytype'),) + + +class Cmpdcytotoxresult(models.Model): + idcompound = models.ForeignKey('Compound', models.DO_NOTHING, db_column='IDCompound') # Field name made lowercase. + idtestcytotox = models.ForeignKey('Testcytotoxdescription', models.DO_NOTHING, db_column='IDTestCytotox') # Field name made lowercase. + toxicity = models.CharField(db_column='Toxicity', max_length=1) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'cmpdCytotoxResult' + unique_together = (('idcompound', 'idtestcytotox'),) + + +class Cmpdinactiveresult(models.Model): + idtestactivity = models.ForeignKey('Testactivitydescription', models.DO_NOTHING, db_column='IDTestActivity') # Field name made lowercase. + idcompound = models.ForeignKey('Compound', models.DO_NOTHING, db_column='IDCompound') # Field name made lowercase. + pourcentinhib = models.IntegerField(db_column='PourcentInhib', blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'cmpdInactiveResult' + unique_together = (('idtestactivity', 'idcompound'),) + + +class Cmpdpkresult(models.Model): + idcompound = models.ForeignKey('Compound', models.DO_NOTHING, db_column='IDCompound') # Field name made lowercase. + idtestpk = models.ForeignKey('Testpkdescription', models.DO_NOTHING, db_column='IDTestPK') # Field name made lowercase. + tolerated = models.CharField(db_column='Tolerated', max_length=1) # Field name made lowercase. + auc = models.IntegerField(db_column='AUC', blank=True, null=True) # Field name made lowercase. + clearance = models.DecimalField(db_column='Clearance', max_digits=7, decimal_places=3, blank=True, null=True) # Field name made lowercase. + cmax = models.DecimalField(db_column='Cmax', max_digits=7, decimal_places=3, blank=True, null=True) # Field name made lowercase. + oralbioavailability = models.IntegerField(db_column='OralBioavailability', blank=True, null=True) # Field name made lowercase. + tdemi = models.IntegerField(db_column='Tdemi', blank=True, null=True) # Field name made lowercase. + tmax = models.IntegerField(db_column='Tmax', blank=True, null=True) # Field name made lowercase. + voldistribution = models.DecimalField(db_column='VolDistribution', max_digits=5, decimal_places=2, blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'cmpdPKResult' + unique_together = (('idcompound', 'idtestpk'),) + + +class Complexe(models.Model): + idcomplexe = models.AutoField(db_column='IDComplexe', primary_key=True) # Field name made lowercase. + idprotein = models.ForeignKey('Protein', models.DO_NOTHING, db_column='IDProtein') # Field name made lowercase. + nbcopy = models.IntegerField(db_column='NbCopy') # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'complexe' + + +class Compound(models.Model): + idcompound = models.AutoField(db_column='IDCompound', primary_key=True) # Field name made lowercase. + canonicalsmile = models.CharField(db_column='CanonicalSmile', unique=True, max_length=250) # Field name made lowercase. + physchemfilter = models.CharField(db_column='PhysChemFilter', max_length=2) # Field name made lowercase. + htsfilter = models.CharField(db_column='HTSFilter', max_length=1) # Field name made lowercase. + ismacrocycle = models.CharField(db_column='IsMacrocycle', max_length=1) # Field name made lowercase. + aromaticratio = models.DecimalField(db_column='AromaticRatio', max_digits=3, decimal_places=2) # Field name made lowercase. + balabanindex = models.DecimalField(db_column='BalabanIndex', max_digits=3, decimal_places=2) # Field name made lowercase. + csp3ratio = models.DecimalField(db_column='Csp3Ratio', max_digits=3, decimal_places=2) # Field name made lowercase. + dhpetitjean = models.DecimalField(db_column='DhPetitjean', max_digits=4, decimal_places=2) # Field name made lowercase. + diamgraphnonhpetitjean = models.IntegerField(db_column='DiamGraphNonHPetitjean') # Field name made lowercase. + gcmolarrefractivity = models.DecimalField(db_column='GCMolarRefractivity', max_digits=5, decimal_places=2) # Field name made lowercase. + gpetitjean = models.DecimalField(db_column='GPetitjean', max_digits=3, decimal_places=2) # Field name made lowercase. + igpetitjean = models.DecimalField(db_column='IgPetitjean', max_digits=3, decimal_places=2) # Field name made lowercase. + logd = models.DecimalField(db_column='LogD', max_digits=4, decimal_places=2) # Field name made lowercase. + alogp = models.DecimalField(db_column='ALogP', max_digits=4, decimal_places=2) # Field name made lowercase. + meanatomvolvdw = models.DecimalField(db_column='MeanAtomVolVdW', max_digits=4, decimal_places=2) # Field name made lowercase. + molecularweight = models.DecimalField(db_column='MolecularWeight', max_digits=6, decimal_places=2) # Field name made lowercase. + nbacceptorh = models.IntegerField(db_column='NbAcceptorH') # Field name made lowercase. + nbaliphaticsamines = models.IntegerField(db_column='NbAliphaticsAmines') # Field name made lowercase. + nbaromaticbonds = models.IntegerField(db_column='NbAromaticBonds') # Field name made lowercase. + nbaromaticsether = models.IntegerField(db_column='NbAromaticsEther') # Field name made lowercase. + nbaromaticssssr = models.IntegerField(db_column='NbAromaticsSSSR') # Field name made lowercase. + nbatom = models.IntegerField(db_column='NbAtom') # Field name made lowercase. + nbatomnonh = models.IntegerField(db_column='NbAtomNonH') # Field name made lowercase. + nbbenzlikerings = models.IntegerField(db_column='NbBenzLikeRings') # Field name made lowercase. + nbbonds = models.IntegerField(db_column='NbBonds') # Field name made lowercase. + nbbondsnonh = models.IntegerField(db_column='NbBondsNonH') # Field name made lowercase. + nbbr = models.IntegerField(db_column='NbBr') # Field name made lowercase. + nbc = models.IntegerField(db_column='NbC') # Field name made lowercase. + nbchiralcenters = models.IntegerField(db_column='NbChiralCenters') # Field name made lowercase. + nbcircuits = models.IntegerField(db_column='NbCircuits') # Field name made lowercase. + nbcl = models.IntegerField(db_column='NbCl') # Field name made lowercase. + nbcsp2 = models.IntegerField(db_column='NbCsp2') # Field name made lowercase. + nbcsp3 = models.IntegerField(db_column='NbCsp3') # Field name made lowercase. + nbdonorh = models.IntegerField(db_column='NbDonorH') # Field name made lowercase. + nbdoublebonds = models.IntegerField(db_column='NbDoubleBonds') # Field name made lowercase. + nbf = models.IntegerField(db_column='NbF') # Field name made lowercase. + nbi = models.IntegerField(db_column='NbI') # Field name made lowercase. + nbmultbonds = models.IntegerField(db_column='NbMultBonds') # Field name made lowercase. + nbn = models.IntegerField(db_column='NbN') # Field name made lowercase. + nbo = models.IntegerField(db_column='NbO') # Field name made lowercase. + nbrings = models.IntegerField(db_column='NbRings') # Field name made lowercase. + nbrotatablebonds = models.IntegerField(db_column='NbRotatableBonds') # Field name made lowercase. + radiusgraphnonhpetitjean = models.IntegerField(db_column='RadiusGraphNonHPetitjean') # Field name made lowercase. + randicindex = models.DecimalField(db_column='RandicIndex', max_digits=4, decimal_places=2) # Field name made lowercase. + rdf070m = models.DecimalField(db_column='RDF070m', max_digits=5, decimal_places=2) # Field name made lowercase. + rotatablebondfraction = models.DecimalField(db_column='RotatableBondFraction', max_digits=3, decimal_places=2) # Field name made lowercase. + sumatompolar = models.DecimalField(db_column='SumAtomPolar', max_digits=5, decimal_places=2) # Field name made lowercase. + sumatomvolvdw = models.DecimalField(db_column='SumAtomVolVdW', max_digits=6, decimal_places=2) # Field name made lowercase. + surfacevdwpetitjean = models.DecimalField(db_column='SurfaceVDWPetitjean', max_digits=6, decimal_places=2) # Field name made lowercase. + thicknesspetitjean = models.DecimalField(db_column='ThicknessPetitjean', max_digits=4, decimal_places=2) # Field name made lowercase. + tpsa = models.DecimalField(db_column='TPSA', max_digits=5, decimal_places=2) # Field name made lowercase. + ui = models.DecimalField(db_column='Ui', max_digits=4, decimal_places=2) # Field name made lowercase. + volvdwpetitjean = models.DecimalField(db_column='VolVDWPetitjean', max_digits=7, decimal_places=2) # Field name made lowercase. + wienerindex = models.IntegerField(db_column='WienerIndex') # Field name made lowercase. + cmpdnamesh = models.CharField(db_column='CmpdNameSh', max_length=20, blank=True, null=True) # Field name made lowercase. + idpubchem = models.CharField(db_column='IdPubchem', max_length=10, blank=True, null=True) # Field name made lowercase. + idchemspider = models.CharField(db_column='IdChemspider', max_length=10, blank=True, null=True) # Field name made lowercase. + idchembl = models.CharField(db_column='IDChembl', max_length=30, blank=True, null=True) # Field name made lowercase. + cmpdiupacname = models.CharField(db_column='CmpdIUPACName', max_length=255, blank=True, null=True) # Field name made lowercase. + idmddrcompound = models.ForeignKey('Mddrcompound', models.DO_NOTHING, db_column='IDMDDRCompound', blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'compound' + + +class Disease(models.Model): + idppi = models.ForeignKey('Ppi', models.DO_NOTHING, db_column='IDPPI') # Field name made lowercase. + disease = models.CharField(db_column='Disease', max_length=30) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'disease' + unique_together = (('idppi', 'disease'),) + + +class DjangoMigrations(models.Model): + app = models.CharField(max_length=255) + name = models.CharField(max_length=255) + applied = models.DateTimeField() + + class Meta: +# managed = False + db_table = 'django_migrations' + + +class Domain(models.Model): + iddomain = models.AutoField(db_column='IDDomain', primary_key=True) # Field name made lowercase. + pfamid = models.CharField(db_column='PfamID', max_length=20) # Field name made lowercase. + pfamnumaccession = models.CharField(db_column='PfamNumAccession', unique=True, max_length=10) # Field name made lowercase. + domaindescription = models.CharField(db_column='DomainDescription', max_length=100) # Field name made lowercase. + domainfamily = models.CharField(db_column='DomainFamily', max_length=25) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'domain' + + +class Mddrcmpdactclass(models.Model): + idmddrcompound = models.ForeignKey('Mddrcompound', models.DO_NOTHING, db_column='IDMDDRCompound') # Field name made lowercase. + activityclass = models.CharField(db_column='ActivityClass', max_length=60) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'mDDRCmpdActClass' + unique_together = (('idmddrcompound', 'activityclass'),) + + +class Mddrcompound(models.Model): + idmddrcompound = models.IntegerField(db_column='IDMDDRCompound') # Field name made lowercase. + mddrcmpdname = models.CharField(db_column='MDDRCmpdName', max_length=40) # Field name made lowercase. + phasedvpmt = models.CharField(db_column='PhaseDvpmt', max_length=20) # Field name made lowercase. + canonicalsmile = models.CharField(db_column='CanonicalSmile', max_length=500, blank=True, null=True) # Field name made lowercase. + versionmddr = models.CharField(db_column='VersionMDDR', max_length=7) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'mDDRCompound' + unique_together = (('idmddrcompound', 'mddrcmpdname', 'phasedvpmt'),) + + +class Mddrsimilarity(models.Model): + idcompound = models.ForeignKey(Compound, models.DO_NOTHING, db_column='IDCompound') # Field name made lowercase. + idmddrcompound = models.ForeignKey(Mddrcompound, models.DO_NOTHING, db_column='IDMDDRCompound') # Field name made lowercase. + versionmddr = models.CharField(db_column='VersionMDDR', max_length=7) # Field name made lowercase. + tanimoto = models.DecimalField(db_column='Tanimoto', max_digits=6, decimal_places=5) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'mDDRSimilarity' + unique_together = (('idcompound', 'idmddrcompound', 'versionmddr'),) + + +class Ppi(models.Model): + idppi = models.AutoField(db_column='IDPPI', primary_key=True) # Field name made lowercase. + idcomplexe1 = models.ForeignKey(Complexe, models.DO_NOTHING, db_column='IDComplexe1', related_name='cplx_id_1') # Field name made lowercase. + idcomplexe2 = models.ForeignKey(Complexe, models.DO_NOTHING, db_column='IDComplexe2', related_name='cplx_id_2') # Field name made lowercase. + idbindingsite1 = models.ForeignKey(Bindingsite, models.DO_NOTHING, db_column='IDBindingSite1', related_name='bs_id_1') # Field name made lowercase. + idbindingsite2 = models.ForeignKey(Bindingsite, models.DO_NOTHING, db_column='IDBindingSite2', related_name='bs_id_2') # Field name made lowercase. + family = models.CharField(db_column='Family', max_length=25) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'ppi' + unique_together = (('idcomplexe1', 'idcomplexe2', 'idbindingsite1', 'idbindingsite2'),) + + +class Protein(models.Model): + idprotein = models.AutoField(db_column='IDProtein', primary_key=True) # Field name made lowercase. + numuniprot = models.CharField(db_column='NumUniprot', unique=True, max_length=10) # Field name made lowercase. + protnamelg = models.CharField(db_column='ProtNameLg', max_length=75) # Field name made lowercase. + protnamesh = models.CharField(db_column='ProtNameSh', max_length=50) # Field name made lowercase. + protalias = models.CharField(db_column='ProtAlias', unique=True, max_length=30) # Field name made lowercase. + protnamesp = models.CharField(db_column='ProtNameSp', max_length=30) # Field name made lowercase. + organism = models.CharField(db_column='Organism', max_length=80) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'protein' + + +class Refcmpdbiblio(models.Model): + idcompound = models.ForeignKey(Compound, models.DO_NOTHING, db_column='IDCompound') # Field name made lowercase. + idbiblio = models.ForeignKey(Biblio, models.DO_NOTHING, db_column='IDBiblio') # Field name made lowercase. + cmpdnameinbiblio = models.CharField(db_column='CmpdNameInBiblio', max_length=20, blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'refCmpdBiblio' + unique_together = (('idcompound', 'idbiblio'),) + + +class Refproteinfonction(models.Model): + idprotein = models.ForeignKey(Protein, models.DO_NOTHING, db_column='IDProtein') # Field name made lowercase. + protfonctionsp = models.CharField(db_column='ProtFonctionSP', max_length=200) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'refProteinFonction' + unique_together = (('protfonctionsp', 'idprotein'),) + + +class Testactivitydescription(models.Model): + idtestactivity = models.AutoField(db_column='IDTestActivity', primary_key=True) # Field name made lowercase. + idcomplexebound = models.ForeignKey(Complexe, models.DO_NOTHING, db_column='IDComplexeBound') # Field name made lowercase. + idbiblio = models.ForeignKey(Biblio, models.DO_NOTHING, db_column='IDBiblio') # Field name made lowercase. + idppi = models.ForeignKey(Ppi, models.DO_NOTHING, db_column='IDPPI', blank=True, null=True) # Field name made lowercase. + testnameactivity = models.CharField(db_column='TestNameActivity', max_length=40) # Field name made lowercase. + isprimary = models.CharField(db_column='IsPrimary', max_length=1) # Field name made lowercase. + protboundconstruct = models.CharField(db_column='ProtBoundConstruct', max_length=11) # Field name made lowercase. + testtype = models.CharField(db_column='TestType', max_length=5) # Field name made lowercase. + testmodulationtype = models.CharField(db_column='TestModulationType', max_length=13) # Field name made lowercase. + nbactivescmpdstot = models.IntegerField(db_column='NbActivesCmpdsTot') # Field name made lowercase. + conccmpds = models.DecimalField(db_column='ConcCmpds', max_digits=7, decimal_places=3, blank=True, null=True) # Field name made lowercase. + protocol = models.TextField(db_column='Protocol', blank=True, null=True) # Field name made lowercase. + concproteinbound = models.DecimalField(db_column='ConcProteinBound', max_digits=7, decimal_places=3, blank=True, null=True) # Field name made lowercase. + concprotein2 = models.DecimalField(db_column='ConcProtein2', max_digits=7, decimal_places=3, blank=True, null=True) # Field name made lowercase. + controlepos = models.CharField(db_column='ControlePos', max_length=50, blank=True, null=True) # Field name made lowercase. + controleneg = models.CharField(db_column='ControleNeg', max_length=50, blank=True, null=True) # Field name made lowercase. + cellline = models.CharField(db_column='CellLine', max_length=50, blank=True, null=True) # Field name made lowercase. + pepseq = models.CharField(db_column='PepSeq', max_length=100, blank=True, null=True) # Field name made lowercase. + marker = models.CharField(db_column='Marker', max_length=35, blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'testActivityDescription' + + +class Testcytotoxdescription(models.Model): + idtestcytotox = models.AutoField(db_column='IDTestCytotox', primary_key=True) # Field name made lowercase. + idbiblio = models.ForeignKey(Biblio, models.DO_NOTHING, db_column='IDBiblio') # Field name made lowercase. + testnamecytotox = models.CharField(db_column='TestNameCytotox', max_length=40) # Field name made lowercase. + cellline = models.CharField(db_column='CellLine', max_length=50) # Field name made lowercase. + conccmpd = models.DecimalField(db_column='ConcCmpd', max_digits=7, decimal_places=3, blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'testCytotoxDescription' + + +class Testpkdescription(models.Model): + idtestpk = models.AutoField(db_column='IDTestPK', primary_key=True) # Field name made lowercase. + idbiblio = models.ForeignKey(Biblio, models.DO_NOTHING, db_column='IDBiblio') # Field name made lowercase. + testnamepk = models.CharField(db_column='TestNamePK', max_length=40) # Field name made lowercase. + animal = models.CharField(db_column='Animal', max_length=100) # Field name made lowercase. + administrationmode = models.CharField(db_column='AdministrationMode', max_length=2, blank=True, null=True) # Field name made lowercase. + concentration = models.DecimalField(db_column='Concentration', max_digits=7, decimal_places=3, blank=True, null=True) # Field name made lowercase. + dose = models.DecimalField(db_column='Dose', max_digits=7, decimal_places=2, blank=True, null=True) # Field name made lowercase. + doseinterval = models.IntegerField(db_column='DoseInterval', blank=True, null=True) # Field name made lowercase. + + class Meta: +# managed = False + db_table = 'testPKDescription' +""" diff --git a/ippisite/ippidb/templates/base.html b/ippisite/ippidb/templates/base.html new file mode 100644 index 0000000000000000000000000000000000000000..14a3dd0086dd75710258b0fb67e4e7f9a5bfba74 --- /dev/null +++ b/ippisite/ippidb/templates/base.html @@ -0,0 +1,36 @@ +{% load bootstrap3 %} +<!DOCTYPE html> +<html lang="en"> +<head> + <link rel="stylesheet" href="{% bootstrap_css_url %}" /> + <title>IPPI-DB Maintenance {% block title %}{% endblock %}</title> +</head> + +<body> + <nav class="navbar navbar-default"> + <div class="container-fluid"> + <!-- Brand and toggle get grouped for better mobile display --> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="#">IPPI-DB</a> + </div> + + <!-- Collect the nav links, forms, and other content for toggling --> + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> + <ul class="nav navbar-nav"> + <li class="active"><a href="/ippidb/biblio/">Bibliographic references list<span class="sr-only">(current)</span></a></li> + <li><a href="/ippidb/biblio/add/">Add a new bibliographic reference<span class="sr-only">(current)</span></a></li> + </ul> + </div><!-- /.navbar-collapse --> + </div><!-- /.container-fluid --> + </nav> + <div id="content"> + {% block content %}{% endblock %} + </div> +</body> +</html> diff --git a/ippisite/ippidb/templates/ippidb/bibliography_detail.html b/ippisite/ippidb/templates/ippidb/bibliography_detail.html new file mode 100644 index 0000000000000000000000000000000000000000..16ae53bf8d16a39b963b58eddecc244ea46021b9 --- /dev/null +++ b/ippisite/ippidb/templates/ippidb/bibliography_detail.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% block title %}- biblio detail for {{object.title}} by {{object.authors_list}}{% endblock %} + +{% block content %} + <p>{{ object.get_source_display }}</p> + <p>{{ object.id_source}}</p> + <p>{{ object.title }}</p> + <p>{{ object.journal_name }}</p> + <p>{{ object.authors_list }}</p> + <p>{{ object.biblio_year }}</p> + <p>{{ object.cytotox }}</p> + <p>{{ object.in_silico }}</p> + <p>{{ object.in_vitro }}</p> + <p>{{ object.in_vivo }}</p> + <p>{{ object.in_cellulo }}</p> + <p>{{ object.pharmacokinetic }}</p> + <p>{{ object.xray }}</p> +{% endblock %} diff --git a/ippisite/ippidb/templates/ippidb/bibliography_form.html b/ippisite/ippidb/templates/ippidb/bibliography_form.html new file mode 100644 index 0000000000000000000000000000000000000000..a398e6ae18582c9499a3ab45ca1b564fc9415a43 --- /dev/null +++ b/ippisite/ippidb/templates/ippidb/bibliography_form.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% load bootstrap3 %} + +{% block title %}- biblio edition{% endblock %} + +{% block content %} + {% csrf_token %} + {% bootstrap_form form %} + <input type="submit" name="submit" value="Save" /> +{% endblock %} diff --git a/ippisite/ippidb/templates/ippidb/bibliography_list.html b/ippisite/ippidb/templates/ippidb/bibliography_list.html new file mode 100644 index 0000000000000000000000000000000000000000..c19d5653e2d007a8126900c0e8c393f62ba982a7 --- /dev/null +++ b/ippisite/ippidb/templates/ippidb/bibliography_list.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block title %}- biblios list{% endblock %} + +{% block content %} + {% for biblio in object_list %} + <li><a href="{{biblio.get_absolute_url}}">{{ biblio.get_source_display }} {{ biblio.id_source}} - {{ biblio.title }}</a></li> + {% empty %} + <li>No articles yet.</li> + {% endfor %} +{% endblock %} diff --git a/ippisite/ippidb/tests.py b/ippisite/ippidb/tests.py new file mode 100644 index 0000000000000000000000000000000000000000..7ce503c2dd97ba78597f6ff6e4393132753573f6 --- /dev/null +++ b/ippisite/ippidb/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/ippisite/ippidb/urls.py b/ippisite/ippidb/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..06e4b1304e673e4fccd05d71be4cf0af7034eb26 --- /dev/null +++ b/ippisite/ippidb/urls.py @@ -0,0 +1,11 @@ +from django.conf.urls import url + +from .views import BibliographyCreate, BibliographyUpdate, BibliographyDelete, BibliographyDetail, BibliographyList + +urlpatterns = [ + url(r'biblio/$', BibliographyList.as_view(), name='list'), + url(r'biblio/add/$', BibliographyCreate.as_view(), name='biblio-add'), + url(r'biblio/(?P<pk>[0-9]+)/$', BibliographyDetail.as_view(), name='biblio-detail'), + url(r'biblio/(?P<pk>[0-9]+)/edit/$', BibliographyUpdate.as_view(), name='biblio-update'), + url(r'biblio/(?P<pk>[0-9]+)/delete/$', BibliographyDelete.as_view(), name='biblio-delete'), +] diff --git a/ippisite/ippidb/views.py b/ippisite/ippidb/views.py new file mode 100644 index 0000000000000000000000000000000000000000..8380425964f1a4611d5abcbbbe44d659a5880842 --- /dev/null +++ b/ippisite/ippidb/views.py @@ -0,0 +1,26 @@ +from django.http import HttpResponse +from django.views.generic.edit import CreateView, UpdateView, DeleteView +from django.views.generic.detail import DetailView +from django.views.generic import ListView +from django.urls import reverse_lazy +from .models import Bibliography + +class BibliographyCreate(CreateView): + model = Bibliography + fields = '__all__' + +class BibliographyUpdate(UpdateView): + model = Bibliography + fields = '__all__' + +class BibliographyDelete(DeleteView): + model = Bibliography + success_url = reverse_lazy('biblio-list') + +class BibliographyDetail(DetailView): + model = Bibliography + fields = '__all__' + +class BibliographyList(ListView): + model = Bibliography + diff --git a/ippisite/ippidb/ws.py b/ippisite/ippidb/ws.py new file mode 100644 index 0000000000000000000000000000000000000000..cc4807daecf71b18736f27d57bd21a46b44dfa80 --- /dev/null +++ b/ippisite/ippidb/ws.py @@ -0,0 +1,15 @@ +from bioservices.eutils import EUtils + +def get_pubmed_info(pmid): + eu = EUtils() + r = eu.EFetch('pubmed', pmid, retmode='dict', rettype='abstract') + article = r['PubmedArticleSet']['PubmedArticle']['MedlineCitation']['Article'] + title = article['ArticleTitle'] + authors_list = [a['LastName']+ ' ' + a['Initials'] for a in article['AuthorList']['Author']] + authors = ', '.join(authors_list) + journal_name = article['Journal']['Title'] + biblio_year = article['Journal']['JournalIssue']['PubDate']['Year'] + return {'title':title, + 'journal_name':journal_name, + 'biblio_year':biblio_year, + 'authors_list': authors} diff --git a/ippisite/ippisite/__init__.py b/ippisite/ippisite/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ippisite/ippisite/settings.py b/ippisite/ippisite/settings.py new file mode 100644 index 0000000000000000000000000000000000000000..b7cf2bc6ef09835a3234cedca266b4129b853393 --- /dev/null +++ b/ippisite/ippisite/settings.py @@ -0,0 +1,122 @@ +""" +Django settings for ippisite project. + +Generated by 'django-admin startproject' using Django 1.10.5. + +For more information on this file, see +https://docs.djangoproject.com/en/1.10/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.10/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.10/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '&qc$2x5p&!qwvu2r=)sjp*jgg8a7ss97g8lwpennmu(q9ty4o$' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'bootstrap3', + 'ippidb' +] + +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 = 'ippisite.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + '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 = 'ippisite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.10/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.10/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.10/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.10/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/ippisite/ippisite/urls.py b/ippisite/ippisite/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..1cacf0ad280c2d9af7b3f8b1e818d689fc5b6083 --- /dev/null +++ b/ippisite/ippisite/urls.py @@ -0,0 +1,22 @@ +"""ippisite URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.10/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import include, url +from django.contrib import admin + +urlpatterns = [ + url(r'^', include('ippidb.urls')), + url(r'^admin/', admin.site.urls), +] diff --git a/ippisite/ippisite/wsgi.py b/ippisite/ippisite/wsgi.py new file mode 100644 index 0000000000000000000000000000000000000000..125cc998df7f595f448e771bea58a115ebf56de4 --- /dev/null +++ b/ippisite/ippisite/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for ippisite project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ippisite.settings") + +application = get_wsgi_application() diff --git a/ippisite/manage.py b/ippisite/manage.py new file mode 100755 index 0000000000000000000000000000000000000000..cbc3b8b3cc70407eab37a9b5a72e5afd93825389 --- /dev/null +++ b/ippisite/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ippisite.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv)