Posts

Showing posts from June, 2015

android - Could not allocate JNI Env -

i'm updating api every 2seconds, receiving error , application closes. fatal exception: main process: com.application.toweeloasep, pid: 6681 java.lang.outofmemoryerror: not allocate jni env @ java.lang.thread.nativecreate(native method) @ java.lang.thread.start(thread.java:730) @ com.android.volley.requestqueue.start(requestqueue.java:145) @ com.android.volley.toolbox.volley.newrequestqueue(volley.java:66) @ com.android.vo

php - Accessing Laravel through LAN and can't redirect to '/' after login -

i have installed laravel on machine , i'm trying login laravel through lan via web browser using ipaddress/laravel/public. able view login page when try login message this page isn’t working 192.168.1.17 unable handle request. http error 500 what step did miss? in advance. yep, indeed missing on it. help

firebase - FCM - onTokenRefresh is never called on multi-flavored android app -

i have multi-flavored android app. package name same both flavors (com.mycompany.base). in app level gradle file, 2 flavors have own appplication ids (com.mycompany.firstflavor, , com.mycompany.secondflavor). in past, google play services maps, used both application ids , google-services.json file includes information both flavors. need copy json file app , worked fine. lately created fcm project in order implement push notification, , added each flavor app using application ids before. @ first, included 1 coppy of json file in suggested location in app. when ran app on 1 flavor, said firebase initialized successfully. however, ontokenrefresh method never called. searched on internet, , there related topics, none of solutions worked in case. when ran app on flavor, app kept crashing error message: java.lang.nosuchmethoderror: no static method zzb(ljava/lang/object;ljava/lang/object;)ljava/lang/object; in class lcom/google/android/gms/common/internal/zzab; or super classes (dec

javascript - Express js 4x :req.params returns empty object -

trying url parameters in express js,but got empty object. var password= require('./routes/password'); app.use('/reset/:token',password); password.js router.get('/', function(req, res, next) { console.log(req.params); res.send(req.params); }); console.log(req.params) output {} access url : http://localhost:3000/reset/civv6u9huples3i0eusnwk9zb7xvzpfhsqnuzmnwqllga4njkoagwbcyiuz8 by default, nested routers not passed parameters used in mountpaths parent routers. in case, app parent router, uses /reset/:token mountpath, , router nested router. if want router able access req.params.token , create follows: let router = express.router({ mergeparams : true }); documented here .

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

i´m new programming. i´m trying use scipy minimize, had several issues , gotten through of them. right code, i'm not understanding why i´m getting error. par_opt = so.minimize(fun=fun_obj, x0=par_ini, method='nelder-mead', args=[series_pt_cal, dt, series_caudal_cal]) not enough info given op, somewhere in code it's specified operate data frame column (axis=1) on object pandas series. if code typically works occasional gives errors, check degenerative cases data frame may have 1 row. pandas has nasty habit of guessing want -- may decide reduce 1-row data frame series (e.g., apply() function; can disable using reduce=false in there). add line of code check object isinstance(df, pd.dataframe) or else convert offending pandas series data frame, s.to_frame().t problems had deal with.

Angular Dart tutorial section 4 - 'Future not resolved' -

total newbie dart , angular. long-time sw developer lot of experience multiple languages , platforms. i'm working through 'tour of heroes' tutorial, stumped in section 4. , under heading 'the hero service returns future'. thus far, i've gotten things work pretty well, when try mod code return future (per tutorial), error. in hero_service.dart, this: future<list<hero>> getheroes() async => mockheroes; and in app_component.dart, this: future<null> getheroes() async { heroes = await _heroservice.getheroes(); } but, i'm getting error: exception: 'package:tour_of_heroes/app_component.dart': malformed type: line 86 pos 3: cannot resolve class 'future' 'appcomponent' future<null> getheroes() async { ^ i've backed out , re-entered make sure i've entered correctly , still getting error. i'm wondering if in core refactored , need impo

Python adding dictionary values from separate script runs -

i have dictionary generated within script: dict1 = {'a': 1, 'b': 2, 'c':3} the script generate dictionary run many times on different files generate more dictionaries, each within own script: dict2 = {'a': 5, 'b': 3, 'c':2} dict3 = {'a': 2, 'b': 1, 'c':0} my plan add these file individually, add values same key (e.g. 1 entry 'a': 8) once file has been appended dictionaries. is there way add values of dictionaries they're added file? or other way results in values being added each script completes? edit: i'm new coding, please explain , if can. :) i wanted add new generated dictionary values pre-existing file. for example, dict 1 in file. did with open(file.txt, "w") f: in dict.keys(): f.write(i + " " + str(dict[i]) + "\n") to add dict 2, dict 3, etc file: took file.txt had dict1 , re-wrote dictionary for line in f:

python - How to divide up webscraping workload -

i have massive webscraping project (part 1 scraping 300k+ separate data entries website). may have more of these in future , 1 data entry @ time won't suffice. have been using selenium enter data js site, , beautifulsoup parse results. have looked @ selenium grid don't believe accomplish want because i'm not trying have every instance perform same function. i take ~300k separate data entries , split them search, example, 8+ @ time. is option @ point (in python) setup several vms , execute python script in each? current time finish scrape 30 hours.

ios - UI Button doesnt perform action till 2nd time you press -

i have button on uitabbar (custom) , animations when button clicked doesn't perform until press twice. print statement used print's on first try though i'm not sure why doesn't perform animations on first try. here code: func menubuttonaction(sender: uibutton) { if sender.currentimage == #imageliteral(resourcename: "play") { uiview.animate(withduration: 0.3, animations: { sender.setimage(#imageliteral(resourcename: "playbutton2"), for: .normal) self.button2.frame = cgrect(x: self.tabbar.center.x, y: self.tabbar.center.y - 100, width: self.buttonimage.size.width, height: self.buttonimage.size.height) self.view3.alpha = 0.6 }) } else { sender.setimage(#imageliteral(resourcename: "play"), for: .normal) uiview.animate(withduration: 0.3, animations: { self.button2.center = self.button.center self.view3.alpha = 0 }) } pri

iphone - Show and Hide uitableviewcells in uitableview in IOS -

Image
the highlighted region in image hide/show after tapping view below (with label additional cards), there library in ios that? if not how can done? i guess want expand , collapses tableview cells.however abouv library good. but,if want learn how without library , there many things tableview might helpful in future. demo , link step step https://www.raywenderlich.com/129059/self-sizing-table-view-cells . also, can download demo directly here. https://github.com/soapyigu/swift30projects/tree/master/project%2005%20-%20artistry .you found download link on first url gave you.

fetch data from database and display the values in database in laravel -

i want fetch values database , display in view, didn't correct result. this controller : class hrrequestcontroller extends controller { /** * create new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } /** * display listing of resource. * * @return \illuminate\http\response */ public function index() { $hr_request = hrrequest::all(); return array( 'status' => 'success', 'pages' => $hr_request->toarray()); } } and model : <?php namespace app; use illuminate\database\eloquent\model; class hrrequest extends model { /** * table associated model. * * @var string */ protected $table = 'hr_request'; public $timestamps = false; /** * fields. * * @var array */ protected $fillable = [

sql server - How to get Financial year by using expression in ssrs report -

how financial year using expression in ssrs report. out put required (i.e fy 1617) using from_date or to_date parameter. now question becomes bit tricky. want put output? if parameters contain more 2 years? e.g. = 2014 , = 2017? depends on business requirement now. anyway, below expression should give ideas, if year part of parameters same, use parameter base, otherwise use both , parameter: = "fy" + iif(year(parameters!fromdate.value) = year(parameters!todate.value), format(parameters!fromdate.value, "yy") + " " + format(dateadd(dateinterval.year, 1, parameters!fromdate.value), "yy"), format(parameters!fromdate.value, "yy") + " " + format(parameters!todate.value, "yy"))

c# - how can I add a prefix string in the filename when upload a file using qq.FileUploader -

my code this, how can add prefix "123_" front of filename when user uploads 1.jpg, , change 123_1.jpg server? <script type="text/javascript"> var uploader = new qq.fileuploader({ element: document.getelementbyid('file-uploader'), allowedextensions: ["jpg", "pdf"], template: '<div class="qq-uploader">' + '<div class="qq-upload-drop-area"><span>drag files here upload</span></div>' + '<div class="qq-upload-button">upload files</div>' + '<ul class="qq-upload-list">&l

assembly - Position independent code related: why discard r/w data in compressed kernel linker script? -

i've been trying undrestand arm linux linker script compressed kernel image: http://elixir.free-electrons.com/source/arch/arm/boot/compressed/vmlinux.lds.s?v=4.4.19 i understand /arch/arm/boot/compressed/head.s written position independent image can loaded @ point in ram , yet working correctly. but can not understand entry: 22 /discard/ : { 23 *(.arm.exidx*) 24 *(.arm.extab*) 25 /* 26 * discard r/w data - produces link error if have any, 27 * required pic decompression. local data generates 28 * gotoff relocations, prevents being relocated independently 29 * of text/got segments. 30 */ 31 *(.data) when looked gnu ld user manual : special secname /discard/' may used discard input sections. sections assigned output section named /discard/' not included in final link output. my question why need discard .data section. , gotoff relocations , relevance in context? another thing observed

wordpress theming - Get multiple images as background -

i'm trying wrap head around how implement multiple backgrounds (for slider) header. i done customizer work , trying set things can let bit of javascript circle trough different background images set up. header home page code (header-home.php) : <header class="site-header"> <div class="row header-home" <?php if ((get_theme_mod('slider_radio', 'slider') == 'static')) { echo 'style="background-image:url(' . get_header_image() . ');' . 'background-repeat: no-repeat; background-position: center; background-size: cover;min-height:100vh">'; } else { echo 'style="background-image:url(' . getsliderimage1() . ',url(\'' . getsliderimage2() . ',url(\'' . getsliderimage3() . ');' . 'background-repeat: no-repeat;background-position: center; background-size: cover;min-height:100vh">'; } ?> &

wordpress - Woocommerce single product page oversized on mobile -

on website. open page on mobile looking good. on single product page such http://www.ilmthai.com/product/to001/ have space on right side. enter image description here it should not dragged right. please help.

Create single exe from Python 3.6 scripts in CX_Freeze -

i have python script compile single executable file, have read pyinstaller best option unfortunately cx_freeze compiler have found work python 3.6. is there way cx_freeze? first must have cx_freeze 5.0.1 supports python 3.6 . then,it's 3.x version . put code in setup.py file , replace : "prog.py" with main script name. take care , don't forgit if go console should if sys.platform == "win32": base = "console" here code : import sys cx_freeze import setup, executable # dependencies automatically detected, might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} # gui applications require different base on windows (the default # console application). base = none if sys.platform == "win32": base = "win32gui" setup( name = "my prog", version = "1.0", description = "my application!"

html5 - CSS input effect not working if required is removed -

the label effect work if required there in input tag. effect not work if remove required attribute click see working fiddle there solution this. html <div class="group "> <input type="text" required="" class="module-input" /> <label >name</label> </div> snippet: .module-input { font-size: 14px; padding-top: 12px; display: block; width: 97%; border: none; border-bottom: 1px solid #94a3a9; background-color: transparent; color: #5a686d; margin-bottom: 2%; } input:focus { outline: none; } .group { position: relative; margin-bottom: 25px; } /* label */ label { color: #94a3a9; font-size: 14px; font-weight: normal; position: absolute; pointer-events: none; left: 0.5%; top: 10px; transition: 0.2s ease all; -moz-transition: 0.2s ease all; -webkit-transition: 0.2s ease all; } /* active state */ input:focus+label, i

How to split a Kendo Grid into a child and parent grid? -

Image
so i'm having problems grid because has many columns. i'd split grid half, having half of columns shown in main grid , other half in child grid when row gets expanded. basically data in row of parent grid has same data in row of child grid, different columns shown. the code below should transformed this: here's grid itself: $("#materials") .kendogrid({ datasource: { data: [], schema: { model: { id: "id", fields: { id: { type: "number", editable: false }, code: { type: "string", editable: false }, name: { type: "string", editable: false }, externalcode1: { type: "string", editable: false }, externalcode2: { type: "string", editable: false }, othercode1: { type: &

javascript - Is it possible to create a link from a website that does not work (in the same way) if typed manually in browser? -

i need exclude error it, ask here. have being asked client create page can accessed via link on website cannot accessed (or @ least redirected place) manually copying link or typing browser address bar. the thing came in mind me using cookie on website , check if user browser has stored cookie when critical page opens. user not coming base website see different or redirect via javascript etc. (i.g. using cookie if {… ). let me know if oversaw possibility or if simply: “there no way that.” thanks! edit @marmeladze: sorry not familiar require techniques. cannot take way fear. , not able if works = correct answer. @mplungjan: wow! didn’t know seemingly simple referrer thing! think way go in accepted answer here: checking referrer cool! sadly, link though direct download link of pdf neither of solutions work because (i wrong maybe?) not able put code in it. a solution attempt sinatra . require "sinatra" '/posts/:slug' "this post #{p

android - How to Add a Menu Without a Bar -

i've seen lot of applications there no actionbar there menu how? picture enter image description here how can create this http://developer.android.com/guide/topics/ui/menus.html learn more ^ public void noactionbar(view v) { popupmenu popup = new popupmenu(this, v); menuinflater inflater = popup.getmenuinflater(); inflater.inflate(r.menu.actions, popup.getmenu()); popup.show(); }

How can i force remove a docker container using 'docker_container' module of Ansible? -

i having problems removing containers docker host after introducing cadvisor - https://github.com/google/cadvisor/issues/771 i have large number of ansible (2.2.1.0) scripts use install service containers on these docker host , internally using docker_container module. many times these scripts want remove container, because of problem stated above, failing. i can force kill docker container on these docker hosts easily: docker rm container_name -fv so expect force_kill option provided in docker_container module ( docker_container module docs ) should able same: - name: delete docker containers docker_container: name: "container_name" force_kill: true keep_volumes: false state: absent but script fail always. not know purpose of option if not able force kill it. of scripts failing after enabling force_kill , need know how make sure option works intended ? update: understand force_kill option sending docker kill signal. have updated question

css - Responsive design on California Responsive BigCommerce template -

i looking simple guidance can cope design basics stuck in 1 area of website design findmethatwine.com dektop site working want (always room improve hey). responsive side in 1 area grappling with. logo site when reduce screen size tablet or mobile template responds. issue want float logo on left of screen (for mobile devices) gives room use right hand side of screen create similar blocks of content important free shipping , guarantee info shows on full desktop site. i have tried manner basic float left in css site , whilst moves logo causes styling issues links in top right sign in link messes entirely. any clues how go achieving or work around massively helpful neither me or colleague can figure headache out. sorry if missing useful info need, ask. one option in stylesheet @ https://cdn5.bigcommerce.com/r-cd74cb12e5d8e952a812b68d3d60382a14b97a1e/themes/california/styles/responsive.css goto line 128 , change rule to .header-logo-mobile{ display:block; marg

html - Autoscroll in bash script output called from PHP -

i have php script prints output of bash script (actually expect script), looks this: <?php ob_implicit_flush(true); ob_end_flush(); $cmd = "./expect_script.sh"; $descriptorspec = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") ); $process = proc_open($cmd, $descriptorspec, $pipes, realpath('./'), array()); echo '<pre>'; if (is_resource($process)) { while ($s = fgets($pipes[1])) { print $s; } } echo '</pre>'; ?> so wanted real time output automatic scroll @ end of page every new line appearance , found this: printing process output in realtime then added proposed html code script follows: <html><head> <script language="javascript"> var int = self.setinterval("window.scrollby(0,1000);", 200); </script> </head> <body> <?php ob_implici

node.js - Mongoose many to many relation -

i beginner node.js , mongoose programmer. far have created simple blog 3 models - article, user, categories , working fine. want create comments. want every user able have manny comments , every articles able have manny comments. how can , how can represent logic in controller interact each other: let articleschema = mongoose.schema ( { author: {type: objectid, ref: 'user'}, title: {type: string, required: true }, content: {type: string, required: true }, category: {type: objectid, ref: 'category', required: true}, date: {type: date, default: date.now() }, } ); let userschema = mongoose.schema( { email: {type: string, required: true, unique: true}, passwordhash: {type: string, required: true}, fullname: {type: string, required: true}, salt: {type: string, required: true}, articles: [{type: objectid, ref: 'article'}], roles: [{type: objectid, ref: 'role'}] } ); let categoryschema = mongoose.schema ( {

javascript - grid sorting in AngularJs -

i new angularjs. got data in table using ng-repeat. now, trying sort table columns. not happening. please give me suggestion. <html ng-app="authorsapp"> <div ng-controller="myauthors"> <table class="table table-striped table-hover"> <tr> <th ng-click="sort{'name'}"> name <span class="glyphicon glyphicon-sort" ng-show="sortkey == 'name'" ng-class="{'glyphicon-chevron-up':reverse, 'glyphicon-chevron-down':!reverse}"></span> </th> <th ng-click="sort{'department'}"> deparment <span class="glyphicon glyphicon-sort" ng-show="sortkey == 'department'" ng-class="{'glyphicon-chevron-up':reverse, 'glyphicon-chevron-down':!reverse}"

accepting acents in regex android -

mates... i having troubles pass through regex accepting accents in android... things have try java not working properly, , android don't want our accented vocals .. i have following regex: pattern pattern = pattern.compile("[a-za-zñÑáéíóúÁÉÍÓÚ]+"); any tip of how include ñ , accents vocals in android? thanks in advance... here our validation function: public static boolean validarnombres(string nametovalidate){ byte step = 1; byte minwords = 2; byte maxwords = 5; boolean validname = false; string[] aux; matcher matcher = null; pattern pattern = pattern.compile("[\\p{l}\\p{m}]+"); aux = nametovalidate.split(" "); //paso 2: check name has 2 5 words if(aux.length >= minwords && aux.length <= maxwords){ step++; matcher = pattern.matcher(nametovalidate); } //paso 3: check name matches out regex if(step==2 && matcher.matches()){ validname = true; } return validname; } edit: think found mistake... not includi

sql update - How to temporarily break column uniqueness in SQLite? -

i've got simple table: create table checkliststep ( checklist integer references checklist (id), id integer primary key autoincrement, stepindex integer not null, name varchar not null, unique (checklist, stepindex)); now want exchange 2 items' indexes. doing i'm breaking temporarily uniqueness of pair (checklist, stepindex). hoped, can in transaction, such after committing, constraints kept, doesn't work: begin transaction; update checkliststep set stepindex = 0 id = 6; update checkliststep set stepindex = 1 id = 5; commit transaction; causes: unique constraint failed: checkliststep.checklist, checkliststep.stepindex how write such update? sqlite not have deferred unique constraints. the pragma writable_schema dirty trick not work here because internal index corrupted if changed table without updating index. the way use temporary value guaranteed unused: begin; update checkliststep set stepindex = -999

Visual Studio 2017 - Team Explorer Builds 'Page not found' -

Image
we using xaml builds in tfs 2015. in team explorer, builds tab in visual studio 2017 (but still connecting tfs 2015 server) of sudden seeing following 'page not found' message , none of xaml builds appear: this happened after removing tfs 2015 connection, connecting tfs 2017 instance, deleting 2017 connection , re-connecting to previous tfs 2015 instance. i have tried clearing mefcomponentcache folder running devenv /setup completely uninstalling , re-installing vs2017 ... , i'm still getting error each time connect tfs server. have vs2015 installed , show builds 2017 not. lot of other posts on issue seem related vs2015 not 2017. i'm guessing has changed here. know why happening , how fix please? i'm new tfs, possible, visual studio 2017 has added files, setting-files on system , if delete vs17 files not deleted. i think can try 2 options: you can remove vs17 again , run programm clean pc, this clean tool . after can install vs17 a

html - Stop Animation Between Loop CSS -

i have code , want stop animate between loops ex 5sec, googled , found rotate (no delay) .line-1{ border-left: 2px solid rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; direction:ltr; } /* animation */ .anim-typewriter{ animation: typewriter 4s steps(44) 1s infinite normal both, blinktextcursor 500ms steps(44) infinite normal; } @keyframes typewriter{ from{width: 0;} to{width: 24em;} } @keyframes blinktextcursor{ from{border-left-color: rgba(255,255,255,.75);} to{border-left-color: transparent;} } <p class="line-1 anim-typewriter" style="margin-left:auto;margin-right:auto;">good news: won :)<a href="awards/"> award </a></p> you can add step in keyframe animation same previous step: .line-1 { border-left: 2px solid rgba(255, 255, 255, .75); white-space: nowrap; overflow: hidden; direction: ltr; } /* animation */ .anim-typewri

sql server - SqlServer - Specify a code page on data -

data come odbc. code page different between sqlserver database , odbc data. the odbc data don't specify original code page , sqlserver interpret him default code page. version : microsoft sql server 2008 r2 (sp1) - 10.50.2500.0 (x64) for example : select cast(cast('é' collate sql_latin1_general_cp850_bin2 varbinary(10)) varchar(10)) returns ',' select cast(cast('é' collate sql_latin1_general_cp1_ci_as varbinary(10)) varchar(10)) returns 'é' how can specify original code page in query? edit : nvarchar don't work, result empty string. select cast(cast('é' collate sql_latin1_general_cp850_bin2 varbinary(10)) nvarchar(10)) re-edit : specify nvarchar in odbc query : select reference openrowset('msdasql', 'dsn=***', 'select cast(reference nvarchar) reference orders') tmp this query return error message : [odbc engine interface]invalid column type: nvarchar.

Phonegap build config.xml -

i have hybrid app built phonegap. if compile app using android studio / xcode working fine, want use phonegap build. when starting app built phonegap on android device, doesn't work. seems permission issue. app requires internet connection , access location services. have no idea on how include in config.xml . any idea? add config.xml <preference name="android-build-tool" value="gradle" /> <plugin name="cordova-plugin-whitelist" /> <access origin="*"/> <allow-navigation href="*" /> <allow-navigation href="data:*" /> <allow-intent href="*" /> <allow-intent href="itms:*" /> <allow-intent href="itms-apps:*" /> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*" /> <allow-intent href="tel:*" /> <allow-intent href="sms:*" /> <allow-intent href="ma

javascript - Future Date Calculator -

i have following script when used, allows user see future date, while excluding weekends. problem i've encountered though if current day friday, , set future date 3 days counts saturday , sunday working days. i'm hoping 1 of may able i'm not great @ javascript. the correct example be: if today = friday 3 working days wednesday (not monday script calculates it). any ideas? var mydelayindays = 3; mydate=new date(); mydate.setdate(mydate.getdate()+mydelayindays); if(mydate.getday() == 0){//sunday mydate.setdate(mydate.getdate() + 2);//tuesday } else if(mydate.getday() == 6){//saturday mydate.setdate(mydate.getdate() + 2);//monday } document.write('' + mydate.tolocaledatestring('en-gb')); any great. thanks try code changing date , days add, custom loop used skip sat , sun function adddates(startdate,noofdaystoadd){ var count = 0; while(

How to draw a Spanned String with Canvas.drawText in Android -

Image
i want draw spannedstring canvas . spannablestring spannablestring = new spannablestring("hello world!"); foregroundcolorspan foregroundspan = new foregroundcolorspan(color.red); backgroundcolorspan backgroundspan = new backgroundcolorspan(color.yellow); spannablestring.setspan(foregroundspan, 1, 8, spannable.span_exclusive_exclusive); spannablestring.setspan(backgroundspan, 3, spannablestring.length() - 1, spannable.span_exclusive_exclusive); textview.settext(spannablestring); the above example drawn using textview , in turn uses layout draw text spans. know using layout recommended way draw text canvas. however, making own text layout scratch, need implement myself. doing doesn't work canvas.drawtext(spannablestring, 0, spannablestring.length(), 0, 0, mtextpaint); because drawtext gets text spannablestring , not of spans. drawing colors handled separately textpaint . how use canvas.drawtext (or drawtextrun ) draw span information (specifically fo

jquery - using dynamic ui tabs how to show the link which is already available in the list instead of creating new tab -

Image
how check tabid available before creating new tab bynamicaly , make active if avaliable. <script type="text/javascript"> $(document).on('click', '#refresh', function () { var $link = $('li.active a[data-toggle="tab"]'); $link.parent().removeclass('active'); var tablink = $link.attr('href'); $('#tab-list a[href="' + tablink + '"]').tab('show'); }); function loadlink(link='',description='',tabid=''){ if(link!=''){ //$('#loading_data').html("loading....."); var domain_name ='//<?php echo $_server['http_host'];?>'; var src = domain_name+'<?php echo [domain_path];?>'+link; $('#tab-list').append($('<li><a href="#tab' + tabid + '" role="tab" data-toggle="t

django - Rest Framework Swagger: Error when implementing custom user without username field -

i have implemented custom user email primary key , removed username field. fine, when try launch swagger, error: improperlyconfigured @ /api/v1/swagger/ field name username not valid model customuser . here traceback rest_framework_swagger: improperlyconfigured @ /api/v1/swagger/ field name `username` not valid model `customuser`. request method: request url: http://localhost:8000/api/v1/swagger/ django version: 1.10.5 python executable: /users/ngm/.virtualenvs/venv/bin/python python version: 3.6.0 python path: ['/users/ngm/pycharmprojects/hou', '/library/frameworks/python.framework/versions/3.6/lib/python36.zip', '/library/frameworks/python.framework/versions/3.6/lib/python3.6', '/library/frameworks/python.framework/versions/3.6/lib/python3.6/lib-dynload', '/users/ngm/.virtualenvs/venv/lib/python3.6/site-packages', '/users/ngm/.virtualenvs/venv/lib/python3.6/site-packages/pip-7.1.0-py3.6.egg',] server time: fri, 7 apr 201