django 1.10 Exception while resolving variable is_popup in template admin/login.html

2024/11/18 11:19:50

I create a new django project with python3.5 and django1.10.0,I keep getting an error in the admin whenever I want access localhost:8000/admin, He`re's the error:

[DEBUG]- Exception while resolving variable 'is_popup' in template 'admin/login.html'.
Traceback (most recent call last):File "C:\Python\Python35\lib\site-packages\django\template\base.py", line 885, in _resolve_lookupcurrent = current[bit]File "C:\Python\Python35\lib\site-packages\django\template\context.py", line 75, in __getitem__raise KeyError(key)
KeyError: 'is_popup'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "C:\Python\Python35\lib\site-packages\django\template\base.py", line 891, in _resolve_lookupif isinstance(current, BaseContext) and getattr(type(current), bit):
AttributeError: type object 'RequestContext' has no attribute 'is_popup'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "C:\Python\Python35\lib\site-packages\django\template\base.py", line 900, in _resolve_lookupcurrent = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'is_popup'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "C:\Python\Python35\lib\site-packages\django\template\base.py", line 907, in _resolve_lookup(bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [is_popup] in "[{'True': True, 'None': None, 'False': False}, {'perms': <django.contrib.auth.context_processors.PermWrapper object at 0x04A2D1D0>, 'DEFAULT_MESSAGE_LEVELS': {'WARNING': 30, 'SUCCESS': 25, 'ERROR': 40, 'INFO': 20, 'DEBUG': 10}, 'user': <SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x04A0A590>>, 'messages': <django.contrib.messages.storage.fallback.FallbackStorage object at 0x04A0A490>, 'request': <WSGIRequest: GET '/admin/login/?next=/admin/'>, 'csrf_token': <SimpleLazyObject: <function csrf.<locals>._get_val at 0x04581C90>>}, {}, {'has_permission': False, 'username': '', 'site_title': <django.utils.functional.lazy.<locals>.__proxy__ object at 0x03CF82B0>, 'next': '/admin/', 'site': <django.contrib.sites.requests.RequestSite object at 0x04A0A6D0>, 'app_path': '/admin/login/?next=/admin/', 'site_url': '/', 'site_name': '127.0.0.1:8000', 'available_apps': [], 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us', 'form': <AdminAuthenticationForm bound=False, valid=Unknown, fields=(username;password)>, 'site_header': <django.utils.functional.lazy.<locals>.__proxy__ object at 0x03CF8310>, 'title': 'Log in'}]"
2016-10-16 09:31:59,199 [Thread-7:11460] [django.template:929] [base:_resolve_lookup] [DEBUG]- Exception while resolving variable 'is_popup' in template 'admin/login.html'.
Traceback (most recent call last):File "C:\Python\Python35\lib\site-packages\django\template\base.py", line 885, in _resolve_lookupcurrent = current[bit]File "C:\Python\Python35\lib\site-packages\django\template\context.py", line 75, in __getitem__raise KeyError(key)
KeyError: 'is_popup'

Anyone can help me,thanks very much!

Answer

I came across this error, and it turned out to be because I had put SESSION_COOKIE_SECURE = True in my main settings file and forgotten to put SESSION_COOKIE_SECURE = False in my dev settings (as with the OP this was while using manage.py runserver, so secure cookies were not possible).

https://en.xdnf.cn/q/71066.html

Related Q&A

Programmatically extract data from an Excel spreadsheet

Is there a simple way, using some common Unix scripting language (Perl/Python/Ruby) or command line utility, to convert an Excel Spreadsheet file to CSV? Specifically, this one:http://www.econ.yale.e…

Is it possible to specify the driver dll directly in the ODBC connection string?

Im trying to use pyodbc to connect to a SQL Server (MS SQL Server through FreeTDS) in a portable application; since its supposed to be standalone, I would like to avoid having to explicitly install the…

Escape New line character in Spark CSV read

Im working on Spark 2.2.1 version and using the below python code, I can able to escape special characters like @ : I want to escape the special characters like newline(\n) and carriage return(\r). I r…

How can a class that inherits from a NumPy array change its own values?

I have a simple class that inherits from the NumPy n-dimensional array. I want to have two methods of the class that can change the array values of an instance of the class. One of the methods should s…

Python/SQL Alchemy Migrate - ValueError: too many values to unpack when migrating changes in db

I have several models in SQLAlchemy written and I just started getting an exception when running my migrate scripts: ValueError: too many values to unpackHere are my models:from app import dbROLE_USER …

How to store Dataframe data to Firebase Storage?

Given a pandas Dataframe which contains some data, what is the best to store this data to Firebase?Should I convert the Dataframe to a local file (e.g. .csv, .txt) and then upload it on Firebase Stora…

Multiple characters in Python ord function

Programming beginner here. (Python 2.7)Is there a work around for using more than a single character for Pythons ord function?For example, I have a hex string \xff\x1a which Id like the decimal value …

Get minimum x and y from 2D numpy array of points

Given a numpy 2D array of points, aka 3D array with size of the 3rd dimension equals to 2, how do I get the minimum x and y coordinate over all points? Examples:First:I edited my original example, sin…

Extract Text with its Font Details (Style,Size,color,Italic etc) from a PDF in Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic…

How to keep track of status with multiprocessing and pool.map?

Im setting up a multiprocessing module for the first time, and basically, I am planning to do something along the lines offrom multiprocessing import pool pool = Pool(processes=102) results = pool.map(…