Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Migration issue Django + Heroku
I have a django app running on heroku. I'm trying to make a migrate using heroku run python manage.py migrate I first made a makemigrations which detected correctly the changement in my models.py Here is the error message after the migrate : Running python manage.py migrate on β¬’ icontrol... up, run.3314 (Standard-1X) Operations to perform: Synchronize unmigrated apps: suit, suit_redactor, s3direct, corsheaders, suit_sortable Apply all migrations: tastypie, sessions, PowertrainExhibit, admin, auth, contenttypes Synchronizing apps without migrations: Creating tables... Installing custom SQL... Installing indexes... Running migrations: Applying PowertrainExhibit.0004_auto_20161207_1015...Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **options.__dict__) File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute output = self.handle(*args, **options) File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 160, in handle executor.migrate(targets, plan, fake=options.get("fake", False)) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 63, in migrate self.apply_migration(migration, fake=fake) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 97, in apply_migration migration.apply(project_state, schema_editor) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/migration.py", line 107, in apply operation.database_forwards(self.app_label, schema_editor, project_state, new_state) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/operations/fields.py", line 139, in database_forwards schema_editor.alter_field(from_model, from_field, to_field) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/schema.py", line 473, in alter_field self._alter_field(model, old_field, new_field, old_type, new_type, old_db_params, new_db_params, strict) File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/schema.py", line 617, in _alter_field sql, params = tuple(zip(*actions)) Any β¦ -
django.contrib.gis.geoip.base.GeoIPException: GeoIP path must be provided via parameter or the GEOIP_PATH setting
from django.contrib.gis.geoip import GeoIP g = GeoIP() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/django/contrib/gis/geoip/base.py", line 94, in init raise GeoIPException('GeoIP path must be provided via parameter or the GEOIP_PATH setting.') django.contrib.gis.geoip.base.GeoIPException: GeoIP path must be provided via parameter or the GEOIP_PATH setting. -
Django: Return render hashable error
I have the following code currently: url = "http://www.andes.ucmerced.edu/smap/backend/api/query\? key\=9te21wWjfSZuq9aYqPqfwa3S8qBYAWP5zlav" query = "select data in (now -1440minutes, now) where Metadata/Location/Building='Facilities A' and Metadata/Location/Room ='130' and Metada/Haystack/Tags ~ 'temp'" r = requests.post(url, data=query).json() query1 = "select data in (now -1440minutes, now) where Metadata/Location/Building='Facilities A' and Metadata/Location/Room ='130' and Metada/Haystack/Tags ~ 'flow'" r1 = requests.post(url, data=query1).json() query2 = "select * where Metadata/Location/Building='Facilities A' and Metadata/Location/Room ='130'" r2 = requests.post(url, data=query2).json() query3 = "select data in (now -1440minutes, now) where Metadata/Location/Building='Facilities A' and Metadata/Location/Room ='130'" r3 = requests.post(url, data=query3).json() N_func = [] for datum in r3: for datum1 in r2: if datum['uuid'] == datum1['uuid']: if len(datum['Readings']) == 0: N_func.append(datum1) for datum in N_func: r = datum['Path'].split('/') datum['Path'] = r return render(request, 'polls/room_130.html', {'Temp': r}, {'Flow': r1}, {'N_Func': N_func},) I get an error saying Traceback (most recent call last): File "C:\Python27\lib\wsgiref\handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "C:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", line 63, in __call__ return self.application(environ, start_response) File "C:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 174, in __call__status = '%d %s' % (response.status_code, response.reason_phrase) File "C:\Python27\lib\site-packages\django\http\response.py", line 67, in reason_phrase return responses.get(self.status_code, 'Unknown Status Code') TypeError: unhashable type: 'dict' [08/Dec/2016 05:07:31] "GET /polls/layout/room_130/ HTTP/1.1" 500 59 Kindly let me know what the reason could be . I have β¦ -
How to get penultimate query from QuerySet in Django?
How to get penultimate item from Django QuerySet? I tried my_queryset[-2] (before check whether the my_queryset length is greater than 1) if len(my_queryset)>1: query = my_queryset[-2] and it returns: Exception Value: Negative indexing is not supported. Is there some "Django" way to get such item? The only thing which comes to my mind is to reverse the queryset and get my_queryset[2] but I'm not sure about its efficiency. -
Django - heroku, crash on deploy / run.
My app seems to run fine locally with "heroku local web" When I push it to heroku, it goes but seems to crash. I thought this was an issue with the Procfile but am now unsure. I have read the heroku documents on deploying with django and followed a number of YouTube tutorials. I'm just lacking the experience to understand what the issue is here. heroku logs: 2016-12-08T12:00:53.156174+00:00 heroku[slug-compiler]: Slug compilation started 2016-12-08T12:00:53.156184+00:00 heroku[slug-compiler]: Slug compilation finished 2016-12-08T12:00:53.309072+00:00 heroku[web.1]: State changed from crashed to starting 2016-12-08T12:00:58.260750+00:00 heroku[web.1]: Starting process with command `gunicorn demonstration.wsgi` 2016-12-08T12:01:00.654433+00:00 app[web.1]: bash: gunicorn: command not found 2016-12-08T12:01:00.734784+00:00 heroku[web.1]: Process exited with status 127 2016-12-08T12:01:00.747378+00:00 heroku[web.1]: State changed from starting to crashed 2016-12-08T12:01:17.045591+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=git-api-example.herokuapp.com request_id=5849efad-36bb-4fe3-9b08-b284d54c4dbf fwd="188.141.73.136" dyno= connect= service= status=503 bytes= 2016-12-08T12:01:18.314297+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=git-api-example.herokuapp.com request_id=c76d3c5f-19f2-48ac-8266-52627cdfac55 fwd="188.141.73.136" dyno= connect= service= status=503 bytes= (github-api-app) β demonstration git:(master) Procfile: demonstration git:(master) cat Procfile web: gunicorn demonstration.wsgi Directory structure below the Procfile: (github-api-app) β demonstration git:(master) tree demonstration demonstration βββ __init__.py βββ old_settings.py βββ __pycache__ β βββ __init__.cpython-35.pyc β βββ settings.cpython-35.pyc β βββ urls.cpython-35.pyc β βββ wsgi.cpython-35.pyc βββ settings β βββ __init__.py β βββ local.py β βββ production.py β¦ -
Django rest transform flat data to relational data in serializer
I have a setup where I need to write an API for an existing javascript datamodels which i do not want to touch (for now). The javascript data has a different architecture than I want to have on the server. So my goal is to transform the data that I get from javascript to fit my database model when data is sent to the API. When data is requested from the API, it should match the expected data model of javascript. I wonder if I can do that with ModelSerializers, if yes, where is the right place to transform the data? In the view? In the serializer. My setup is like so: //javascript structure { scores: [ { id: 12, points: 2 maxpoints: 12 siteuxid: 'EXAMPLE' }, { ... } ] } //More models in django { scores: [ { id: 12, points: 2, question: { id: 12, maxpoints: 12, siteuxid: 'EXAMPLE' } }, ] } Are there any examples anyone can point me to, that achive the same? Basically it is all about having different data structures in server and client and making them compatible. Googleing did not help. -
How to Consume POST Rest API on Django Web? want to consume API of User registration in django and here is the code which i have done
In Views.py this the code in view.py def Save(request): if request.method == "POST": user=request.POST email=user.get("email") password=user.get("password") print "password",password display_name= request.POST.get('displayname') hometown = request.POST.get('hometown') gender = request.POST.get('radios') occupation= request.POST.get('occupation') services.post_register(email,password,display_name,gender) in Service.py code is- service.py def post_register(email,password,display_name,gender): postdata={'email':email,'password':password,'display_name':display_name,'gender':gender,'} response = requests.post('http://www.example.com/rest-auth/users/1/', data=json.dumps(postdata)) afer running this i am getting response 415. thank you -
Skip creating some DB tables from third-party packages
I am using django-celery package. And I need just functionality for PeriodicTasks and I do not need some of the tables, such as: djcelery_workerstate, djcelery_taskstate, etc. Is there is a way to skip creating some of the tables? Something like admin.site.unregister(ModelName) in admin. -
Celery 4.0.0: No such transport: django
I followed the "First steps with Django" tutorial for Celery 4.0.0: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html This all works as expected. However, if I then try to change the transport from AMQP to the Django ORM by adding this to the end of settings.py: CELERY_BROKER_URL = 'django://' Then when I run the worker process (celery -A proj worker), I get an error: Traceback (most recent call last): File "/home/ac/src/proj/.pyenv/bin/celery", line 11, in <module> sys.exit(main()) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/__main__.py", line 14, in main _main() File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 326, in main cmd.execute_from_commandline(argv) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 488, in execute_from_commandline super(CeleryCommand, self).execute_from_commandline(argv))) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/base.py", line 278, in execute_from_commandline return self.handle_argv(self.prog_name, argv[1:]) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 480, in handle_argv return self.execute(command, argv) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/celery.py", line 412, in execute ).run_from_argv(self.prog_name, argv[1:], command=argv[0]) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/worker.py", line 221, in run_from_argv return self(*args, **options) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/base.py", line 241, in __call__ ret = self.run(*args, **kwargs) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/bin/worker.py", line 255, in run **kwargs) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/worker/worker.py", line 99, in __init__ self.setup_instance(**self.prepare_args(**kwargs)) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/worker/worker.py", line 120, in setup_instance self._conninfo = self.app.connection_for_read() File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/app/base.py", line 732, in connection_for_read return self._connection(url or self.conf.broker_read_url, **kwargs) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/celery/app/base.py", line 808, in _connection 'broker_connection_timeout', connect_timeout File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/kombu/connection.py", line 179, in __init__ if not get_transport_cls(transport).can_parse_url: File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/kombu/transport/__init__.py", line 81, in get_transport_cls _transport_cache[transport] = resolve_transport(transport) File "/home/ac/src/proj/.pyenv/local/lib/python2.7/site-packages/kombu/transport/__init__.py", β¦ -
Can't run uwsgi .ini file with systemd emperor
I am trying to set up uwsgi.service to run on systemd for Django 1.10 on Linode with Fedora 24. /etc/systemd/system/uwsgi.service [Unit] Description=uWSGI Emperor After=syslog.target [Service] ExecStart=/home/ofey/djangoenv/bin/uwsgi --ini /etc/uwsgi/emperor.ini Restart=always KillSignal=SIGQUIT Type=notify StandardError=syslog NotifyAccess=all [Install] WantedBy=multi-user.target This should then call, /etc/uwsgi/emporer.ini [uwsgi] emperor = /etc/uwsgi/vassals uid = www-data gid = www-data limit-as = 1024 logto = /tmp/uwsgi.log I then use a symbolic link, $ sudo ln -s /home/ofey/djangoForum/django.ini /etc/uwsgi/vassals/ to /home/ofey/djangoForum/django.ini [uwsgi] project = djangoForum base = /home/ofey chdir = %(base)/%(project) home = %(base)/djangoenv module = crudProject.wsgi:application master = true processes = 2 socket = 127.0.0.1:3031 chmod-socket = 664 vacuum = true I have restarted all with, $ sudo systemctl daemon-reload $ sudo systemctl restart nginx.service $ sudo systemctl retart uwsgi.service The last command gives, Job for uwsgi.service failed because the control process exited with error code. See "systemctl status uwsgi.service" and "journalctl -xe" for details. $ sudo systemctl status uwsgi.service gives, β uwsgi.service - uWSGI Emperor Loaded: loaded (/etc/systemd/system/uwsgi.service; disabled; vendor preset: disabled) Active: inactive (dead) Dec 07 23:56:28 ofeyspi systemd[1]: Starting uWSGI Emperor... Dec 07 23:56:28 ofeyspi uwsgi[7834]: [uWSGI] getting INI configuration from /etc/uwsgi/emperor.ini Dec 07 23:56:28 ofeyspi systemd[1]: uwsgi.service: Main process exited, code=exited, status=1/FAILURE Dec 07 23:56:28 ofeyspi β¦ -
how to print bar code on pdf while converting html file to pdf in django
I have to dynamically generate html file to pdf with different values as well as have to print barcode on that generated pdf, i am using django framework for this, i have generated file into pdf but could not print bar code in pdf. Here is my code. def testing_pdf(request): image = treepoem.generate_barcode( barcode_type='qrcode', data='barcode payload', options={}, ) template = get_template('pdf-template/index.html') context_dict = { 'name':'Pankaj','event': 'testing', 'barcode':image} context = Context(context_dict) html = template.render(context) result = StringIO.StringIO() pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("utf-8")), result) if not pdf.err: response = HttpResponse(result.getvalue(), content_type='application/pdf') return response return HttpResponse('We had some errors<pre>%s</pre>' % escape(html)) And also using this code pdf file is not propery generated. -
JsonResponse dont return data in template
I have an issue, I have django 1.7 and I make a view where I want to receive information sent by jquery 2.1.1, I can receive the information in the view and print it and everything, but when I use the JsonResponse to send the json to my function in the template, and I use a console.log to view the json, nothing happen. Am I coding something wrong? Thank you. views.py def filtro(request): if request.is_ajax(): carrera = Event.objects.filter(category__name = request.GET['id']) reponse = JsonResponse({'name' : carrera.name, 'age' : carrera.summary}) return HttpResponse(response.content) else: return ('/') urls.py url(r'^filtro/$', 'apps.eventos.views.filtro', name="filtro"), eventos.html $('.list li a').on('click', Filtrar); function Filtrar(){ var id = $(this).text() $.ajax({ data : {'id' : id}, url : '/filtro/', type : 'get', success: function(data){ console.log(data); } }); }; When someone make a click on any "a" tag, I want to show the information by json from my models.. Thats all I want. -
how to save data into foriegn key in django
In my django project i have two model categoty and another is lead category is a model into third party app.which i am using. class CustomerLeads(models.Model): customer_name = models.CharField(max_length=50,null=True, blank=True) item_required = models.ForeignKey(Category,null=True, blank=True) Views.py if request.method == 'POST': name = request.POST['customername'] item = request.POST['item'] customer_lead_obj = CustomerLeads.objects.create(customer_name = name) customer_lead_obj.item_required = item customer_lead_obj.save() when i want to save, a error come Cannot assign "u'Saari'": "CustomerLeads.item_required" must be a "Category" instance. here saari is value which i get from posting the form -
Django/DRF return HttpResponse from dispatch method
from rest_framework import viewsets from rest_framework.response import Response class CustomModelViewSet(viewsets.ModelViewSet): def dispatch(self, *args, **kwargs): mid = kwargs.get('mid') if not mid: return super(CustomModelViewSet, self).dispatch(*args, **kwargs) try: mm = MyModel.objects.get(mid=mid)) print mm return super(CustomModelViewSet, self).dispatch(*args, **kwargs) except MyModel.DoesNotExist: data = {'msg': 'not found'} return Response(data=data, status=404) class MyModelViewSet(CustomModelViewSet): model = MyModel serializer_class = MyModelRetrieveSerializer queryset = MyModel.objects.all() def retrieve(self, request, *args, **kwargs): try: mm = MyModel.objects.get(mid=mid)) except MyModel.DoesNotExist: data = {'msg': 'not found'} return Response(data=data, status=404) serializer = self.get_serializer(mm) return Response(serializer.data) I'm trying to get rid of try/except block in retrieve action so i wrote the same code in dispatch method. so whenever i pass valid mid i get perfect response without any warning or error but when I pass invalid mid i get this error URL: /api/mymodel/{mid}/ { "error": [ "AssertionError(u'.accepted_renderer not set on Response',)", "Assertion failed." ] } -
Bash on Ubuntu on Windows 10 and Django virtualenv
I want to use Bash + vs code + virtualenv + PEP8 for Django development. In Ubuntu I was opening editor using .code command inside activated virtual environment and it gives me intellisense. But using windows bash i can use only linux apps. How can i use linter and intellisense in editor using Linux virualenv in Windows? -
TypeError: EventList is not a constructor in one place, in another code works
Strange sistuation, I have django (1.8) app with feature in js. In one place everything is OK but in another I get an error: Uncaught TypeError: EventList is not a constructor Code in js file: var EventList=function(){}; ... ... Code in HTML file, in js code block: <script src="{% static 'js/event_list.min.js' %}" type="text/javascript </script> <script type="text/javascript"> eventList = new EventList(); eventList.init(); </script> -
How to render Form Choices manually
I have in form.py SELECT_PRODUCT = [ ('item1', 'item1'), ('item2', 'item2'), ('item3', 'item3'), ('item4', 'item4'), ] class OrderBonus(forms.Form): select_product = forms.CharField(widget=forms.RadioSelect(choices=SELECT_PRODUCT )) in html i need to render each choice individually: <select name="{{ form_bonus.select_product .name }}"> <option value="{{form_bonus.select_product.field.choice.0}}">{{form_bonus.select_product.field.choice.0}}</option> </select> I try different ways: 1) form_bonus.select_product.field.choice.0 2) form_bonus.select_product.field.choice.[0] 3) form_bonus.select_product.field.choice.("0") I try iteration: {% for choice in form_bonus.select_product.field.choices %} {{ choice }} {% endfor %} or {% for value, text in form_bonus.select_product.field.choices %} {{ value}} - {{ text }} {% endfor %} Some one know how to maybe overwrite the Select Widget to use each choice: form_bonus.select_product.field.choice.0 ect. Python 3.5.2 and Django 1.10 -
Isn't there any way to select attributes from multiple tables by non-pk-column with hitting DB once in Django model?
I apologize for my overlong title. class Menu(models.Model): menu_code = models.IntegerField(blank=False, null=False) # It expresses order of menu items so it often can be changed. menu_title = models.CharField(max_length=20, blank=False, null=False) submenu_title = models.CharField(max_length=20, blank=True, null=True) class Board(models.Model): title = models.CharField(max_length=200, blank=False, null=False) date = models.DateTimeField(default=timezone.now) menu = models.ForeignKey(Menu) Above is a part of my models.py. And what I want to do is just like below in SQL. SELECT * FROM Board B, Menu M WHERE B.menu_id=M.menu_id and M.menu_title='cat'; or SELECT * FROM Board B INNER JOIN Menu M ON B.menu_id=M.menu_id and M.menu_title='cat'; I've seen many questions and answers about it and they supposed to use 'select_related', but mine has a slight difference with their problems. 'menu_title' isn't a PK of Menu table, so filter method of Board table cannot find that attribute. Is there any solution? Or do I have to change my model design? -
How to select related in django model so it wont generate a lot of subqueries
I have lot of models that are referring to each other in some way, for example: Port is referring to City, which in its turn refers to Country. Then in django admin I want to show in list_display Ports country: class Country(models.Model): title = models.CharField() class City(models.Model): title = models.CharField() country = models.ForeignKey(Country) class Port(models.Model): city = models.ForeignKey(City) def __str__(self): return self.city.county.title So basically for each port django is generating more queries. I assume that select_related would help me somehow in this case, but how to use it properly within the model? -
Download / save the state of each flag / checkbox from the database
Please help! Django (ver 1.10), can any. As in the code can be set / select / activate. CHOICES = forms.MultipleChoiceField(choices=simple, widget=forms.SelectMultiple) How to download the status of each flag from the database. How to save the state of each flag in the database. How to properly check the status of each flag in the model, and if it is set to do different actions. In order not to write a bunch of if. flag this checkbox in MultipleChoiceField. It is desirable to sample code. Thank you very much in advance! -
Django FormWizard on Django default built in template
class Company(models.Model): company_name = models.CharField(max_length=60) company_description = models.TextField(blank=True) admin.site.register(Employer,EmployerAdmin) have been used to register this model to admin form. I would like to seperate this form into 2 steps which I fill in the company_name, "Next" to fill in the company_description. I have been Googling around for few days but things I saw is that all the example used custom html to do this. Can I use the default built-in template used in Django form instead of creating a custom html? Any help is appreciated. Thanks! -
Django refer to models defined in another application -> empty QuerySet
I have an app called projects with a model Project, that I want to refer in another app called map that has the model MapData. So I can use/access the data from Project in map.html template. According to the Django Docs. To refer to models defined in another application, you can explicitly specify a model with the full application label. For example, if the Manufacturer model above is defined in another application called production, youβd need to use: class Car(models.Model): manufacturer = models.ForeignKey( 'production.Manufacturer', on_delete=models.CASCADE, ) from projects.models.py class Project(models.Model): title = models.CharField(max_length=200) text = models.TextField() date = models.DateField() featured_image = models.ImageField( upload_to='projects/featured', blank=True) lon = models.DecimalField(max_digits=10, decimal_places=8, default=1) lat = models.DecimalField(max_digits=10, decimal_places=8, default=1) location = models.CharField(max_length=200, blank=True) from map.models.py from django.db import models from projects.models import Project class MapData(models.Model): map_data = models.ForeignKey(Project) But when I access to shell, I just get an empty QuerySet. >>> from map.models import MapData >>> MapData.objects.all() <QuerySet []> In regards to my map.models.py file, I have tried OneToOneField(Project) giving me same result. And I've tried map_data = models.ForeignKey(projects.Project) giving me a NameError, and putting map_data = models.ForeignKey('projects.Project') in quotes, also giving me an empty QuerySet. Can someone please explain what I'm not understanding here. β¦ -
Removing access of a particular model from a particular user in Django admin, but user is from a group having the access for that model
Suppose user1 is a staff member belonging to a group g1 in django admin. This group g1 is having access to say a model m1. Now I want to remove the access of m1 model from user1 without removing him from the group g1. How can it be done? -
I created image gallery using django. Now if I want to view each image with deepzoomviewer How should I approach it?
I created a static image gallery using django. so as an admin i upload images to website and as user i can see those images in gallery. I have created .dz files of large tiff files using vips and the associated folders are also there. Now how should I approach this problem to crat a page with deepzoom viewer and link the images to .dz and folder ? -
TypeError: sequence item 2: expected str instance, __proxy__ found
I have started learning python recently and I am not having much knowledge in django. Please provide me solution for this problem. Thanks in advance.. Problem: Having trouble while opening the admin-site Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f108dcbe620> Traceback (most recent call last): File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run self.check(display_num_errors=True) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/core/management/base.py", line 385, in check include_deployment_checks=include_deployment_checks, File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/core/management/base.py", line 372, in _run_checks return checks.run_checks(**kwargs) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/core/checks/registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/core/checks/urls.py", line 14, in check_url_config return check_resolver(resolver) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/core/checks/urls.py", line 24, in check_resolver for pattern in resolver.url_patterns: File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/utils/functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/urls/resolvers.py", line 310, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/utils/functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/home/srishti/bonustime/src/venv/lib/python3.5/site-packages/django/urls/resolvers.py", line 303, in urlconf_module return import_module(self.urlconf_name) File "/home/srishti/bonustime/src/venv/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 665, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/home/srishti/bonustime/src/server/bonustime/urls.py", line β¦