Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django can't connect to firebird database
First time using Django, so I looked up a tutorial - I followed this link and everything went fine, until I had to adjust the settings.py file, where I followed this other link and got this error: django.core.exceptions.ImproperlyConfigured: 'firebird' isn't an available database backend. Try using 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', 'postgresql', 'sqlite3' I have django-firebird installed via pip install django-firebird, I have a different python script which uses import fdb just fine, and I have been able to access my firebird database regularly with the other python script, so what could be causing this error? -
Django-filter get all records when a specific value for a filter_field is passed
I am using django-filter to filter my Queryset on the basis of url params. class WorklistViewSet(ModelViewSet): serializer_class = MySerializer queryset = MyModel.objects.all() filter_backends = [DjangoFilterBackend, ] filterset_fields = ['class', ] # possible values of *class* which is allowed to be passed in the url params are ['first', 'second', 'ALL']. class MyModel(BaseModel): CLASS_CHOICES = ( (FIRST_CLASS, 'first'), (SECOND_CLASS, 'second'), ) class = models.CharField(choices=CLASS_CHOICES, max_length=3, ) URLs http://127.0.0.1:8000?class=first and http://127.0.0.1:8000?class=first are giving the expected results. I want that when http://127.0.0.1:8000?class=ALL is called, all the records in my table should be listed i.e without filtering. How can i do this while using django-filter ? -
Best way to implement a WebSocket project, using python on Windows
I use Django Channels for WebSocket, but I can't find a way to deploy it on Windows. I can't change my platform so switching to Linux is not an option. Could you please suggest a way to deploy Django Channels on Linux? Or Do you know what is the Django Channels alternative for Windows? -
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION using django ORM
I'm using django 1.11 with django-mssql 1.8 and python-tds 1.8.2 and i ran into a problem. There are 2 tables (let it be table A and table B) with the same column assignee_id I need to update. Running code A.model.objects.filter(assignee=assignee).update(assignee=new_assignee) for any number of records works well, however executing the same code for the model B for large number of records fails with message 'The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION' (I'm still able to update a few records). Making this request atomic removed error message but now table B is not updated. Adding select_for_update() does not help too. B.model.objects.select_for_update().filter(assignee=assignee).update(assignee=new_assignee) Executing raw SQL led to the same results. Running this code leads to the error: cursor = connection.cursor() cursor.execute('UPDATE B SET assignee_id = {new_assignee} WHERE assignee ={assignee}'.format(assignee=assignee_id, new_assignee=new_assignee_id) connection.commit() Running this does not raise exception and does not update table: with transaction.atomic(): cursor = connection.cursor() cursor.execute('UPDATE B SET assignee_id = {new_assignee} WHERE assignee ={assignee}'.format(assignee=assignee_id, new_assignee=new_assignee_id) Note: when application runs table B is modified much more often that table A so that's can be the cause of the issue. Any suggestion for this? -
given a clinic_id, how do I get the mods belonging the profile of the user
I am really stuck here and I am considering changing my models and starting fresh I have these models class CustomUser(AbstractBaseUser): email = models.EmailField(max_length=255, unique=True) password2 = models.CharField(max_length=128) first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) active = models.BooleanField(default=True) # Able to login practitioner = models.BooleanField(default=False) # has access to a clinc admin = models.BooleanField(default=False) # superuser staff = models.BooleanField(default=False) # staff timestamp = models.DateTimeField(auto_now_add=True) class Modalities(models.Model): name = models.CharField(max_length=50) def __str__(self): return self.name class Profile(models.Model): user = models.OneToOneField(User, related_name='prof_user', on_delete=models.CASCADE) bio = models.TextField(max_length=5000) mods = models.ManyToManyField(Modalities) phone = PhoneNumberField() clinics = models.ManyToManyField(Clinic) personnummer = models.CharField(max_length=12) street = models.CharField(max_length=50) city = models.CharField(max_length=50) consent = models.BooleanField() class Clinic(models.Model): practitioner = models.OneToOneField(User, related_name='prac_user', on_delete=models.CASCADE) lat = models.FloatField(null=True, blank=True) lng = models.FloatField(null=True, blank=True) name = models.CharField(max_length=128, ) phone = PhoneNumberField() description = models.TextField(max_length=5000) street = models.CharField(max_length=128, ) city = models.CharField(max_length=128, ) From my view I am trying to get the mods from the Profile model, starting with the clinic_id something like clinic = Clinic.objects.filter(pk=clinic_id) profile = get_object_or_404(Profile, user=request.user) mods = profile.mods I have tried so many things over the last few hours and I just can't figure this out. Do I need to change my models or am I going about accessing this wrong? -
NoReverseMatch at /teacher_dashboard/4 Reverse for 'updateorder' not found. 'updateorder' is not a valid view function or pattern name
urls.py path('teacher_dashboard/', views.TeacherDashboard , name='teacher_dashboard'), path('student_dashboard//', views.StudentDashboard , name='student_dashboard'), views.py def Login(request): if request.method == 'POST': username = request.POST.get('username') password = request.POST.get('password') # print(request.POST) user = authenticate(request , username=username , password=password) if user is not None: try: is_teacher= Teacher.objects.get(profile_id=user.id) except Teacher.DoesNotExist: is_teacher = None if is_teacher is not None: login(request , user) is_teacher= Teacher.objects.get(profile_id=user.id) return redirect( 'teacher_dashboard', user.id) else: login(request , user) student= Student.objects.get(profile_id=user.id) return render(request ,'pages/student_dashboard.html' ) return render (request , "pages/login.html") def TeacherDashboard(request , id): is_teacher= Teacher.objects.get(profile_id = id) students=Student.objects.all() print(students) context={ 'student' : students } return render (request , "pages/teacher_dashboard.html" , context) teacher_dahboard.html {% for student in student %} {{student}} {%endfor %} -
How to Install PyMuPDF on Heroku Django
I am trying to make a script that extracts Imgaes from PDF and I have made a script in Python and added pymupdf to the requirements.txt. While trying to push master to Heroku.I Have an Aptfile with Mupdf in it and https://github.com/heroku/heroku-buildpack-apt as a buildpack along with heroku/python.The Push fails and here is the Error. Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 8 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 322 bytes | 322.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Apt app detected remote: -----> Detected Aptfile or Stack changes, flushing cache remote: -----> Adding custom repositories remote: -----> Updating apt caches remote: Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB] remote: Get:2 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease [46.3 kB] remote: Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] remote: Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] remote: Get:5 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB] remote: Get:6 http://apt.postgresql.org/pub/repos/apt bionic-pgdg/11 amd64 Packages [2,483 B] remote: Get:7 http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 Packages [294 kB] remote: Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,344 kB] remote: Get:9 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [817 kB] remote: Get:10 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 … -
How to retain existing image file in on data update in django rest framework
I am using Django Rest Framework to create an API for Angular frontend. I want existing image file to be retained if a new image has not been uploaded. Angular; On image update action, I just check if the image field is a url(the data read from the server returns image field as url). If that is the case then the field is assumed unchanged. Maybe there's approach to that. updateHotelImage() { if(typeof(this.updateImageForm.get("image").value)==="string"){ this.formData = new FormData(); this.formData.append("image", this.updateImageForm.get("image").setValue(null)); this.formData.append("hotel", this.updateImageForm.get("hotel").value); this.formData.append("is_profile_image",this.updateImageForm.get("is_profile_image").value); }else{ this.formData = new FormData(); this.formData.append("image", this.updateImageForm.get("image").value); this.formData.append("hotel", this.updateImageForm.get("hotel").value); this.formData.append("is_profile_image",this.updateImageForm.get("is_profile_image").value); } ....... .......... Question: How can U retain the original image data if image field has not been updated. Here is what I tried; class UpdateHotelImage_View(APIView): # parser_classes = (FileUploadParser,) parser_classes = (MultiPartParser, FormParser,) def get_object(self, pk): try: return HotelImage.objects.get(pk=pk) except HotelImage.DoesNotExist: raise Http404 def put(self, request, pk, format=None): hotel_img = self.get_object(pk) img_data = request.data['image'] if img_data == 'null' or 'undefined': **this line seems not to achieve what am trying to do.** hotel_img.image = hotel_img.image serializer = HotelImage_Serializer(hotel_img, data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) class HotelImage_Serializer(serializers.ModelSerializer): hotel = HotelSerializer(read_only=True) image = serializers.ImageField(required=False, allow_null=True) class Meta: model = HotelImage fields = '__all__' class HotelImage(models.Model): hotel = … -
modifying default queryset for recursive self relation
I have a self-relation like this: from django.db import models class TypeManager(models.Manager): def get_queryset(self): return super().get_queryset().filter(parent_type__isnull=True) class Type(models.Model): parent_type = models.ForeignKey('self', related_name='subtypes', null=True) objects = TypeManager() I modified default queryset so that Type.objects.all() return all without subtypes. But when I have some type instance and want to get all its subtypes, I receive empty results: instance.subtypes.all() The question: how to get subtypes here: instance.subtypes.all() -
Resolving Django URLs with many trailing slashes - development vs. production inconsistency
I have a Python+Django website working under control of uWSGI and NginX. On the production environment, each of the addresses below directs to an article. APPEND_SLASH=True setting makes the first URL (non-slash) redirect to the second URL (with one slash) - this is the part which I understand. What is making third, fourth and every each URL with any number of slashes working? 1. http://example.com/my-article-slug 2. http://example.com/my-article-slug/ 3. http://example.com/my-article-slug// 4. http://example.com/my-article-slug/// 5. ... URLs with many slashes just resolve the Django View (ArticleDetail) properly and show the article, without redirect (!). However, on the Django local development web server, only first two of above links works. Http404 is returned if URL has more than one slash. The DEBUG setting has nothing to do with this issue, according to my investigation. It is worth noting that this behavior is a problem when I want to resolve a Django View from an URI, because addresses with many trailing slashes work correctly (on the production), but they are not resolved correctly by django.urls.resolve: >>> from django.urls import resolve >>> resolve('/my-article-slug/') ResolverMatch(func=articles.views.ArticleDetail, args=(), kwargs={'slug': 'my-article-slug'}... >>> resolve('/my-article-slug//') django.urls.exceptions.Resolver404... Django URLs cofiguration: # urls.py from django.urls import include, path urlpatterns = [ path('', include('articles.urls')), ] … -
Django-allauth: PasswordChangeView override of success_url with logged out user results in error
When changing a password via django-allauth, the default redirect after successfully posting the password change is again the password change template. Since I find this confusing, I overrode the original PasswordChnageView in my views.py file: from allauth.account.views import PasswordChangeView from django.urls import reverse_lazy class MyPasswordChangeView(PasswordChangeView): success_url = reverse_lazy('home') and changed my urls.py file: from django.urls import path, include from users.views import MyPasswordChangeView urlpatterns = [ ... # User management path('accounts/password/change/', MyPasswordChangeView.as_view(), name="account_change_password"), path('accounts/', include('allauth.urls')), ... ] This works fine when the user is logged in, however when I try to access the url http://127.0.0.1:8000/accounts/password/change/ while being logged out, I get the following error message: AttributeError at /accounts/password/change/ 'AnonymousUser' object has no attribute 'has_usable_password' Before I created my custom override, the result of the same behaviour was that I was redirected to the login url http://127.0.0.1:8000/accounts/login/?next=/ What do I need to change with my custom view, to redirect to the login url when a logged out user tries to acces the url http://127.0.0.1:8000/accounts/password/change/ -
Getting 'image' error when no image is selected
<form method="post" enctype="multipart/form-data">{% csrf_token %} Title: <input type="text" name="title"><br> Image: <input type="File" name="image"><br> <input type="submit"> <form> def home(request): if request.method == 'POST': try: obj = ImageF() obj.title = request.POST.get('title'] obj.pic = request.FILES['image'] obj.save() except Exception as e: print('error', e) return render(request, 'index.html') I'm trying upload image into my database but whenever I don't select the image in 'views.py' it through an error 'image', even though in 'models,py' 'null' and 'blank' is TRUE -
Graphene Django - Access Filter arguments in Connection class
I need to create PDF file from specific query. The problem is that I would like to show which filter arguments were used when generating that PDF file. So for better understanding in my project is model for transactions: class Transaction(Model): class Meta: db_table = 'transactions' app_label = 'core' default_permissions = () description = models.CharField(max_length=100, null=True) amount = models.IntegerField(null=False) The model fields are not complete because it's not necessary. This model has Type and Filter classes: class TransactionType(DjangoObjectType): record = graphene.String(source='pk') class Meta: model = Transaction interfaces = (Node,) connection_class = TransactionPdfConnector class TransactionFilter(django_filters.FilterSet): record = django_filters.CharFilter( field_name='pk', lookup_expr='exact' ) In my project there are as PK UUID fields named as record. So that filter is filtering according to typed UUID string as PK. For better understanding my query looks like this: query{ transactions( record: "52d820fb-8383-4a97-ab26-321b56dedc0" ){ pdfUrl edges{ node{ record amount } cursor } } } Very important field in query is pdfUrl which will return url to generated PDF file. So this is why i have in Type object Meta class connection_class. I needed to override graphene.Connection class so i could add pdfUrl attribute on a certain level as edges. My custom connection_class looks like this: class TransactionPdfConnector(PdfConnector): … -
(1054, "Unknown column 'name_id' in 'field list'")
My model is: class CustomAssignment(models.Model): name = models.ForeignKey(CustomAuditType) value_stream = models.ForeignKey(dashboard.ValueStream, null=True, blank=True) category = models.ForeignKey(CustomAuditCategory, null=True, blank=True) user = models.ManyToManyField(User) My admin is: @admin.register(CustomAssignment, site=admin.site) class CustomAssignmentAdmin(admin.ModelAdmin): list_display = ('value_stream','category') While adding the data from the admin page I'm getting InternalError at /admin/custom_audit/customassignment/add/ (1054, "Unknown column 'name_id' in 'field list'") And while accessing customassignment from admin I'm getting below error InternalError at /admin/custom_audit/customassignment/ (1054, "Unknown column 'custom_audit_customassignment.name_id' in 'field list'") Please help me with the above errors. -
reCAPTCHA v3 error in Django: The view accounts.views.signup didn't return an HttpResponse object. It returned None instead
I am trying to implement reCAPTCHA v3 on my signup form. I see the reCAPTCHA logo on my localhost signup page. However, when I click on "Sign Up", I get this error: ValueError at /signup/ The view accounts.views.signup didn't return an HttpResponse object. It returned None instead. My code in views.py is the following: import requests from django.shortcuts import render, redirect from django.contrib.auth.models import auth from django.contrib.auth import get_user_model from django.contrib.sites.shortcuts import get_current_site from django.contrib.auth.models import Group from django.utils.encoding import force_bytes, force_text from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.template.loader import render_to_string from django.urls import reverse from django.contrib import messages from .forms import SignUpForm, LogInForm from .token_generator import account_activation_token from django.conf import settings User = get_user_model() def signup(request): form = SignUpForm(request.POST or None) context = dict(form=form) if request.method == 'POST': if form.is_valid(): recaptcha_response = request.POST.get('g-recaptcha-response') recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify' data = { 'secret': settings.RECAPTCHA_SECRET_KEY, 'response': recaptcha_response } recaptcha_resp = requests.post(recaptcha_url, data=data) recaptcha_result = recaptcha_resp.json() if recaptcha_result.get('success'): user = User.objects.create_user(**form.cleaned_data) current_site = get_current_site(request) subject = 'Activate Your MySite Account' message = render_to_string('accounts/registration/account_activation_email.html', { 'user': user, 'domain': current_site.domain, 'uid': urlsafe_base64_encode(force_bytes(user.pk)), 'token': account_activation_token.make_token(user), }) user.email_user(subject, message) return redirect(reverse('account_activation_sent')) else: messages.error(request, 'Invalid ReCAPTCHA. Please try again.') else: return render(request, 'accounts/signup.html', context) else: return render(request, 'accounts/signup.html', context) … -
How to Refresh Django Server (Online)
Is possible to refresh django server online? I want that django refesh as is in (python manage.py runserver), however i want to make this using a django view. How comand allow to refresh server online? Thank you. -
How can I start a project on djangocms?
Am trying to start a djangocms project but I keep getting the following error: (Pucho) PS C:\Users\Frazier\Desktop\Pucho> djangocms mysite Creating the project Please wait while I install dependencies If I am stuck for a long time, please check for connectivity / PyPi issues Dependencies installed Creating the project The installation has failed. ***************************************************************** Check documentation at https://djangocms-installer.readthedocs.io ***************************************************************** Traceback (most recent call last): File "c:\users\frazier\desktop\pucho\lib\site-packages\djangocms_installer\django\__init__.py", line 59, in create_project output = subprocess.check_output(cmd_args, stderr=subprocess.STDOUT) File "c:\users\frazier\appdata\local\programs\python\python38\Lib\subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "c:\users\frazier\appdata\local\programs\python\python38\Lib\subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['c:\\users\\frazier\\desktop\\pucho\\scripts\\python.exe', 'c:\\users\\frazier\\desktop\\pucho\\scripts\\django-admin.py', 'startproject', 'mysite', 'C:\\Users\\Frazier\\Desktop\\Pucho\\mysite']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\frazier\appdata\local\programs\python\python38\Lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\frazier\appdata\local\programs\python\python38\Lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\Frazier\Desktop\Pucho\Scripts\djangocms.exe\__main__.py", line 7, in <module> File "c:\users\frazier\desktop\pucho\lib\site-packages\djangocms_installer\main.py", line 40, in execute django.create_project(config_data) File "c:\users\frazier\desktop\pucho\lib\site-packages\djangocms_installer\django\__init__.py", line 62, in create_project raise RuntimeError(e.output.decode('utf-8')) RuntimeError: CommandError: 'mysite' conflicts with the name of an existing Python module and cannot be used as a project name. Please try another name. (Pucho) PS C:\Users\Frazier\Desktop\Pucho> I have tried to uninstall and reinstall djangocms but I keep getting the same error … -
unable to render static files in Django 2.2
I just started working on a project where the previous developer was using django 2.2 Ideally, leaving the complexity aside, one would need to define STATIC_URL='/static/' in settings.py file and use {% load 'static' %} in base html file while appending required details in urls.py file. However, in the current project, all of the static content (css, js) is stored in single media folder. and in settings.py file, i have STATIC_ROOT = '/usr/local/my34project/lib/python3.4/site-packages/django/contrib/admin/static' STATIC_URL = '/static/' also in base html file, they have <link href="/media/css/backoffice/fonts.css" rel="stylesheet" type="text/css"> instead of <link href="{% static 'css/backoffice/fonts.css' %}" rel="stylesheet" type="text/css"> How is it, that the previous person's project was working without static being loaded or used in the url link ? -
Is there a way to display only the day from datetime field in Django?
My code: <span class="day">{{ post.publish_date }}</span> output: Feb. 10,2020 expected output: 10 -
django + ajax errors list at form
In general, what is the question using ajax in django, if the form is filled out correctly, then everything is fine, but if there are no errors, that is, output in the logical console. views.py def get_name(request): if request.method == 'POST': user_code = generate_code(8) subject = 'код подтверждения' message = user_code form = NameForm(request.POST) if form.is_valid(): Registration.objects.create(fio=request.POST['fio'],phone=request.POST['phone'],mail=request.POST['mail']) send_mail(subject, message,settings.EMAIL_HOST_USER,[mail],fail_silently=False) return JsonResponse({ 'form1': render_to_string( 'registers/endreg.html', {'form': NameForm1()},request=request ) }) else: messages.warning(request, u'not valid.') form = NameForm() return render(request, 'registers/detail.html', {'form': form}) ajax $(document).ready(function() { $("#my_form").submit(function(event) { event.preventDefault(); $this = $(this); $.ajax({ type: "POST", data: $this.serialize(), success: function(data) { console.log(data); var parent=$("#my_form").parent(); parent.html(data.form1); }, error: function(data) { console.log(data); $this.html(data); } }); }); }); -
AUTH_USER_MODEL as a sub-application of a custom auth app
I've got an auth application which is used instead of django's own auth app, called authentication. Typically projects will specify AUTH_USER_MODEL = 'authentication.User'. There are some other projects which utilise a separate authentication backend and an API which brings in additional fields/methods to the User model. Because this additional functionality isn't used by all projects I'd like it to be an optional sub-application to authentication. Therefore I've added it to the package setup as an extra; setup( name='authentication', extras_require={ "api_app": ["api_client>=3.0.1"], }, api_app is then added as a sub-application to authentication: - authentication -- apps.py -- models.py -- api_app --- apps.py --- models.py With this I've got two models for users, User in authentication.models and APIUser in authentication.api_app.models. For projects making use of APIUser I've got the following settings; # AUTH_USER_MODEL = 'authentication.User' AUTH_USER_MODEL = 'authentication_api.APIUser' # Needs to be `app_label.Model` INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.staticfiles', 'authentication', 'authentication.api_app', 'api_client' ] The api_app is defined as; class APIConfig(AppConfig): app_label = 'authentication_api' # in an attempt to support `app_label.Model` ref in settings name = 'authentication.api_app' verbose_name = "API Authentication" With this configuration django thinks that authentication_api isn't installed, but AUTH_USER_MODEL only supports app_label.Model and nothing more … -
in Django show String on UI when file is ready
I would like do next, When press on submit button, Django generate some file (it takes some time, about a minute) I would like that next to submit button will appear another button to download (locally) this file when generating was finished. Thanks -
Value of an if statement is not returning to the context of the parent function the view
This is the view I want to use obj3 in the context of the function def inec_news_view(request): title = 'LGA Results' data1 = Lga.objects.all() if request.method == 'POST': selected_item = request.POST.get('item_id') obj3 = Pu_results.objects.filter(polling_unit_uniqueid__in=Subquery(Unit.objects.values('uniqueid').filter(lga_id=obj1))) context = {'title': title, 'data1': data1, 'resobj': obj3} return render(request, "inecnews.html", context) -
Unable to check if radio button is selected or not: Django
I am unable to verify if the radio button I have placed in django templates is check or not. Given below are the HTML and views.py file: HTML: <div class="col-xs-1 col-sm-1 checkbox" style="margin-left:5px"> <p class="control-label"><strong>Backlog</strong></p> <input type="radio" name="backorNor" value="1"> </div> views.py: def get_data(request): choice_of_query = request.POST.get("backorNor");\ if choice_of_query == "1": mssql_qu = cq_query_backlog.mssql_query.format(sql_product,sql_state,sql_version_reported,sql_op1_drs) else: mssql_qu = cq_query.mssql_query.format(sql_product,sql_state,sql_version_reported,sql_op1_drs) cq_query_backblog and cq_query are two sql files which I need to run if the radiobutton is checked or not respectively. upon printing the type of choice_of_query, I am getting None Where am I going wrong? Any help is appreciated. -
Set debug mode to false during an automatic deployment of a django website
What is the expected process when one wants to deploy a django website automatically by means of a continuous integration process: how can we set debug mode to false without editing the configuration file?