unresolved reference issue

I am sure it is some kind of configuration issue or something else simple, but I can't figure out why I am getting an unresolved reference in my django app.

i have the following code:

    return render_to_response('patron/index.html',

                              { 'player' : player_info,

                                           'profile_attrs' : attrs },

                              mimetype='text/xml')

i get an unresolved reference on the 'paton/index.html', the file exists in my templates directory and the app works as expected.

i can fix this in 1 of 2 ways

    template='patron/index.html'

    return render_to_response(template,

                              { 'player' : player_info,

                                           'profile_attrs' : attrs },

                              mimetype='text/xml')

or
    return render_to_response(template='patron/index.html',
                              dictionary = { 'player' : player_info,
                                           'profile_attrs' : attrs },
                              mimetype='text/xml')
it seems that in both of the 'fixes', i am loosing some checking that i would like to have (in trying to figure this out, i mistyped the path and got no error)
why am i getting the error on the first example above?  is there a good work around that still gives me all the checking that i would like?
2 comments
Comment actions Permalink

my second fix:

    return render_to_response(template='patron/index.html',
                              dictionary = { 'player' : player_info,
                                           'profile_attrs' : attrs },
                              mimetype='text/xml')
does not work because template is not a keyword.  pyCharm doens't catch this either.
0
Comment actions Permalink
I have a similar issue with unresolved references in links (css, js and html) such as
     <script src="js/html5shiv.js"></script>.

I'm using Django Mezzanine and everything associated with static files is set up correctly (I've spent hours working on this).
     <script src="{% static "js/html5shiv.js" %}"></script>

The are no problems with reference to links in my app, just issues with references to the Mezzanine files.

When I do a manage.py collectstatic, everything is found and collected correctly.  Also everything is found correctly when running/debugging from the IDS just that it shows up as a warning in the editor.  Oddly, if I click on the file name and choose Find Usages, it finds the usages, just doesn't recognize it for purposes of inspection

I love the Unresolved References feature in PyCharm but when most of my references show as warnings, this defeats the purpose of the feature.

The fixes you mention don't apply in this case because these are src references in links and not variables/parameter.
0

Please sign in to leave a comment.