Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to use Django queries on a different machine
I have two servers. One is for database/Django (Machine A) the other one is for calculating stuff (Machine B). How could I enter data from Machine B to the database on Machine A while using django models. -
django-axes modelbackend requires 'request' to authenticate
In my application i have a custom user model using django-custom-user also i'm using allauth. Django-axes registers every login attempt on admin and allauth, but i have problems with the user login. Login view: def user_login(request): data = dict() if request.user.is_authenticated: return redirect('frontend:dashboard') if request.method == "POST": form = LoginForm(request.POST) if form.is_valid(): email = form.cleaned_data['email'] password = form.cleaned_data['password'] if user is not None: user = authenticate(email=email, password=password) if user.is_active: login(request, user) user_logged_in.send(sender=CustomUser, request=request, user=user) return redirect('frontend:dashboard') else: messages.error(request, _('Incorrect email or password.')) user_login_failed.send(sender=CustomUser, request=request, credentials={'username': form.cleaned_data.get('email')}) else: messages.error(request, _('Incorrect email or password.')) user_login_failed.send(sender=CustomUser, request=request, credentials={'username': form.cleaned_data.get('email')}) return redirect('auth:login') else: form = LoginForm() data['form'] = form return render(request, os.path.join(settings.AUTH_TEMPLATE, 'login.html'), data) When i try to login i'm getting this error: axes.backends.AxesModelBackend.RequestParameterRequired: DjangoAxesModelBackend requires calls to authenticate to pass `request` django axes documentation is a bit confusing and i don't understand what i have to do in solving this issue. I have to mention this error comes only when i add axes.backends.AxesModelBackend to AUTHENTICATION_BACKENDS which is mandatory. -
Passing entire dictionary to another page in Django/Python
I am trying to pass an entire dictionary from one page to another in Django, or ideally just use the object I have created from my action function in views.py in a new function. The first page after a user enters the parameters is a table, the idea is to create a new page that turns all the entries into editable text boxes when the user selects "amend". From the parameters the user inputs, it creates an object of custom type netcore views.py def action(request): core_dict_p1 = netcore(request.POST['fe_core'], request.POST['fe_core_type'], request.POST['fe_vrf'], request.POST['fe_code'], request.POST['fe_site_type']) core_dict_p1 = core_dict_p1.get_host_core() context = { 'core_dict_p1': core_dict_p1 } return render(request, 'confirm.html', context) This is passed to mnasnetmiko.py where class netcore is defined mnasnetmiko.py class netcore: #Receives paramters from web front-end def __init__(self, core, core_type, vrf, code, site_type): #Creates dictionary for network host object self.host_core = { "host": core, "username": "meg-mnas", "password": "OMITTED", "device_type": core_type, } self.vrf = vrf self.code = code self.site_type = site_type def get_host_core(self): ... How can I get the dictionary core_dict_p1 to pass to the new file amend.html ? I can work out how to make it all editable after, but I seem to be missing something fundemental. -
Import python variable to HMTL
I have an html page that processes wifi credentials and writes them to an interfaces file on the raspberry pi 3. The html file post_list_three.html is shown below {% extends 'device_interfaces/base.html' %} {% block content %} <h2>Static Configuration Page</h2> <form method="POST" class="post-form">{% csrf_token %} {{ form.as_p }} <button type="submit" class="save btn btn-default">Save</button> </form> {% endblock %} base.html is as follows {% load static %} <html> <body> <div class="page-header"> <a href="{% url 'post_list_three' %}" class="top-menu"><span class="glyphicon glyphicon$ <h1>Wi-Fi Static Configuration</h1> </div> <div class="content container"> <div class="row"> <div class="col-md-8"> {% block content %} {% endblock %} </div> </div> </div> </body> </html> I have a python file, tech_scripts.py, that writes the interfaces file and checks if the given credentials are correct to connect to the wifi. The code for checking wifi connection is called as a function in tech_scripts.py and its snippet is below def CheckConnection(): ps = subprocess.Popen(['iwconfig'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) try: output = subprocess.check_output(('grep', 'ESSID'), stdin=ps.stdout).decode() status = output.split('ESSID:')[1].split('/')[0] if status == 'off': print("Wi-Fi not connected") return False else: print("Wi-Fi connected") return True except subprocess.CalledProcessError: # grep did not match any lines print("No wireless networks connected") return False I want to retrieve what the above function returns(i.e True or False) and use … -
How to implement Notifications in Django?
I want to implement notification system in Django web Application. In Django for notification there are many packages available like Pinax, Pusher...etc, but I don't find proper implementation. In my case, I want to get notify user when a query created, updated or deleted into database(MySql). Please replay if any other way to implement it. -
Django unicode conversion stuck when saving in admin log?
1366, "Incorrect string value: '\xEF\xBC\x88Pac...' for column 'object_repr' at row 1" -
Serialize Django Request
I'd like to serialize the Django request in order to log it in a DB. I tried different approaches but none of them successfully. class RunTest(View): def get(self, request, url): srd = serializers.serialize('json', request) return HttpResponse(json.dumps(request.META)) But this raise the error module 'rest_framework.serializers' has no attribute 'serialize' Probably because I'm using the rest-framework as a Middleware. I also used srd = json.dumps(request) In this case the error is Object of type 'WSGIRequest' is not JSON serializable Any idea? Thank you a lot -
Django rest framework: relation using wrong field name
I have a model AppUser: class AppUser(models.Model): user = models.OneToOneField(settings.AUTH_USER_MODEL) foo_bar = models.ManyToManyField(FooBar) class Meta: db_table = 'accounts_app_user' A Rest-Framework serializer: class AppUserSerializer(serializers.ModelSerializer): foo_bar = serializers.PrimaryKeyRelatedField( allow_empty=True, many=True, queryset=FooBar.objects.all() ) And a view to update the model (extending RetrieveUpdateAPIView): class AppUserRetrieveUpdateAPIView(RetrieveUpdateAPIView): queryset = AppUser.objects.all() serializer_class = AppUserSerializer lookup_url_kwarg = 'user_id' lookup_field = 'user_id' def update(self, request, *args, **kwargs): partial = kwargs.pop('partial', False) instance = self.get_object() serializer = self.get_serializer_class()(instance, data=request.data, partial=partial) serializer.is_valid(raise_exception=True) # Validate and update User model user_serializer = UserSerializer(instance.user, data=request.data, partial=partial) user_serializer.is_valid(raise_exception=True) self.perform_update(serializer) self.perform_update(user_serializer) data = serializer.data data.update(**user_serializer.data) return Response(data) My problem is: when I call the endpoint to update the AppUser model, I get this error: column accounts_app_user_foo_bar.appuser_id does not exist HINT: Perhaps you meant to reference the column "accounts_app_user_foo_bar.app_user_id". In other words, it's looking for appuser_id, instead of app_user_id. I've tried modifying the foo_bar relation of the AppUser model: foo_bar = models.ManyToManyField(FooBar, related_name="app_user_id") But this makes no difference. [Python 3.6, Django 1.11, djangorestframework 3.6.3] -
django 2.1.4 migration fails with "DETAIL: Key columns "xxx" and "yyy" are of incompatible types: integer and character varying"
I'm trying to upgrade a django 1.11 based service to latest django 2.1.4. When running migrations ( during unit testing ) I now get the following error in an existing migration of my django application that did not happen before upgrade to latest django version !? DETAIL: Key columns "xxx" and "yyy" are of incompatible types: integer and character varying. How can such an existing django migration be fixed when upgrading to latest django version ? The models (snippet) changed from class Aaa(models.model): # id based on default primary key => integer based class Bbb(models.model): # id based on default primary key => integer based aaa = models.ForeignKey(Aaa, on_delete=models.CASCADE) to class Aaa(models.model): id = models.CharField(primary_key=True, max_length=36, editable=False) class Bbb(models.model): id = models.CharField(primary_key=True, max_length=36, editable=False) aaa = models.ForeignKey(Aaa, on_delete=models.CASCADE) The callstack of the exception during the migration (from scratch) when setting up the unit-test environment looks like the following : foo_aaa__________ ERROR at setup of ViewTests.test_aaa ___________ self = <django.db.backends.utils.CursorWrapper object at 0x7fa7ac64a240> sql = 'ALTER TABLE "foo_aaa" ALTER COLUMN "id" TYPE varchar(36) USING "id"::varchar(36)' params = [] ignored_wrapper_args = (False, {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fa7b5235780>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7fa7ac64a240>}) def _execute(self, sql, params, *ignored_wrapper_args): self.db.validate_no_broken_transaction() with self.db.wrap_database_errors: if params … -
Find products category and subcategory automatically after excel upload from google taxonomy in django
I am beginner in django and confused how to implement google product taxonomy in django app. below is a screenshot for upload button that i have been created in django i want to upload excel sheet which have id, product type,description and other fields in django app. The question is after submission there will be product category and subcategory for each products.like below image manual product taxonomy If excel uploaded with Product Title, I want to identify the product main category and the sub categories of where it belongs based on Google Taxonomy. Thankyou -
Customizing admin ui-widget in Wagtail
I use django-taggit 0.23.0 and wagtail 2.0.2. My preferred language is Persian (Farsi) in Wagtail's admin dashboard and one of my language letters is on the "comma" key of keyboard. So, each time I want to use that letter, tag gets submitted and I cannot add tags properly. How can I customize ui-widget in adding/editing tags in admin's dashboard? I also tried using these command lines in settings and overwriting its functions but yet didn't solve my problem: TAGGIT_TAGS_FROM_STRING = 'utils.comma_joiner' TAGGIT_TAGS_FROM_STRING = 'utils.comma_splitter' Any solution would be a lot appreciated!!! -
Django use regroup tag
I would like to use Django tag named regroup in order to sort my objects and associated objects. It the first time I'm using this tag and I need your help because I don't overcome to sort my queryset. I would like to get something like that : - Category 1 - Publication 1 - Document 1 - Document 2 - Publication 2 - Document 1 - Category 2 - Publication 3 - Document 1 - Category 3 - Publication 4 - Document 1 - Document 2 As you can see, for each category I display associated publications. Then, for common publications, I display associated documents. I would like to use regroup tag in order to do that. My model.py file looks like this : class Category(EdqmTable): name = models.CharField(max_length=200, verbose_name=_('name'), unique=True, null=False) class Publication(EdqmTable): pub_id = models.CharField(max_length=10, verbose_name=_('publication ID'), unique=True, default='') title = models.CharField(max_length=512, verbose_name=_('title'), null=False, unique=True) category = models.ForeignKey(Category, verbose_name=_('category'), null=False, related_name='publication') class Document(EdqmTable): code = models.CharField(max_length=25, verbose_name=_('code'), unique=True, null=False, blank=False) language = models.CharField(max_length=2, verbose_name=_('language'), choices=LANGUAGE_CHOICES, null=False, blank=False) format = models.CharField(max_length=10, verbose_name=_('format'), choices=FORMAT_CHOICES, null=False, blank=False) title = models.CharField(max_length=512, verbose_name=_('title'), null=False, blank=False) publication = models.ForeignKey(Publication, verbose_name=_('publication title'), related_name='documents') Each class are bounded with others thanks to ForeignKey : Category … -
Cannot assign "'Nokia1200'": "Order.pname" must be a "Product" instance
I have a 'Product' Model in which all the details of a product is available and I have a 'Order' Model with Foreign Key of Product Model. I am filtering the details on a particular field and trying to add that field in Order Model. I applied this concept on a particular field like this: Product.objects.filter(pname='Nokia1200').values('pname','catgry','brand'). But it's produced an error message. Form.html <form class="well form-horizontal" method="post" action="{% url 'new_order' %}"> {% csrf_token %} <fieldset> {% for n in ListPrdt %} <div class="form-group"> <label class="col-md-4 control-label">Select Product</label> <div class="col-md-6 inputGroupContainer"> <div class="input-group"> <span class="input-group-addon" style="max-width: 100%;"><i class="glyphicon glyphicon-list"></i></span> <select class="selectpicker form-control" name="pname"> <option>{{n.pname}}</option> </select> </div> </div> </div> <div class="form-group"> <label class="col-md-4 control-label">Category Name</label> <div class="col-md-6 inputGroupContainer"> <div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input id="fullName" name="catgry" placeholder="Full Name" class="form-control" required="true" value="{{n.catgry}}" type="text"> </div> </div> </div> <div class="form-group"> <label class="col-md-4 control-label">Brand Name</label> <div class="col-md-6 inputGroupContainer"> <div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input id="fullName" name="brand" placeholder="Full Name" class="form-control" required="true" value="{{n.brand}}" type="text"> </div> </div> </div> {% endfor %} <div class="form-group"> <label class="col-md-4 control-label">Quantity</label> <div class="col-md-6 inputGroupContainer"> <div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span><input id="email" name="qnty" placeholder="Email" class="form-control" required="true" value="" type="text"></div> </div> </div> <div class="form-group"> <label class="col-md-4 control-label">Price</label> <div class="col-md-6 inputGroupContainer"> <div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-earphone"></i></span><input id="phoneNumber" name="price" placeholder="Phone … -
Why is *SGI + Nginx/HTTP considered the best practice for deploying web applications?
My friend recently asked me the following question: given that Django already has runserver, why didn't wasn't it extended to be a production-ready customer-facing HTTP server? What people do instead is set up an uwsgi server that speaks WSGI and exposes something that Nginx forwards traffic to by reverse proxying... Based on what I know, many other languages use this pattern: there is a "simple" HTTP server meant for development, as well as an interface for *GI (ASGI/WSGI/FCGI/CGI) that web server is supposed to reverse proxy to. What is the main reason those web servers don't grow production-ready and instead assume presence of another web server? Here are some of my theories, but I'm not sure if I'm missing something more significant: History: dynamic websites date back to perl/PHP, both worked as a "dumb" CGI backend that was basically a filter that processed HTTP request (stdin) to a response (stdout). This architecture worked for some time and became a common pattern, Performance: web applications are often written in languages that don't JIT and having a web server written in such a language would introduce extra overhead while milliseconds matter. Also, this lets us speed up static file serving, Security: Django's … -
Django admin error "Please correct the errors below."
I have made custom Baseusermanager to create user but I am getting error of "please correct the errors below" when I add user from django admin panel and I can't find what's going wrong. Models.py: class UserManager(BaseUserManager): def create_user(self,email,password): user = self.model(email=email) user.set_password(password) def create_superuser(self,email,password): user = self.model(email=email) user.set_password(password) user.is_admin = True user.is_superuser = True user.is_staff=True user.save(using=self._db) class User(AbstractBaseUser,PermissionsMixin): COMPANY='CO' EMPLOYEE='EM' STATUS_CHOICES=( (COMPANY,'Company'), (EMPLOYEE,'Employee'), ) Status=models.CharField(max_length=2, choices=STATUS_CHOICES, default=EMPLOYEE) user_image = models.CharField(max_length=100) is_admin=models.BooleanField() email=models.EmailField(unique=True) is_staff=models.BooleanField(default=False) object = UserManager() USERNAME_FIELD='email' REQUIRED_FIELDS = [] objects=models.Manager() def get_short_name(self): return self.email Admin.py files: class UserAdmin(UserAdmin): list_display = ('email', 'is_admin') list_filter = ('is_admin',) fieldsets = ( (None, {'fields': ('email', 'password','Status','user_image','last_login')}), ('Permissions', {'fields': ('is_admin','is_staff','is_superuser','user_permissions','groups')}), ) add_fieldsets= ( (None, {'fields': ('email', 'password','Status','user_image','last_login')}), ('Permissions', {'fields': ('is_admin','is_staff','is_superuser','user_permissions','groups')}), ) search_fields = ('password',) ordering = ('password',) filter_horizontal = () admin.site.register(User,UserAdmin) admin.site.register(Company) admin.site.register(Employee) admin.site.register(Job) admin.site.register(AppliedJobs) Can someone suggest what I am doing wrong? I always get the error when I add user from admin panel.I can't figure out as I am working first time on baseusermanager. -
Token Authentication with django restfulframework
I am trying to fetch data from the api endpoint using HTTPIE, following is the command, http http://127.0.0.1:8000/hello/ 'Authorization: Token c9a5b630b1887efdd3ca2db82aae9cec2c44257e' I generated the token and appended it to the api endpoint, i used curl to fetch data too, but it shows similar error. Views.py from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated class HelloView(APIView): permission_classes = (IsAuthenticated,) def get(self,request): content = {'message': 'Hello'} return Response(content) settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'core', 'rest_framework', 'rest_framework.authtoken', ] REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.SessionAuthentication', ], } Output usage: http [--json] [--form] [--pretty {all,colors,format,none}] [--style STYLE] [--print WHAT] [--headers] [--body] [--verbose] [--all] [--history-print WHAT] [--stream] [--output FILE] [--download] [--continue] [--session SESSION_NAME_OR_PATH | --session-read-only SESSION_NAME_OR _PATH] [--auth USER[:PASS]] [--auth-type {basic,digest}] [--proxy PROTOCOL:PROXY_URL] [--follow] [--max-redirects MAX_REDIRECTS] [--timeout SECONDS] [--check-status] [--verify VERIFY] [--ssl {ssl2.3,ssl3,tls1,tls1.1,tls1.2}] [--cert CERT] [--cert-key CERT_KEY] [--ignore-stdin] [--help] [--version] [--traceback] [--default-scheme DEFAULT_SCHEME] [--debug] [METHOD] URL [REQUEST_ITEM [REQUEST_ITEM ...]] http: error: argument REQUEST_ITEM: "Token" is not a valid value -
Angular - Django REST api "Bad Request" error on registering user
I am trying to send registration data of student and teacher from angular to django rest api. Teacher is able to register successfully while I am getting "Bad Request" error on registering student. Everything is working fine on sending request through postman error : HttpErrorResponse {headers: HttpHeaders, status: 400, statusText: "Bad ## Heading ##Request", url: "http://localhost:8000/auth/student/", ok: false, …} student-register-component.ts import { Component, OnInit } from '@angular/core'; import { AuthService } from '../../services/auth.service'; @Component({ selector: 'app-student-register', templateUrl: './student-register.component.html', styleUrls: ['./student-register.component.css'] }) export class StudentRegisterComponent implements OnInit { registerStudentData = {} constructor(private _auth: AuthService) { } ngOnInit() { } registerStudent(){ this._auth.registerStudent(this.registerStudentData) .subscribe( res => console.log(res), err => console.log(err) ) } } auth.service.ts import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class AuthService { private _registerTeacherUrl = "http://127.0.0.1:8000/auth/teacher/" private _registerStudentUrl = "http://localhost:8000/auth/student/" private _loginTeacherUrl = "" private _loginStudentUrl = "" constructor(private http:HttpClient) { } registerTeacher(teacher){ return this.http.post<any>(this._registerTeacherUrl, teacher) } registerStudent(student){ return this.http.post<any>(this._registerStudentUrl, student) } } views.py from authapi.serializers import TeacherSerializer, StudentSerializer from authapi.models import Teacher, Student from django.http import Http404 from rest_framework.views import APIView from rest_framework import status from rest_framework.response import Response from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator # Create your … -
How to keep a tensorflow session running in memory with django
I have an object detection model built with tensorflow and integrated with a Django project. What currently happens is that whenever a request comes to the Django API, a tf session is created and is closed after the detection is done. Is it possible to start the Django server and a tensorflow session with the required inference graphs to reduce object detection time? -
Filter an intermediate model and use it to modify queryset of a model
I guess my question can be best explained by an example. class A: # the model where I am making a ModelAdmin # 1-to-1 relationship with class B class B: # some fields class C: # many to many with class B # field - foreignKey from class D class D: # 1 to 1 relationship with class User class User: In my modelAdmin for class A, I have defined the get_queryset: def get_queryset(self, request): qs = super().get_queryset(request) if request.user.is_superuser: return qs ??return qs.filter(class_C_field=request.user.class_D.pk) where the ?? means what I want to do is get all the records from the intermediate table generated by B and C and get only those whose field in class C is equal to one of the instances from class D. After that, I want to use the fields of class C and class B to display in my list_display for the model Class A -
Django Order concated queryset
How can I order my concatenated querysets? I can make a for loop and print each date for r in requests: print(r.game.date) but I cant order the queryset. views.py class Games(TemplateView): template_name = ... def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) user = CustomUser.objects.get(pk=self.request.user.pk) team = Team.objects.get(team=user) requests_single = Request.objects.filter(content_type=ContentType.objects.get_for_model(CustomUser)).filter(object_id=self.request.user.pk) requests_team = Request.objects.filter(content_type=ContentType.objects.get_for_model(Team)).filter(object_id=team.pk) requests = requests_single | requests_team requests.order_by('-game.date') context['requests'] = request return context model.py class Forderung(models.Model): game = models.ForeignKey(Spiel, on_delete=models.CASCADE, null=True) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() content_object = GenericForeignKey('content_type', 'object_id') -
Django, nginx and gunicorn in kubernetes
I am trying to run my django app in kubernetes.I use docker-compose to build application and nginx.I am able to run the application using proxy server nginx in docker compose. docker-compose build - successful docker-compose up - successful http://aggre.mabh.io - successful(able to load the application) when i try to deploy the image of application and nginx, I am getting error in kubernetes dashboard saying Error in kubernetes pod has unbound PersistentVolumeClaims (repeated 2 times) (for both nginx and application) I am using kompose up to build and deploy the application. How to deploy the the application in kubernetes and access the application through nginx kubernetes external end-point? docker-compose.yml version: '3' services: djangoapp: build: . image: sigmaaggregator/djangoapp labels: - kompose.service.type=NodePort volumes: - .:/djangoapp - static_volume:/djangoapp/static ports: - 4000:4000 networks: - nginx_network nginx: image: nginx:1.13 ports: - 80:80 volumes: - ./config/nginx/conf.d:/etc/nginx/conf.d - static_volume:/djangoapp/static depends_on: - djangoapp networks: - nginx_network networks: nginx_network: driver: bridge volumes: static_volume: Dockerfile FROM python:3.6 RUN mkdir -p /djangoapp WORKDIR /djangoapp COPY . /djangoapp RUN pip install -r requirements.txt # copy our project code RUN python manage.py collectstatic --no-input CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait" # expose the port 4000 EXPOSE 4000 # … -
How to export item from drop down in django-admin
I have a module Project with drop down lists, and inside of Project I have project names , like Project1, Project2, Project3 etc.. So , when I export to xls or csv , I got integer instead of names. For example, when I export list, I got 1 or 3 or any other number instead of name Project1 or Project3 etc.. How can I solve this ? I couldn't find any answer about that, and I would appreciate any answer. This is my class class Person(models.Model): title = models.CharField(max_length=50) project = models.ForeignKey('Project', on_delete=models.CASCADE, blank=True, default=None,) -
Django TypeError: No exception message supplied
I am having a problem in problem in understanding this error message.. I have written this line of code in my views qs = Stockdata.objects.filter(User=self.request.user, Company=company_details.pk, Date__gte=selectdatefield_details.Start_Date, Date__lte=selectdatefield_details.End_Date) total = qs.annotate(Sum('salestock__Quantity'))['the_sum'] total2 = qs.annotate(Sum('purchasestock__Quantity_p'))['the_sum'] tqty = total2 - total context['Totalquantity'] = tqty context['Totalquantitysales'] = total context['Totalquantitypurchase'] = total2 Do anyone have any idea about what I am doing wrong in my code? Thank you -
django Sessions are not maintaing in an iframe
I am creating a conversational chatbot using django . And To maintain the flow of the chat in chatbot , i am using django sessions . But when i use the link of the chatbot in an iframe , it doesn't store any of the session and flow breaks down. I want a function that will help to maintain the sessions even in the iframe. -
Next button for .html pages in Django project
I'm trying to figure out the simplest way to create a previous/next button for changing pages of a ebook converted to .html pages. The pages are number /LegoArduino-1.html to /LegoArduino-200.html for example make up each ebook. I'm not sure if using JavaScript or Django would be easier, but I'm thinking Django. Any suggestions would be appreciated and thank you in advance.