Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django - disable one of system checks
Is it possible to permamently disable only ONE (not all) of the system checks (for example E301)? Is it possible to change project settings.py to skip this system check for all ./manage.py commands? -
ImportError: No module named books.apps (Django)
I would like to use Django to create an app but got an error "ImportError: No module named books.apps" after running: python manage.py startapp books Error message: Traceback (most recent call last): File "manage.py", line 22, in execute_from_command_line(sys.argv) File "/Library/Python/2.7/site-packages/Django-1.9-py2.7.egg/django/core/management/init.py", line 350, in execute_from_command_line utility.execute() File "/Library/Python/2.7/site-packages/Django-1.9-py2.7.egg/django/core/management/init.py", line 324, in execute django.setup() File "/Library/Python/2.7/site-packages/Django-1.9-py2.7.egg/django/init.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/Library/Python/2.7/site-packages/Django-1.9-py2.7.egg/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/Library/Python/2.7/site-packages/Django-1.9-py2.7.egg/django/apps/config.py", line 116, in create mod = import_module(mod_path) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No module named books.apps Any idea what went wrong? Thanks! -
django - display the human readable when running Avg()
I'm figuring out this piece by piece. I want users to be able to rate blog posts based on 4 criteria (difficulty_rating, workload_rating, book_rating, attendance_rating). I have used choices in my models.py to give users a choice. After that, thanks to a user from StackOverflow, I was able to calculate the average for each of these values and display them at the top of every single post. The problem is that they show up as floats with long decimals. Is there a way to show the human readable instead? Which comes from my model tuples? I have done an {% if %} statement inside my template hardcoding everything, but I'm pretty sure there has to be a better way. models.py class Post(models.Model): STATUS_CHOISES = ( ('draft', 'Draft'), ('published', 'Published'), ) category = models.ForeignKey(Category) title = models.CharField(max_length=250) slug = models.SlugField(max_length=250, unique=True) content = models.TextField() seo_title = models.CharField(max_length=250) seo_description = models.CharField(max_length=160) author = models.ForeignKey(User, related_name='blog_posts', default=settings.AUTH_USER_MODEL) published = models.DateTimeField(default=timezone.now) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) status = models.CharField(max_length=9, choices=STATUS_CHOISES, default='draft') def get_absolute_url(self): return reverse('blog:post_detail', args=[self.slug]) def avg_ratings(self): return self.comments.aggregate( Avg('difficulty_rating', output_field=FloatField()), Avg('workload_rating', output_field=FloatField()), Avg('book_rating', output_field=FloatField()), Avg('attendance_rating', output_field=FloatField()), ) def __str__(self): return self.title class Comment(models.Model): difficulty_rating_choices = ( (1, 'Very Easy'), (2, 'Easy'), … -
Django PasswordResetTokenGenerator gives an invalid link
So I'm trying to make a form where the user enters their email if they forgot their password and it sends them a link to change it. The email sends fine but the link does not work. Here is my code: tokens.py class ResetTokenGenerator(PasswordResetTokenGenerator): def _make_hash_value(self, user, timestamp): return ( six.text_type(user.pk) + six.text_type(user.password) + six.text_type(timestamp) + six.text_type(user.is_active) ) password_reset_token = ResetTokenGenerator() views.py def reset(request, uidb64, token): try: uid = force_text(urlsafe_base64_decode(uidb64)) user = User.objects.get(pk=uid) except(TypeError, ValueError, OverflowError, User.DoesNotExist): user = None if user is not None and password_reset_token.check_token(user,token) and user.is_active: if request.POST: password_form = ResetPasswordForm(request.POST) if password_form.is_valid(): password = password_form.cleaned_data['password'] user.set_password(password) user.save() return HttpResponse("Success! <a href='/login/'>Login</a>") else: password_form = ResetPasswordForm() else: return HttpResponse('Invalid reset link') return render(request, 'register/reset_password_form.html', {'password_form':password_form}) urls.py urlpatterns = [ ... url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', views.reset, name='reset'), ] reset_password_email.html {% autoescape off %} Hi {{ email_entry }}, Please click on this link to reset your password: {{ domain }}{% url 'reset' uidb64=uid token=token %} {% endautoescape %} The view returns the else message "Invalid reset link" I am not sure which expression in the if statement is returning false. What can I do to make the form render? Thanks! -
setting up django & celery: location for celery path
I'm setting up celery based on an example and at this point... $ export PYTHONPATH=/webapps/hello_django/hello:$PYTHONPATH $ /webapps/hello_django/bin/celery --app=hello.celery:app worker --loglevel=INFO on my end set as samuel@samuel-pc:~/Documents/code/revamp$ export PYTHONPATH=/home/samuel/Documents/code/revamp/gallery:$PYTHONPATH samuel@samuel-pc:~/Documents/code/revamp$ /home/samuel/Documents/code/revamp/revamp/celery --app=revamp.celery:app worker --loglevel=INFO bash: /home/samuel/Documents/code/revamp/revamp/celery: No such file or directory not sure what it did to the path and this is what the result should be -------------- celery@django v3.1.11 (Cipater) ---- **** ----- --- * *** * -- Linux-3.2.0-4-amd64-x86_64-with-debian-7.5 -- * - **** --- - ** ---------- [config] - ** ---------- .> app: hello_django:0x15ae410 - ** ---------- .> transport: redis://localhost:6379/0 - ** ---------- .> results: disabled - *** --- * --- .> concurrency: 2 (prefork) -- ******* ---- --- ***** ----- [queues] -------------- .> celery exchange=celery(direct) key=celery [tasks] . testapp.tasks.test [2014-05-20 13:53:59,740: INFO/MainProcess] Connected to redis://localhost:6379/0 [2014-05-20 13:53:59,748: INFO/MainProcess] mingle: searching for neighbors [2014-05-20 13:54:00,756: INFO/MainProcess] mingle: all alone [2014-05-20 13:54:00,769: WARNING/MainProcess] celery@django ready. my guess is I need to set path to the path for celery installation, if so anyone who can tell me the path. -
Deploy Django app to Azure VS2017 - custom python
I've made a simple app with Django in Visual Studio 2017, utilizing the default template in Visual Studio (file - new - project - python - django web application). I've installed django PTVS through the azure portal and added a custom python extension. The app runs properly locally, but after i deploy it to Azure via Visual Studio, i can only access the page that shows: 'Your App Service app has been created.' I've read several posts (Deploy a simple VS2017 Django app to Azure - server error) and followed the following tutorials: https://docs.microsoft.com/en-us/visualstudio/python/managing-python-on-azure-app-service My web.config looks as follows: <?xml version="1.0"?> <configuration> <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <handlers> <remove name="Python27_via_FastCGI" /> <remove name="Python34_via_FastCGI" /> <add name="PythonHandler" path="handler.fcgi" verb="*" modules="FastCgiModule" scriptProcessor="D:\home\python361x64\python.exe|D:\home\python361x64\wfastcgi.py" resourceType="Unspecified" requireAccess="Script"/> </handlers> </system.webServer> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <appSettings> <add key="PYTHONPATH" value="%SystemDrive%\home\site\wwwroot" /> <add key="WSGI_HANDLER" value="DjangoWebProject2.wsgi.application()"/> <add key="DJANGO_SETTINGS_MODULE" value="app.settings" /> </appSettings> </configuration> -
Django admin: redirect to object change page if only one exists in list
I'm using Django for an application, and wondering about an option in the admin. Is it possible for django admin to redirect to the details page of an object, if only one exists in the list view? For example, if only this object exists: redirect immediately to the change view on this object, without needing the user to click on the object. I'm not using any custom view. I couldn't find any solution after 2 hours of search. Thanks! -
Vue resource and Django Rest Framework. How to update UserProfile with User primary key
models class UserProfile(models.Model): user = models.OneToOneField(User, primary_key=True) locations = models.ManyToManyField(Location, verbose_name="Location") ... DRF views class UserProfileView(generics.RetrieveUpdateAPIView): permission_classes = (IsAuthenticated,) serializer_class = UserProfileSerializer def get_object(self, queryset=None): return UserProfile.objects.get(user=self.request.user) def get(self, request, *args, **kwargs): return self.retrieve(request, *args, **kwargs) DRF urls url(r'^user/$', UserProfileView.as_view()), url(r'^user/(?P<pk>[0-9]+)/$', UserProfileView.as_view()), My Vue resource: Vue.http.patch(`${BASE_URL}/user/`, profile) But I got error like this: ValueError: Cannot assign "3": "UserProfile.user" must be a "User" instance How can I post User instance from Vue? (I'm trying to update location field sending PATCH like {user: 3, locations: [1, 2, 3]} -
django - Display averages in template
I'm making a blog where users can leave comments/ratings on my posts. I want to display the average of all ratings for that specific post. How do I do that? models.py class Post(models.Model): STATUS_CHOISES = ( ('draft', 'Draft'), ('published', 'Published'), ) category = models.ForeignKey(Category) title = models.CharField(max_length=250) slug = models.SlugField(max_length=250, unique=True) content = models.TextField() seo_title = models.CharField(max_length=250) seo_description = models.CharField(max_length=160) author = models.ForeignKey(User, related_name='blog_posts', default=settings.AUTH_USER_MODEL) published = models.DateTimeField(default=timezone.now) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) status = models.CharField(max_length=9, choices=STATUS_CHOISES, default='draft') def get_absolute_url(self): return reverse('blog:post_detail', args=[self.slug]) def __str__(self): return self.title class Comment(models.Model): difficulty_rating_choices = ( (1, 'Very Easy'), (2, 'Easy'), (3, 'Moderate'), (4, 'Hard'), (5, 'Very Hard'), ) workload_rating_choices = ( (1, 'Very Light'), (2, 'Light'), (3, 'Moderate'), (4, 'Heavy'), (5, 'Very Heavy'), ) book_rating_choices = ( (1, '$'), (2, '$$'), (3, '$$$'), (4, '$$$$'), (5, '$$$$$'), ) attendance_rating_choices = ( (1, 'Not Required'), (2, 'Required'), ) post = models.ForeignKey(Post, related_name="comments") user = models.CharField(max_length=250) email = models.EmailField() title = models.CharField(max_length=250) body = models.TextField() created = models.DateTimeField(auto_now_add=True) approved = models.BooleanField(default=False) difficulty_rating = models.IntegerField(choices=difficulty_rating_choices) workload_rating = models.IntegerField(choices=workload_rating_choices) book_rating = models.IntegerField(choices=book_rating_choices) attendance_rating = models.IntegerField(choices=attendance_rating_choices) def approved(self): self.approved = True self.save() def __str__(self): return self.title views.py def add_comment(request, slug): post = get_object_or_404(Post, slug=slug) if request.method == … -
'bytes' objects has no attribute '_randfanc'
Who can help solve the problem with the PyCrypto library? The problem is that you need to encrypt using the publickey (rsa_key) to session key (session_key) It returns out this code: Cipher = PKCS1_OAEP.new (rsa_key) Encrypt_session_key = cipher.encrypt (session_key) And at this stage, i have the error: 'Bytes' object has no attribute '_randfunc' Please do not offer other options, and help solve this problem! -
Deploy Django on Python 3.6.2
I have downloaded Python 3.6.2 (64 bit) in Windows 10 (64 bit). Now I want to work on Django framework so I want to download Django using pip command but it shows Error. C:\Windows\system32>pip install django Collecting django Using cached Django-1.11.4-py2.py3-none-any.whl Collecting pytz (from django) Using cached pytz-2017.2-py2.py3-none-any.whl Installing collected packages: pytz, django Exception: Traceback (most recent call last): File "c:\program files\python36\lib\site-packages\pip\basecommand.py", line 215, in main status = self.run(options, args) File "c:\program files\python36\lib\site-packages\pip\commands\install.py", line 342, in run prefix=options.prefix_path, File "c:\program files\python36\lib\site-packages\pip\req\req_set.py", line 784, in install **kwargs File "c:\program files\python36\lib\site-packages\pip\req\req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "c:\program files\python36\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "c:\program files\python36\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files clobber(source, lib_dir, True) File "c:\program files\python36\lib\site-packages\pip\wheel.py", line 316, in clobber ensure_dir(destdir) File "c:\program files\python36\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir os.makedirs(path) File "c:\program files\python36\lib\os.py", line 220, in makedirs mkdir(name, mode) PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python36\\Lib\\site-packages\\pytz' -
Filtrer QuerySet with type of ForeignKey
here are a few models to represent a shop products and information about who bought them. class Bought(models.Model): date = models.DateTimeField(auto_now_add=True, auto_now=False) buyer = models.ForeignKey(User,default = None) class Product(models.Model): # abstract price = models.IntegerField(default = 0) bought = models.OneToOneField(Bought,default = None,blank=True,null=True) class Meta: abstract = True class Prod1(Product): # represents 1st kind of product #specific info about this Prod1... If i need to list of everything bought by a User, i would use the ForeignKey and get a QuerySet of Bought objects. From this QuerySet, how can i differentiate what kind of product has been bought by the User ?( Prod1, Prod2...) -
Deploy Django with channels and Dephne
i have developed a chatting app using django channels, now i want to deploy it using Dephne and django channels in webfaction server. i set everything including: settings.py redis_host = os.environ.get('REDIS_HOST', 'localhost') CHANNEL_LAYERS = { "default": { # This example app uses the Redis channel layer implementation asgi_redis "BACKEND": "asgi_redis.RedisChannelLayer", "CONFIG": {"hosts": [(redis_host, 6379)],}, "ROUTING": "chatbot.routing.channel_routing", }, } asgi.py import os from channels.asgi import get_channel_layer os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chatbot.settings") channel_layer = get_channel_layer() routing.py from channels.routing import route, include from channels import include channel_routing = [ # Include sub-routing from an app. include("Pchat.routing.websocket_routing", path=r"^/Pchat"), # Custom handler for message sending (see Room.send_message). # Can't go in the include above as it's not got a `path` attribute to match on. include("Pchat.routing.custom_routing"), ] PP_chat_index.js $(window).load(function() { $messages.mCustomScrollbar(); setTimeout(function() { welcomingMessage(); var ws_path = "/Pchat/webscok/"; socket = new WebSocket("ws://" + window.location.host); socket.onmessage = function(e) { var data = JSON.parse(e.data); chatMessage(data);} }, 100);}); but now when i try to connect using ws:// request i got this erorr in the Safari error console: WebSocket connection to 'ws://gadgetron.store/Pchat/webscok/' failed: Unexpected response code: 502 and when i try to run Dephne to a specific port number in the terminal: daphne -b 0.0.0.0 -p 22783 chatbot.asgi:channel_layer i got this erorr in … -
InterfaceError (binding parameter) while creating a model
I'd like my users to subscribe on car brands and follow related reviews and/or classified ads. I extended django's User model with: class Subscriptions(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) cars = JSONField(default=list) View function: def make_subscribe(request, make): subs = Subscriptions.objects.get_or_create(user=request.user) subs.cars.append({'make': make, 'reviews': True, 'listings': True}) return redirect("reviews:model-select", make=make) The error I get while attempting to subscribe: Any suggestion or feedback will be welcomed and greatly appreciated. Thank you. -
How to limit a specific number of users access to a Django-Python website?
I have three user types - System Admin, Group Admin and Operators. I want to limit the number of Operators logging in to the site to 16 only. Any number of System Admins and Group Admins may login. It is a Django-Python website. How can I do it? -
Django templates don't load, even though the url changes
I have spent so much time trying to solve this issue but don't know where the problem lies since there are no errors popping up. It simply doesn't work. mysite/ manage.py mysite/ __init__.py settings.py urls.py wsgi.py Home/ templates/ Home/ Home.html Application/ templates/ Application/ Apply.html In my Home.html I have a link: <a href="{% url 'Application:Apply' %}">Apply Now!</a> When I click on it, the url changes to /Apply but I remain on the same page. (It also seems like the Home.html is getting reloaded since I need to scroll down the page to click on that link and once I click it, it gets me back to the top of the page). mysite/urls.py from django.conf.urls import url, include from django.contrib import admin from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^', include('Application.urls', namespace = 'Application')), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) Application/urls.py from django.conf.urls import url, include from . import views app_name = "Application" urlpatterns = [ url(r'Apply', views.Apply, name = 'Apply'), ] Application/views.py from django.shortcuts import render def Apply(request): return render(request, 'Application/Apply.html') I would greatly appreciate any advice since I cannot move on with my project until I figure that out. -
Django OSError: [Errno 13] Permission denied
I am new in python and Linux and apologize in advance for any confusion. I am trying to collect my static files using python manage.py collectstatic but something error here are my tracebacks Copying '/var/www/Django/myweb/static/images/test.jpg' Traceback (most recent call last): File "manage.py", line 22, in execute_from_command_line(sys.argv) File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/core/management/init.py", line 363, in execute_from_command_line utility.execute() File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/core/management/init.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 199, in handle collected = self.collect() File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 124, in collect handler(path, prefixed_path, storage) File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 364, in copy_file self.storage.save(prefixed_path, source_file) File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/core/files/storage.py", line 54, in save return self._save(name, content) File "/home/test01/Django/VENV/local/lib/python2.7/site-packages/django/core/files/storage.py", line 321, in _save os.makedirs(directory) File "/home/test01/Django/VENV/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/var/www/staticfiles/images' and I also try sudo python manage.py collectstatic File "manage.py", line 17, in "Couldn't import Django. Are you sure it's installed and " ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment? and here is my setting.py STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ] STATIC_ROOT = '/var/www/staticfiles' -
Where to put routines in Django project?
I have rather vast implementation of functionality needed for processing specific type of data stored in my Django DB (7 interconnected files containing ~100 lines of code each). There's a facade method in one of those files that I call from related method in views.py so that there is no mess inside of views file. For now I put everything inside a new folder in the same directory where settings.py urls.py and wsgi.py are, but now every time I'm calling makemigrations I receive a handful of unrelated information that has nothing to do with changes in data model. What is the best place to store those routines? -
Does it required a slugfield's must be unique in django?
im using slugfield in django model's and i've set slugfield to be unique for a reason so that my post should be unique, my slug include's a combination of title and it's object primary key my slugfield's are generating a slug's as an example like: slug url : whats-your-favourite-character-from-the-defenders-1 and the number at the end of my slug represent's primary key ' as you see primary key in my slug which already make's an url unique , so does it make sense that i should use unique attribute in slugfield ! because my problem is when i update my existed object it throws an error IntegrityError: UNIQUE constraint failed: polls_question.id -
Is it possible to view, modify, delete data in one specific gridView(dataset) with Django?
With C# for instance, you can bind data from a table to a dataset and display it in a gridview where you can edit the data directly. The dataset can actually contain an entire database table for instance. Is it possible to do the same with Django? -
Is it reliable to build desktop applications using web frameworks like Django?
Is it reliable to build desktop applications using web frameworks like Django? The idea is to build the interface with HTML, CSS, and JavaScript use Python and Django for backend operations (calculations, storage and databases, etc) and then run a server locally so that the interaction with the application is done through the browser other local devices can access the application by connecting to the device on which the server is running. If that is possible and yields a reliable experience, then is the development server that comes with Django enough? If no, what servers are most suitable for our purpose? Is Nginx good for example? what database should be used? PostgreSQL, MySQL, etc? The app will need to store a large number of entries. -
Sending message with Facebook Api without webhook
there is a FB login on my website, i can see Facebook user id which login to my website via fb login. I need to notify them with Fb messenger, is there need Webhook? can i send them message without waiting send message to my page. When i used them fb user id on fb login, graph api return an error and it says "No matching user found". What is the problem? -
django selenium Import Error
I have several issues during testing via selenium. When I try conduct python2 game_test.py I received: Traceback (most recent call last): File "game_tests.py", line 1, in <module> from selenium import webdriver ImportError: No module named selenium After python3 game_test I received: Traceback (most recent call last): File "game_tests.py", line 2, in <module> from city_engine.models import City ImportError: No module named 'city_engine' Whats going on? -
Update DOM without reloading the page in Django
I have two picklists in DOM, first is populated during loading of URL when a method in views loads the page. Second picklist's content depends on what user selects in first picklist. How do I bind python method to event when user makes a selection in first picklist, and then populate second without refreshing the page? -
Using Form in Django - get() missing 1 required positional argument: 'header'
currently working in Django and trying to do a simple tutorial on forms, but I am receiving an error when the form is submitted. Here is my urls.py: from .views import* urlpatterns = [ url(r'^name/', get_name, name='TheName'), url(r'^name/present/', present, name='Present'), ] Here are the views: def get_name(request): if request.method == 'POST': form = NameForm(request.POST) if form.is_valid(): return HttpResponseRedirect else: form = NameForm() return render(request, 'home/name.html', {'form': form}) def present(request): return render(request, 'home/present.html') Here is the form: class NameForm(forms.Form): your_name = forms.CharField(label='Your name', max_length=100) Here is name.html: <form action="present/" method="post"> {% csrf_token %} {{ form }} <input type="submit" value="Submit" /> </form> Here is my present.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{{ your_name }}</title> </head> <body> </body> </html> After submit is clicked, and error message with the traceback: Environment: Request Method: POST Request URL: http://localhost:8000/name/present/ Django Version: 1.11.4 Python Version: 3.6.2 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback: File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/deprecation.py" in __call__ 142. response = self.process_response(request, response) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/middleware/clickjacking.py" in process_response 32. if response.get('X-Frame-Options') is not None: Exception Type: TypeError at /name/present/ Exception Value: get() missing 1 required positional argument: 'header' …