Commit a2172e2e authored by Florent Chehab's avatar Florent Chehab
Browse files

Country update

parent cd62298f
Pipeline #22029 passed with stage
in 1 minute and 15 seconds
...@@ -2,8 +2,9 @@ from django.contrib import admin ...@@ -2,8 +2,9 @@ from django.contrib import admin
from reversion_compare.admin import CompareVersionAdmin from reversion_compare.admin import CompareVersionAdmin
from rex.models.university import University from rex.models.university import University
from rex.models.country import Country from rex.models.country import Country, Region
admin.site.register(University, CompareVersionAdmin) admin.site.register(University, CompareVersionAdmin)
admin.site.register(Country) admin.site.register(Country)
admin.site.register(Region)
"ISO 3166-1 alpha-2","Pays" "Global Code","Global Name","Region Code","Region Name","Sub-region Code","Sub-region Name","Intermediate Region Code","Intermediate Region Name","Country or Area","M49 Code","ISO-alpha3 Code","Least Developed Countries (LDC)","Land Locked Developing Countries (LLDC)","Small Island Developing States (SIDS)","Developed / Developing Countries"
"AF","Afghanistan" "001","Monde","002","Afrique","015","Afrique septentrionale","","","Algérie","012","DZA","","","","Developing"
"AL","Albanie" "001","Monde","002","Afrique","015","Afrique septentrionale","","","Égypte","818","EGY","","","","Developing"
"AQ","Antarctique" "001","Monde","002","Afrique","015","Afrique septentrionale","","","Libye","434","LBY","","","","Developing"
"DZ","Algérie" "001","Monde","002","Afrique","015","Afrique septentrionale","","","Maroc","504","MAR","","","","Developing"
"AS","Samoa Américaines" "001","Monde","002","Afrique","015","Afrique septentrionale","","","Soudan","729","SDN","x","","","Developing"
"AD","Andorre" "001","Monde","002","Afrique","015","Afrique septentrionale","","","Tunisie","788","TUN","","","","Developing"
"AO","Angola" "001","Monde","002","Afrique","015","Afrique septentrionale","","","Sahara occidental","732","ESH","","","","Developing"
"AG","Antigua-et-Barbuda" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Territoire britannique de l'océan Indien","086","IOT","","","","Developing"
"AZ","Azerbaïdjan" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Burundi","108","BDI","x","x","","Developing"
"AR","Argentine" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Comores","174","COM","x","","x","Developing"
"AU","Australie" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Djibouti","262","DJI","x","","","Developing"
"AT","Autriche" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Érythrée","232","ERI","x","","","Developing"
"BS","Bahamas" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Éthiopie","231","ETH","x","x","","Developing"
"BH","Bahreïn" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Terres australes françaises","260","ATF","","","","Developing"
"BD","Bangladesh" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Kenya","404","KEN","","","","Developing"
"AM","Arménie" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Madagascar","450","MDG","x","","","Developing"
"BB","Barbade" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Malawi","454","MWI","x","x","","Developing"
"BE","Belgique" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Maurice","480","MUS","","","x","Developing"
"BM","Bermudes" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Mayotte","175","MYT","","","","Developing"
"BT","Bhoutan" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Mozambique","508","MOZ","x","","","Developing"
"BO","Bolivie" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Réunion","638","REU","","","","Developing"
"BA","Bosnie-Herzégovine" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Rwanda","646","RWA","x","x","","Developing"
"BW","Botswana" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Seychelles","690","SYC","","","x","Developing"
"BV","Île Bouvet" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Somalie","706","SOM","x","","","Developing"
"BR","Brésil" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Soudan du Sud","728","SSD","x","x","","Developing"
"BZ","Belize" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Ouganda","800","UGA","x","x","","Developing"
"IO","Territoire Britannique de l'Océan Indien" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","République-Unie de Tanzanie","834","TZA","x","","","Developing"
"SB","Îles Salomon" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Zambie","894","ZMB","x","x","","Developing"
"VG","Îles Vierges Britanniques" "001","Monde","002","Afrique","202","Afrique subsaharienne","014","Afrique orientale","Zimbabwe","716","ZWE","","x","","Developing"
"BN","Brunéi Darussalam" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","Angola","024","AGO","x","","","Developing"
"BG","Bulgarie" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","Cameroun","120","CMR","","","","Developing"
"MM","Myanmar" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","République centrafricaine","140","CAF","x","x","","Developing"
"BI","Burundi" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","Tchad","148","TCD","x","x","","Developing"
"BY","Bélarus" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","Congo","178","COG","","","","Developing"
"KH","Cambodge" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","République démocratique du Congo","180","COD","x","","","Developing"
"CM","Cameroun" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","Guinée équatoriale","226","GNQ","","","","Developing"
"CA","Canada" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","Gabon","266","GAB","","","","Developing"
"CV","Cap-vert" "001","Monde","002","Afrique","202","Afrique subsaharienne","017","Afrique centrale","Sao Tomé-et-Principe","678","STP","x","","x","Developing"
"KY","Îles Caïmanes" "001","Monde","002","Afrique","202","Afrique subsaharienne","018","Afrique australe","Botswana","072","BWA","","x","","Developing"
"CF","République Centrafricaine" "001","Monde","002","Afrique","202","Afrique subsaharienne","018","Afrique australe","Lesotho","426","LSO","x","x","","Developing"
"LK","Sri Lanka" "001","Monde","002","Afrique","202","Afrique subsaharienne","018","Afrique australe","Namibie","516","NAM","","","","Developing"
"TD","Tchad" "001","Monde","002","Afrique","202","Afrique subsaharienne","018","Afrique australe","Afrique du Sud","710","ZAF","","","","Developing"
"CL","Chili" "001","Monde","002","Afrique","202","Afrique subsaharienne","018","Afrique australe","Swaziland","748","SWZ","","x","","Developing"
"CN","Chine" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Bénin","204","BEN","x","","","Developing"
"TW","Taïwan" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Burkina Faso","854","BFA","x","x","","Developing"
"CX","Île Christmas" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Cabo Verde","132","CPV","","","x","Developing"
"CC","Îles Cocos (Keeling)" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Côte d'Ivoire","384","CIV","","","","Developing"
"CO","Colombie" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Gambie","270","GMB","x","","","Developing"
"KM","Comores" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Ghana","288","GHA","","","","Developing"
"YT","Mayotte" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Guinée","324","GIN","x","","","Developing"
"CG","République du Congo" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Guinée-Bissau","624","GNB","x","","x","Developing"
"CD","République Démocratique du Congo" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Libéria","430","LBR","x","","","Developing"
"CK","Îles Cook" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Mali","466","MLI","x","x","","Developing"
"CR","Costa Rica" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Mauritanie","478","MRT","x","","","Developing"
"HR","Croatie" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Niger","562","NER","x","x","","Developing"
"CU","Cuba" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Nigéria","566","NGA","","","","Developing"
"CY","Chypre" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Sainte-Hélène","654","SHN","","","","Developing"
"CZ","République Tchèque" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Sénégal","686","SEN","x","","","Developing"
"BJ","Bénin" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Sierra Leone","694","SLE","x","","","Developing"
"DK","Danemark" "001","Monde","002","Afrique","202","Afrique subsaharienne","011","Afrique occidentale","Togo","768","TGO","x","","","Developing"
"DM","Dominique" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Anguilla","660","AIA","","","x","Developing"
"DO","République Dominicaine" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Antigua-et-Barbuda","028","ATG","","","x","Developing"
"EC","Équateur" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Aruba","533","ABW","","","x","Developing"
"SV","El Salvador" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Bahamas","044","BHS","","","x","Developing"
"GQ","Guinée Équatoriale" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Barbade","052","BRB","","","x","Developing"
"ET","Éthiopie" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Bonaire, Saint-Eustache et Saba","535","BES","","","x","Developing"
"ER","Érythrée" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Îles Vierges britanniques","092","VGB","","","x","Developing"
"EE","Estonie" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Îles Caïmanes","136","CYM","","","","Developing"
"FO","Îles Féroé" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Cuba","192","CUB","","","x","Developing"
"FK","Îles (malvinas) Falkland" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Curaçao","531","CUW","","","x","Developing"
"GS","Géorgie du Sud et les Îles Sandwich du Sud" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Dominique","212","DMA","","","x","Developing"
"FJ","Fidji" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","République dominicaine","214","DOM","","","x","Developing"
"FI","Finlande" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Grenade","308","GRD","","","x","Developing"
"AX","Îles Åland" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Guadeloupe","312","GLP","","","","Developing"
"FR","France" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Haïti","332","HTI","x","","x","Developing"
"GF","Guyane Française" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Jamaïque","388","JAM","","","x","Developing"
"PF","Polynésie Française" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Martinique","474","MTQ","","","","Developing"
"TF","Terres Australes Françaises" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Montserrat","500","MSR","","","x","Developing"
"DJ","Djibouti" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Porto Rico","630","PRI","","","x","Developing"
"GA","Gabon" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Saint-Barthélemy","652","BLM","","","","Developing"
"GE","Géorgie" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Saint-Kitts-et-Nevis","659","KNA","","","x","Developing"
"GM","Gambie" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Sainte-Lucie","662","LCA","","","x","Developing"
"PS","Territoire Palestinien Occupé" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Saint-Martin (partie française)","663","MAF","","","","Developing"
"DE","Allemagne" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Saint-Vincent-et-les Grenadines","670","VCT","","","x","Developing"
"GH","Ghana" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Saint-Martin (partie néerlandaise)","534","SXM","","","x","Developing"
"GI","Gibraltar" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Trinité-et-Tobago","780","TTO","","","x","Developing"
"KI","Kiribati" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Îles Turques-et-Caïques","796","TCA","","","","Developing"
"GR","Grèce" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","029","Caraïbes","Îles Vierges américaines","850","VIR","","","x","Developing"
"GL","Groenland" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","Belize","084","BLZ","","","x","Developing"
"GD","Grenade" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","Costa Rica","188","CRI","","","","Developing"
"GP","Guadeloupe" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","El Salvador","222","SLV","","","","Developing"
"GU","Guam" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","Guatemala","320","GTM","","","","Developing"
"GT","Guatemala" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","Honduras","340","HND","","","","Developing"
"GN","Guinée" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","Mexique","484","MEX","","","","Developing"
"GY","Guyana" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","Nicaragua","558","NIC","","","","Developing"
"HT","Haïti" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","013","Amérique centrale","Panama","591","PAN","","","","Developing"
"HM","Îles Heard et Mcdonald" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Argentine","032","ARG","","","","Developing"
"VA","Saint-Siège (état de la Cité du Vatican)" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Bolivie (État plurinational de)","068","BOL","","x","","Developing"
"HN","Honduras" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Île Bouvet","074","BVT","","","","Developing"
"HK","Hong-Kong" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Brésil","076","BRA","","","","Developing"
"HU","Hongrie" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Chili","152","CHL","","","","Developing"
"IS","Islande" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Colombie","170","COL","","","","Developing"
"IN","Inde" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Équateur","218","ECU","","","","Developing"
"ID","Indonésie" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Îles Falkland (Malvinas)","238","FLK","","","","Developing"
"IR","République Islamique d'Iran" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Guyane française","254","GUF","","","","Developing"
"IQ","Iraq" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Guyana","328","GUY","","","x","Developing"
"IE","Irlande" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Paraguay","600","PRY","","x","","Developing"
"IL","Israël" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Pérou","604","PER","","","","Developing"
"IT","Italie" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Géorgie du Sud-et-les Îles Sandwich du Sud","239","SGS","","","","Developing"
"CI","Côte d'Ivoire" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Suriname","740","SUR","","","x","Developing"
"JM","Jamaïque" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Uruguay","858","URY","","","","Developing"
"JP","Japon" "001","Monde","019","Amériques","419","Amérique latine et Caraïbes","005","Amérique du Sud","Venezuela (République bolivarienne du)","862","VEN","","","","Developing"
"KZ","Kazakhstan" "001","Monde","019","Amériques","021","Amérique septentrionale","","","Bermudes","060","BMU","","","","Developed"
"JO","Jordanie" "001","Monde","019","Amériques","021","Amérique septentrionale","","","Canada","124","CAN","","","","Developed"
"KE","Kenya" "001","Monde","019","Amériques","021","Amérique septentrionale","","","Groenland","304","GRL","","","","Developed"
"KP","République Populaire Démocratique de Corée" "001","Monde","019","Amériques","021","Amérique septentrionale","","","Saint-Pierre-et-Miquelon","666","SPM","","","","Developed"
"KR","République de Corée" "001","Monde","019","Amériques","021","Amérique septentrionale","","","États-Unis d'Amérique","840","USA","","","","Developed"
"KW","Koweït" "001","Monde","","","","","","","Antarctique","010","ATA","","","",""
"KG","Kirghizistan" "001","Monde","142","Asie","143","Asie centrale","","","Kazakhstan","398","KAZ","","x","","Developing"
"LA","République Démocratique Populaire Lao" "001","Monde","142","Asie","143","Asie centrale","","","Kirghizistan","417","KGZ","","x","","Developing"
"LB","Liban" "001","Monde","142","Asie","143","Asie centrale","","","Tadjikistan","762","TJK","","x","","Developing"
"LS","Lesotho" "001","Monde","142","Asie","143","Asie centrale","","","Turkménistan","795","TKM","","x","","Developing"
"LV","Lettonie" "001","Monde","142","Asie","143","Asie centrale","","","Ouzbékistan","860","UZB","","x","","Developing"
"LR","Libéria" "001","Monde","142","Asie","030","Asie orientale","","","Chine","156","CHN","","","","Developing"
"LY","Jamahiriya Arabe Libyenne" "001","Monde","142","Asie","030","Asie orientale","","","Chine, région administrative spéciale de Hong Kong","344","HKG","","","","Developing"
"LI","Liechtenstein" "001","Monde","142","Asie","030","Asie orientale","","","Chine, région administrative spéciale de Macao","446","MAC","","","","Developing"
"LT","Lituanie" "001","Monde","142","Asie","030","Asie orientale","","","République populaire démocratique de Corée","408","PRK","","","","Developing"
"LU","Luxembourg" "001","Monde","142","Asie","030","Asie orientale","","","Japon","392","JPN","","","","Developed"
"MO","Macao" "001","Monde","142","Asie","030","Asie orientale","","","Mongolie","496","MNG","","x","","Developing"
"MG","Madagascar" "001","Monde","142","Asie","030","Asie orientale","","","République de Corée","410","KOR","","","","Developing"
"MW","Malawi" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Brunéi Darussalam","096","BRN","","","","Developing"
"MY","Malaisie" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Cambodge","116","KHM","x","","","Developing"
"MV","Maldives" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Indonésie","360","IDN","","","","Developing"
"ML","Mali" "001","Monde","142","Asie","035","Asie du Sud-Est","","","République démocratique populaire lao","418","LAO","x","x","","Developing"
"MT","Malte" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Malaisie","458","MYS","","","","Developing"
"MQ","Martinique" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Myanmar","104","MMR","x","","","Developing"
"MR","Mauritanie" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Philippines","608","PHL","","","","Developing"
"MU","Maurice" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Singapour","702","SGP","","","x","Developing"
"MX","Mexique" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Thaïlande","764","THA","","","","Developing"
"MC","Monaco" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Timor-Leste","626","TLS","x","","x","Developing"
"MN","Mongolie" "001","Monde","142","Asie","035","Asie du Sud-Est","","","Viet Nam","704","VNM","","","","Developing"
"MD","République de Moldova" "001","Monde","142","Asie","034","Asie méridionale","","","Afghanistan","004","AFG","x","x","","Developing"
"MS","Montserrat" "001","Monde","142","Asie","034","Asie méridionale","","","Bangladesh","050","BGD","x","","","Developing"
"MA","Maroc" "001","Monde","142","Asie","034","Asie méridionale","","","Bhoutan","064","BTN","x","x","","Developing"
"MZ","Mozambique" "001","Monde","142","Asie","034","Asie méridionale","","","Inde","356","IND","","","","Developing"
"OM","Oman" "001","Monde","142","Asie","034","Asie méridionale","","","Iran (République islamique d')","364","IRN","","","","Developing"
"NA","Namibie" "001","Monde","142","Asie","034","Asie méridionale","","","Maldives","462","MDV","","","x","Developing"
"NR","Nauru" "001","Monde","142","Asie","034","Asie méridionale","","","Népal","524","NPL","x","x","","Developing"
"NP","Népal" "001","Monde","142","Asie","034","Asie méridionale","","","Pakistan","586","PAK","","","","Developing"
"NL","Pays-Bas" "001","Monde","142","Asie","034","Asie méridionale","","","Sri Lanka","144","LKA","","","","Developing"
"AN","Antilles Néerlandaises" "001","Monde","142","Asie","145","Asie occidentale","","","Arménie","051","ARM","","x","","Developing"
"AW","Aruba" "001","Monde","142","Asie","145","Asie occidentale","","","Azerbaïdjan","031","AZE","","x","","Developing"
"NC","Nouvelle-Calédonie" "001","Monde","142","Asie","145","Asie occidentale","","","Bahreïn","048","BHR","","","","Developing"
"VU","Vanuatu" "001","Monde","142","Asie","145","Asie occidentale","","","Chypre","196","CYP","","","","Developing"
"NZ","Nouvelle-Zélande" "001","Monde","142","Asie","145","Asie occidentale","","","Géorgie","268","GEO","","","","Developing"
"NI","Nicaragua" "001","Monde","142","Asie","145","Asie occidentale","","","Iraq","368","IRQ","","","","Developing"
"NE","Niger" "001","Monde","142","Asie","145","Asie occidentale","","","Israël","376","ISR","","","","Developing"
"NG","Nigéria" "001","Monde","142","Asie","145","Asie occidentale","","","Jordanie","400","JOR","","","","Developing"
"NU","Niué" "001","Monde","142","Asie","145","Asie occidentale","","","Koweït","414","KWT","","","","Developing"
"NF","Île Norfolk" "001","Monde","142","Asie","145","Asie occidentale","","","Liban","422","LBN","","","","Developing"
"NO","Norvège" "001","Monde","142","Asie","145","Asie occidentale","","","Oman","512","OMN","","","","Developing"
"MP","Îles Mariannes du Nord" "001","Monde","142","Asie","145","Asie occidentale","","","Qatar","634","QAT","","","","Developing"
"UM","Îles Mineures Éloignées des États-Unis" "001","Monde","142","Asie","145","Asie occidentale","","","Arabie saoudite","682","SAU","","","","Developing"
"FM","États Fédérés de Micronésie" "001","Monde","142","Asie","145","Asie occidentale","","","État de Palestine","275","PSE","","","","Developing"
"MH","Îles Marshall" "001","Monde","142","Asie","145","Asie occidentale","","","République arabe syrienne","760","SYR","","","","Developing"
"PW","Palaos" "001","Monde","142","Asie","145","Asie occidentale","","","Turquie","792","TUR","","","","Developing"
"PK","Pakistan" "001","Monde","142","Asie","145","Asie occidentale","","","Émirats arabes unis","784","ARE","","","","Developing"
"PA","Panama" "001","Monde","142","Asie","145","Asie occidentale","","","Yémen","887","YEM","x","","","Developing"
"PG","Papouasie-Nouvelle-Guinée" "001","Monde","150","Europe","151","Europe orientale","","","Bélarus","112","BLR","","","","Developed"
"PY","Paraguay" "001","Monde","150","Europe","151","Europe orientale","","","Bulgarie","100","BGR","","","","Developed"
"PE","Pérou" "001","Monde","150","Europe","151","Europe orientale","","","Tchéquie","203","CZE","","","","Developed"
"PH","Philippines" "001","Monde","150","Europe","151","Europe orientale","","","Hongrie","348","HUN","","","","Developed"
"PN","Pitcairn" "001","Monde","150","Europe","151","Europe orientale","","","Pologne","616","POL","","","","Developed"
"PL","Pologne" "001","Monde","150","Europe","151","Europe orientale","","","République de Moldova","498","MDA","","x","","Developed"
"PT","Portugal" "001","Monde","150","Europe","151","Europe orientale","","","Roumanie","642","ROU","","","","Developed"
"GW","Guinée-Bissau" "001","Monde","150","Europe","151","Europe orientale","","","Fédération de Russie","643","RUS","","","","Developed"
"TL","Timor-Leste" "001","Monde","150","Europe","151","Europe orientale","","","Slovaquie","703","SVK","","","","Developed"
"PR","Porto Rico" "001","Monde","150","Europe","151","Europe orientale","","","Ukraine","804","UKR","","","","Developed"
"QA","Qatar" "001","Monde","150","Europe","154","Europe septentrionale","","","Îles d'Åland","248","ALA","","","","Developed"
"RE","Réunion" "001","Monde","150","Europe","154","Europe septentrionale","830","Îles Anglo-Normandes","Guernesey","831","GGY","","","","Developed"
"RO","Roumanie" "001","Monde","150","Europe","154","Europe septentrionale","830","Îles Anglo-Normandes","Jersey","832","JEY","","","","Developed"
"RU","Fédération de Russie" "001","Monde","150","Europe","154","Europe septentrionale","830","Îles Anglo-Normandes","Sercq","680","","","","","Developed"
"RW","Rwanda" "001","Monde","150","Europe","154","Europe septentrionale","","","Danemark","208","DNK","","","","Developed"
"SH","Sainte-Hélène" "001","Monde","150","Europe","154","Europe septentrionale","","","Estonie","233","EST","","","","Developed"
"KN","Saint-Kitts-et-Nevis" "001","Monde","150","Europe","154","Europe septentrionale","","","Îles Féroé","234","FRO","","","","Developed"
"AI","Anguilla" "001","Monde","150","Europe","154","Europe septentrionale","","","Finlande","246","FIN","","","","Developed"
"LC","Sainte-Lucie" "001","Monde","150","Europe","154","Europe septentrionale","","","Islande","352","ISL","","","","Developed"
"PM","Saint-Pierre-et-Miquelon" "001","Monde","150","Europe","154","Europe septentrionale","","","Irlande","372","IRL","","","","Developed"
"VC","Saint-Vincent-et-les Grenadines" "001","Monde","150","Europe","154","Europe septentrionale","","","Île de Man","833","IMN","","","","Developed"
"SM","Saint-Marin" "001","Monde","150","Europe","154","Europe septentrionale","","","Lettonie","428","LVA","","","","Developed"
"ST","Sao Tomé-et-Principe" "001","Monde","150","Europe","154","Europe septentrionale","","","Lituanie","440","LTU","","","","Developed"
"SA","Arabie Saoudite" "001","Monde","150","Europe","154","Europe septentrionale","","","Norvège","578","NOR","","","","Developed"
"SN","Sénégal" "001","Monde","150","Europe","154","Europe septentrionale","","","Îles Svalbard-et-Jan Mayen","744","SJM","","","","Developed"
"SC","Seychelles" "001","Monde","150","Europe","154","Europe septentrionale","","","Suède","752","SWE","","","","Developed"
"SL","Sierra Leone" "001","Monde","150","Europe","154","Europe septentrionale","","","Royaume-Uni de Grande-Bretagne et d'Irlande du Nord","826","GBR","","","","Developed"
"SG","Singapour" "001","Monde","150","Europe","039","Europe méridionale","","","Albanie","008","ALB","","","","Developed"
"SK","Slovaquie" "001","Monde","150","Europe","039","Europe méridionale","","","Andorre","020","AND","","","","Developed"
"VN","Viet Nam" "001","Monde","150","Europe","039","Europe méridionale","","","Bosnie-Herzégovine","070","BIH","","","","Developed"
"SI","Slovénie" "001","Monde","150","Europe","039","Europe méridionale","","","Croatie","191","HRV","","","","Developed"
"SO","Somalie" "001","Monde","150","Europe","039","Europe méridionale","","","Gibraltar","292","GIB","","","","Developed"
"ZA","Afrique du Sud" "001","Monde","150","Europe","039","Europe méridionale","","","Grèce","300","GRC","","","","Developed"
"ZW","Zimbabwe" "001","Monde","150","Europe","039","Europe méridionale","","","Saint-Siège","336","VAT","","","","Developed"
"ES","Espagne" "001","Monde","150","Europe","039","Europe méridionale","","","Italie","380","ITA","","","","Developed"
"EH","Sahara Occidental" "001","Monde","150","Europe","039","Europe méridionale","","","Malte","470","MLT","","","","Developed"
"SD","Soudan" "001","Monde","150","Europe","039","Europe méridionale","","","Monténégro","499","MNE","","","","Developed"
"SR","Suriname" "001","Monde","150","Europe","039","Europe méridionale","","","Portugal","620","PRT","","","","Developed"
"SJ","Svalbard etÎle Jan Mayen" "001","Monde","150","Europe","039","Europe méridionale","","","Saint-Marin","674","SMR","","","","Developed"
"SZ","Swaziland" "001","Monde","150","Europe","039","Europe méridionale","","","Serbie","688","SRB","","","","Developed"
"SE","Suède" "001","Monde","150","Europe","039","Europe méridionale","","","Slovénie","705","SVN","","","","Developed"
"CH","Suisse" "001","Monde","150","Europe","039","Europe méridionale","","","Espagne","724","ESP","","","","Developed"
"SY","République Arabe Syrienne" "001","Monde","150","Europe","039","Europe méridionale","","","ex-République yougoslave de Macédoine","807","MKD","","x","","Developed"
"TJ","Tadjikistan" "001","Monde","150","Europe","155","Europe occidentale","","","Autriche","040","AUT","","","","Developed"
"TH","Thaïlande" "001","Monde","150","Europe","155","Europe occidentale","","","Belgique","056","BEL","","","","Developed"
"TG","Togo" "001","Monde","150","Europe","155","Europe occidentale","","","France","250","FRA","","","","Developed"
"TK","Tokelau" "001","Monde","150","Europe","155","Europe occidentale","","","Allemagne","276","DEU","","","","Developed"
"TO","Tonga" "001","Monde","150","Europe","155","Europe occidentale","","","Liechtenstein","438","LIE","","","","Developed"
"TT","Trinité-et-Tobago" "001","Monde","150","Europe","155","Europe occidentale","","","Luxembourg","442","LUX","","","","Developed"
"AE","Émirats Arabes Unis" "001","Monde","150","Europe","155","Europe occidentale","","","Monaco","492","MCO","","","","Developed"
"TN","Tunisie" "001","Monde","150","Europe","155","Europe occidentale","","","Pays-Bas","528","NLD","","","","Developed"
"TR","Turquie" "001","Monde","150","Europe","155","Europe occidentale","","","Suisse","756","CHE","","","","Developed"
"TM","Turkménistan" "001","Monde","009","Océanie","053","Australie et Nouvelle-Zélande","","","Australie","036","AUS","","","","Developed"
"TC","Îles Turks et Caïques" "001","Monde","009","Océanie","053","Australie et Nouvelle-Zélande","","","Île Christmas","162","CXR","","","","Developed"
"TV","Tuvalu" "001","Monde","009","Océanie","053","Australie et Nouvelle-Zélande","","","Îles des Cocos (Keeling)","166","CCK","","","","Developed"
"UG","Ouganda" "001","Monde","009","Océanie","053","Australie et Nouvelle-Zélande","","","Île Heard-et-Îles MacDonald","334","HMD","","","","Developed"
"UA","Ukraine" "001","Monde","009","Océanie","053","Australie et Nouvelle-Zélande","","","Nouvelle-Zélande","554","NZL","","","","Developed"
"MK","L'ex-République Yougoslave de Macédoine" "001","Monde","009","Océanie","053","Australie et Nouvelle-Zélande","","","Île Norfolk","574","NFK","","","","Developed"
"EG","Égypte" "001","Monde","009","Océanie","054","Mélanésie","","","Fidji","242","FJI","","","x","Developing"
"GB","Royaume-Uni" "001","Monde","009","Océanie","054","Mélanésie","","","Nouvelle-Calédonie","540","NCL","","","x","Developing"
"IM","Île de Man" "001","Monde","009","Océanie","054","Mélanésie","","","Papouasie-Nouvelle-Guinée","598","PNG","","","x","Developing"
"TZ","République-Unie de Tanzanie" "001","Monde","009","Océanie","054","Mélanésie","","","Îles Salomon","090","SLB","x","","x","Developing"
"US","États-Unis" "001","Monde","009","Océanie","054","Mélanésie","","","Vanuatu","548","VUT","x","","x","Developing"
"VI","Îles Vierges des États-Unis" "001","Monde","009","Océanie","057","Micronésie","","","Guam","316","GUM","","","x","Developing"
"BF","Burkina Faso" "001","Monde","009","Océanie","057","Micronésie","","","Kiribati","296","KIR","x","","x","Developing"
"UY","Uruguay" "001","Monde","009","Océanie","057","Micronésie","","","Îles Marshall","584","MHL","","","x","Developing"
"UZ","Ouzbékistan" "001","Monde","009","Océanie","057","Micronésie","","","Micronésie (États fédérés de)","583","FSM","","","x","Developing"
"VE","Venezuela" "001","Monde","009","Océanie","057","Micronésie","","","Nauru","520","NRU","","","x","Developing"
"WF","Wallis et Futuna" "001","Monde","009","Océanie","057","Micronésie","","","Îles Mariannes du Nord","580","MNP","","","x","Developing"
"WS","Samoa" "001","Monde","009","Océanie","057","Micronésie","","","Palaos","585","PLW","","","x","Developing"
"YE","Yémen" "001","Monde","009","Océanie","057","Micronésie","","","Îles mineures éloignées des États-Unis","581","UMI","","","","Developing"
"CS","Serbie-et-Monténégro" "001","Monde","009","Océanie","061","Polynésie","","","Samoa américaines","016","ASM","","","x","Developing"
"ZM","Zambie" "001","Monde","009","Océanie","061","Polynésie","","","Îles Cook","184","COK","","","x","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Polynésie française","258","PYF","","","x","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Nioué","570","NIU","","","x","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Pitcairn","612","PCN","","","","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Samoa","882","WSM","","","x","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Tokélaou","772","TKL","","","","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Tonga","776","TON","","","x","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Tuvalu","798","TUV","x","","x","Developing"
"001","Monde","009","Océanie","061","Polynésie","","","Îles Wallis-et-Futuna","876","WLF","","","","Developing"
\ No newline at end of file
# Generated by Django 2.0.3 on 2018-04-24 19:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rex', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Region',
fields=[
('name', models.CharField(max_length=200)),
('un_code', models.CharField(max_length=3, primary_key=True, serialize=False)),
('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='rex.Region')),
],
),
migrations.RemoveField(
model_name='country',
name='iso_code',
),
migrations.AddField(
model_name='country',
name='iso_alpha3_code',
field=models.CharField(default='TMP', max_length=3, primary_key=True, serialize=False),
preserve_default=False,
),
migrations.AddField(
model_name='country',
name='region',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='rex.Region'),
),
]
from .country import Country, CountryViewSet, CountrySerializer # noqa: F401 from .country import Country, CountrySerializer, CountryViewSet # noqa: F401
from .country import Region, RegionSerializer, RegionViewSet # noqa: F401
from django.db import models from django.db import models
from rest_framework import serializers, viewsets, permissions from rest_framework import serializers, viewsets, permissions
# Data model based on : https://unstats.un.org/unsd/methodology/m49/overview/
class Region(models.Model):
name = models.CharField(max_length=200)
un_code = models.CharField(primary_key=True, max_length=3)
parent = models.ForeignKey(
'self', on_delete=models.SET_NULL, null=True)
class Country(models.Model): class Country(models.Model):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
iso_code = models.CharField(primary_key=True, max_length=2) iso_alpha3_code = models.CharField(primary_key=True, max_length=3)
region = models.ForeignKey(Region, on_delete=models.PROTECT, null=True)
"""
API RELATED STUFF BELLOW
"""
class CountrySerializer(serializers.HyperlinkedModelSerializer): class CountrySerializer(serializers.HyperlinkedModelSerializer):
class Meta: class Meta:
model = Country model = Country
fields = ('name', 'iso_code', 'url') fields = ('name', 'iso_alpha3_code', 'region', 'url')
class CountryViewSet(viewsets.ModelViewSet): class CountryViewSet(viewsets.ModelViewSet):
...@@ -27,3 +42,25 @@ class CountryViewSet(viewsets.ModelViewSet): ...@@ -27,3 +42,25 @@ class CountryViewSet(viewsets.ModelViewSet):
permission_classes = (permissions.DjangoModelPermissions,) permission_classes = (permissions.DjangoModelPermissions,)
queryset = Country.objects.all() # noqa: E1101 queryset = Country.objects.all() # noqa: E1101
serializer_class = CountrySerializer serializer_class = CountrySerializer
class RegionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Region
fields = ('name', 'un_code', 'parent', 'url')
class RegionViewSet(viewsets.ModelViewSet):
"""
retrieve:
Retourne un pays.
list:
Retourne une liste de pays.
create:
Créée un nouveau pays.
"""
permission_classes = (permissions.DjangoModelPermissions,)
queryset = Region.objects.all() # noqa: E1101
serializer_class = RegionSerializer
from django.conf.urls import url, include from django.conf.urls import url, include
from rex import views from rex import views
from rest_framework import routers from rest_framework import routers
from rex.models.country import CountryViewSet from rex.models.country import CountryViewSet, RegionViewSet
from rest_framework.documentation import include_docs_urls from rest_framework.documentation import include_docs_urls
...@@ -13,5 +13,6 @@ urlpatterns = [ ...@@ -13,5 +13,6 @@ urlpatterns = [
router = routers.DefaultRouter() router = routers.DefaultRouter()
router.register(r'country', CountryViewSet) router.register(r'country', CountryViewSet)
router.register(r'region', RegionViewSet)
urlpatterns += [url(r'^api/', include(router.urls))] urlpatterns += [url(r'^api/', include(router.urls))]
...@@ -5,22 +5,48 @@ Script to insert the country data in the database ...@@ -5,22 +5,48 @@ Script to insert the country data in the database
IT HAS TO BE RUN INSIDE ./manage.py shell IT HAS TO BE RUN INSIDE ./manage.py shell
""" """
import csv
import os import os
import pandas as pd
from rex.models.country import Country, Region
from rex.models.country import Country
tmp = os.path.join(os.path.realpath(__file__), '../../assets/country.csv') tmp = os.path.join(os.path.realpath(__file__), '../../assets/country.csv')
country_file_loc = os.path.abspath(tmp) country_file_loc = os.path.abspath(tmp)