Django Debug Toolbar Panels Don't Show Data - django-debug-toolbar

I have configured the django-debug-toolbar like so:
DEBUG = True
DEBUG_TOOLBAR_PATCH_SETTINGS = False
INTERNAL_IPS = ('127.0.0.1',)
MIDDLEWARE_CLASSES = (
...,
'debug_toolbar.middleware.DebugToolbarMiddleware',
...,
)
INSTALLED_APPS = (
...,
'debug_toolbar',
...,
)
And the toolbar shows up for me:, but when I click on one of the toolbars like SQL I get no detailed information:
No errors in the console. Wondering why I don't get detailed info when clicking the panel.
I'm using Django 1.7 and installed django-debug-toolbar 1.3

Moving the debug url to the first url pattern solved this

Related

How do I enable access-period on freeradius 3.0 for daloradius

I am trying to enable access-period on free radius 3.0,
I have added access-period module and authorize.
sqlcounter accessperiod {
counter-name = Max-Access-Period-Time
check-name = Access-Period
sqlmod-inst = sql
key = User-Name
reset = never
query = "SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct \
WHERE UserName = '%{%k}' LIMIT 1"
}
In the authorization part:
accessperiod
}
Loaded module rlm_sqlcounter
# Loading module "accessperiod" from file /etc/freeradius/3.0/mods-enabled/acessperiod
sqlcounter accessperiod {
/etc/freeradius/3.0/mods-enabled/acessperiod[1]: Configuration item "sql_module_instance" must have a value
/etc/freeradius/3.0/mods-enabled/acessperiod[1]: Invalid configuration for module "accessperiod"
It's simple.
Check freeradius 3 sqlcounter format. Then adjust sqlcounter from contrib directory to work with radius3. The counter format in contrib is for freeradius2
Other option: try to downgrade to freeradius 2 if you are able to do that.

Build optionally layouts in NextJS by detecting the browser URL value

all I would try to make some optional layout in NextJS. My problem is that I have found some method to check the browser URL then serve content according to these URL. But by this way the server content an browser content are no longer identical, hence the schema breaks.
Here an snippet of my trial:
export default ({children, title = 'title' }) => {
var
contact = false;
if (exenv.canUseDOM ){ if (window.location.href==="http://localhost:4000/contact" ) { contact= true}; }
else {const contact = false};
if (contact){ return( <div>Hey it is contact ! </div> ) }
else { // return normal layout
My console returns me predictably:
Warning: Text content did not match. Server:
So... I'm wondering if I have to make some custom settings on a custom NextJS server to grant the backend/frontend behaviors?
Or maybe there is a less expensive solution in the area?
Any hint would be great,
thanks
You can't remove that warning, it is appear because you just render that layout from client side, so there is a different between layout rendered by server and layout rendered by client.
I don't know what variable exenv.canUseDOM is, but you can use process.browser to detect if the current process is server side rendering or not.

Registration with profile picture using services in Drupal

I've been trying to upload a user profile picture during the user registration using Service 3 and so far I haven't had any luck. I tested passing a hard coded fid in the field "picture" and also tried to pass the fields "filemime", "filename", etc. and it didn't work neither.
Any idea about what fields I need to populate?
I guess it must be related to this post Using Drupal Services and DIOS SDK for setting user picture in iOS app
but it doesn't have and answer neither.
I use following code -
//Picture is first uploaded from ios using file service and fid is passed in $data object
$file_contents_object = file_load($data->picture_fid);
$file_contents_array['fid'] = $file_contents_object->fid;
$file_contents_array['uid'] = $file_contents_object->uid;
$file_contents_array['filename'] = $file_contents_object->filename;
$file_contents_array['uri'] = $file_contents_object->uri;
$file_contents_array['filemime'] = $file_contents_object->filemime;
$file_contents_array['filesize'] = $file_contents_object->filesize;
$file_contents_array['status'] = $file_contents_object->status;
$file_contents_array['timestamp'] = $file_contents_object->timestamp;
$file_contents_array['rdf_mapping'] = $file_contents_object->rdf_mapping;
//use your cck field here
$user_obj->field_user_profile_picture['und'][0] = $file_contents_array;
Hope this will help.

Show Filtered Lookup in CRM2011 from Silverlight Grid

I recently show up all products on a "Lookup" Field on a Inline Silverlight App on the CRM2011 Quote form.
I do this with directly calling the link of the Lookup:
var uri = (ScriptObject)crmUri.Invoke("create", string.Format("/_controls/lookup/lookupinfo.aspx?LookupStyle=single&objecttypes={0}", objectType));
var dArgs = (ScriptObject)HtmlPage.Window.CreateInstance("Object");
dArgs.SetProperty("items", new string[] { "" });
dynamic dlgResult = HtmlPage.Window.Invoke("showModalDialog", uri, dArgs, "dialogWidth:500px;dialogHeight:700px");
Our Customer wants to filter the lookup view on a value of a specific field on the product form.
This field is a optionset and can be 1 or 2.
I tried to add "&$filter=" + "producttypecode/Value" + " eq 1" or "&$filter=" + "producttypecode" + " eq 1" in the link, but this always Returns a error message.
Are there any suggestions?
This is a valid request that I just tested.
ProductSet?$filter=ProductTypeCode/Value eq 1
If that doesn't work I'd recommend the following troubleshooting steps.
Test your full URL in a browser first.
If it works in a browser then fire up fiddler and see what the difference is between the silverlight request and your manual request using a browser.
If you are having difficulty determining the correct full url I'd recommend downloading and becoming familiar with the CRM OData Query Designer. It will allow you to use a GUI to generate your request strings, and test them out. It can be found here.
http://crm2011odatatool.codeplex.com/
We solved this issue by adding a new System View and call it from its URL.

Dynamic ajax data loading with Backbone/Marionette (for ex. infinite scroll)

Can you suggest solutions for dynamic model loading with Backbone/Marionette like in case of infinite scroll?
My common code looks like:
Drivers = new AppList.DriverCollection
Drivers.url = $('#drivers-url').text()
Drivers.fetch()
Request goes to my django backend:
def ajax_get_drivers(request):
drivers = Driver.objects.all()
data = []
for driver in drivers:
data.append({
'id': driver.pk,
'name': driver.name,
'phone': driver.phone
})
response = json.dumps(data)
return HttpResponse(response, mimetype="application/json")
How to break it on parts?
Can you give more details for your question?
If you just want to make infinite scroll of loading models, I can show you a example. http://codeboard.org/#codes
You can find the loading model JS code in js/views/code/CodeListView.js, and the bind scroll event code in js/bootstrap.js, and php code in src/CodeBoard/Route/CodeRoute.php (On Github, you can review the source code).

Resources