Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
django project getting error on gunicorn but running perfectly on using manage.py runserver
My django project is working perfectly on using manage.py runserver. But when I am running it using gunicorn mysite.wsgi then it is giving errors my wsgi.py import os from django.core.wsgi import get_wsgi_application import socketio from myapp.websocketserver import sio import eventlet os.environ["DJANGO_SETTINGS_MODULE"]="mysite.settings" django_app = get_wsgi_application() application = socketio.WSGIApp(sio, django_app) eventlet.wsgi.server(eventlet.listen(('', 8000)), application) Now these are some errors I am getting with gunicorn on running=> gunicorn mysite.wsgi django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. then I run=> gunicorn --env DJANGO_SETTINGS_MODULE=mysite.settings backend.wsgi raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. then I added this code in settings.py import django django.setup() now I ran=> gunicorn --env DJANGO_SETTINGS_MODULE=mysite.settings backend.wsgi then I am getting this error: raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.") django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty. My settings.py has SECRET_KEY variable. And I am not getting any solution for this. When my project is working fine with runserver then what is problem with gunicron. How to resolve these error -
Django: iterate over all objects fills all the memory
I have a Django (3.1.5) project with a postgresql database with the model I show below. The problem is that I'm not able to iterate over all objects. When I try to iterate my memory gets full until the process needs to be killed. How does Article.objects.all() iterate over objects? Does it first load all objects in memory? I'm using a simple for to iterate: for art in Article.objects.all(): print(art) break The model: class ArticleManager(models.Manager): def search(self, search_text): search_vector = \ SearchVector( 'title', weight='A',config='portuguese' ) + \ SearchVector( 'author_name', weight='A',config='portuguese' ) + \ SearchVector( 'description', weight='B',config='portuguese' ) + \ SearchVector( 'body', weight='C',config='portuguese' ) search_query = SearchQuery( search_text, config='portuguese' ) search_rank = SearchRank(search_vector, search_query) qs = ( self.get_queryset() .filter(search_vector=search_query) .annotate(rank=search_rank) .order_by('-rank') ) return qs class Article(models.Model): title = models.CharField(max_length = 250) description = models.TextField() body = models.TextField() url = models.URLField(unique = True,max_length = 500) url_basename = models.URLField(max_length = 500,blank=True,null = True) authors = models.ManyToManyField('accounts.Author',related_name = 'autores') author_name = models.TextField(blank=True,null = True) jornal = models.ForeignKey(Jornal,on_delete=models.CASCADE,related_name = 'jornal') mongo_id = models.CharField(max_length = 30,unique = True) publish_date = models.DateTimeField() creation_date = models.DateTimeField(default=datetime.now, blank=True) exclusive = models.BooleanField(blank=True,null = True) tags = TaggableManager() entidades = models.TextField() search_vector = SearchVectorField(null=True) def __str__(self): return self.title class Meta: ordering … -
Ge the coordinates latitude, longitude from the user using Django
What I have: I have a registration form using default forms in Django. I want to add a new field or fields to get the current location, even by pressing "Get current location" or by typing the address. Is there any up to date modules, because I tried some of them has many problems and errors. I'm using the latest python and Django version. Many thanks for you! -
How to import and instantiate classes imported from dll using ironpython?
I have DLLs from a project implemented in C#, but i want to create a python (django) solution based on that project. For that purpose I'm using ironpython to import and load the DLLs and I'm creating a handler to handle them. The DLL import and setup is running properly and so I can use the provided classes and methods defined in that project. The problem is that now i need to convert an object of an imported class to another imported class: C# code snippet: DownloadProvider downloadProvider = null; ConnectionConfiguration configuration = downloadProvider.Configuration; ConfigurationMode configurationMode = configuration.Modes.Find("IE"); ConfigurationPcInterface pcInterface = configurationMode.PcInterfaces.Find("My Interface", 1); IConfiguration targetConfiguration = pcInterface.TargetInterfaces[0]; Python code: import Connection as CONN import Download as DL downloadProvider = self.instance.DeviceItems[1].GetService[DL.DownloadProvider]() print(downloadProvider) # Download.DownloadProvider # initiate connection configuration = downloadProvider.Configuration print(configuration) # Connection.ConnectionConfiguration # get the device interface configurationMode = configuration.Modes.Find("IE") print(configurationMode) # Connection.ConfigurationMode # get the interface pcInterface = configurationMode.PcInterfaces.Find("My Interface", 1) print(pcInterface) # Connection.ConfigurationPcInterface targetConfiguration = pcInterface.TargetInterfaces[0] print(targetConfiguration) # Connection.ConfigurationTargetInterface Now targetConfiguration, when printed, returns "Connection.ConfigurationTargetInterface". When i print the types of these variables they all print "<class 'CLR.CLR Metatype'>" But my problem is on the last line of the C# snippet, where i need targetConfiguration to be … -
when i try to add multiple language in django nothing changed when i change language
when i try to add multiple language in django nothing changed when i change language i added two language but when i press on arabic nothing changed in html i mean why urls.py : from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _ from django.urls import LocalePrefixPattern, URLResolver, get_resolver, path from django.views.i18n import set_language from django.conf.urls.i18n import i18n_patterns urlpatterns = [ path('set_language', views.set_language, name='set_language'), path('il8n/', include('django.conf.urls.i18n')), path('admin/', admin.site.urls),] urlpatterns += i18n_patterns( path('', views.home_page, name='home_page'), path('test', views.test, name='test'), )+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) settings.py : from django.utils.translation import gettext_lazy as _ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True LLOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), ) LANGUAGES = ( ('ar', _('Arabic')), ('en', _('English')), ) views.py : def set_language(request): if requset.method == 'POST': cur_language = translation.get_language() lasturl= requset.META.get('HTTP_REFERER') lang = request.POST['language'] translation.activate(lang) request.session[translation.LANGUAGE_SESSION_KEY]=lang return HttpResponseRedirect("/"+lang) html page form : <form action="{% url 'set_language' %}" method="post">{% csrf_token %} <input name="next" type="hidden" value="{{ redirect_to }}"> <select name="language"> {% get_current_language as LANGUAGE_CODE %} {% get_available_languages as LANGUAGES %} {% get_language_info_list for LANGUAGES as languages %} {% for language in languages %} <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected{% endif %}> {{ language.name_local }} ({{ language.code … -
Django Framework got Server Error 500 when DEBUG to False
I am using Django framework for project. I am rendering the HTML templet def index(request): print(" --- check fine?") # for print debug trees = Tree.objects.all() print(trees) return render(request, "index.html", {'trees': trees}) --- check fine? <QuerySet [<Tree: Tree object (8)>, <Tree: Tree object (10)>, <Tree: Tree object (11)>, <Tree: Tree object (12)>]> [06/Feb/2021 17:28:44] "GET / HTTP/1.1" 500 145 these are my urls. urlpatterns = [ path("", views.index, name="index"), path('about/', views.about , name='about'), path('contact/', views.contact , name='contact'), path('upload/', views.upload_file , name='upload'), ] DEBUG = False I am getting above error. when I set my DEBUG = True every thing works fine means show index.html and shows even data too. setting DEBUG = False make difficult to find an error. index.html contains below code which fetches data. {% for tree in trees %} <article class="col-lg-3 col-md-4 col-sm-6 col-12 tm-gallery-item"> <figure> <img src="{{tree.image.url}}" alt="Image" class="img-fluid tm-gallery-img" /> <figcaption> <h4 class="tm-gallery-title">{{tree.name}}</h4> <p class="tm-gallery-description">{{tree.desc}}</p> <!-- <p class="tm-gallery-price"></p> --> </figcaption> </figure> </article> {% endfor %} -
Deploying a django rest framework api that uses react for the frontend
I am currently working on a project that that has a react frontend from which I fetch information from the rest framework api and then display it. It is the first time I deploy something like this and I have found it very confusing to understand what is the best way to deploy this. What I Have Tried I tried deploying on heroku without really knowing what I was doing and then the following happened. My react app shows perfectly on heroku without any problems, but when the fetch funcitons are called there was an error that said connection refused. Then I realized that my django server had to be running in my computer in order to react o be able to fetch the information. I thought that the django server would also get deployed but apparently I have to deploy separately I guess. I have been searching for a while and I found something about nginx, digital ocean and docker but I didn't understand what would I have to do in this case. Anyone knows what should do I do in this case? -
Password changing view is not working correctly
So I'm trying to see if user matches their old password, if they don't then it will give a message saying "Your old password in incorrect" but if they match their old password then it should check if user matched new and confirmed password correctly, if they did not then it should give a message saying "Your new passwords do not match", But even when I match the old password correctly it always says "Your old password is incorrect" even if it is correct. views.py @login_required def userchange(request): if request.method == 'POST': # user = User.objects.get(username=request.user.username, password=request.POST['Old password']) if User.objects.filter(username=request.user.username, password=request.POST['Old password']).exists(): if request.POST['New password1'] == request.POST['New password2']: User.objects.update_or_create(username=request.user.username, password=request.POST['New password2']) return render(request, 'main/change.html', {'error':'Your password has been changed succesfully!'}) else: return render(request, 'main/change.html', {'error':'Your new passwords do not match'}) else: return render(request, 'main/change.html', {'error':'Your old password is incorrect'}) elif request.method == "GET": return render(request, 'main/change.html') change.html <h1>Note: You will be logged out</h1> <h2>{{ error }}</h2> <form method="POST"> {% csrf_token %} <input type="password" placeholder="Old password" name="Old password"> <input type="password" placeholder="New password" name="New password1"> <input type="password" placeholder="Confirm password" name="New password1"> <button type="submit">Change password</button> </form> -
What could be the problem of django run error
My Django project used to work well the day before but it was not working when I run the next day. The following is the error I am getting. I didn't change anything and yet it did not work. When I run my project, the following error occurs. The project name is 'carpooling' and the the database user is 'Jigme'. I think the last line points the error towards the database which I didn't change anything. Please help me. Your help will be appreciated. Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\base\base.py", line 219, in ensure_connection self.connect() File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(*args, **kwargs) File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\base\base.py", line 200, in connect self.connection = self.get_new_connection(conn_params) File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\asyncio.py", line 26, in inner return func(*args, **kwargs) File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\mysql\base.py", line 234, in get_new_connection return Database.connect(**conn_params) File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\MySQLdb\__init__.py", line 130, in Connect return Connection(*args, **kwargs) File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\MySQLdb\connections.py", line 185, in __init__ super().__init__(*args, **kwargs2) MySQLdb._exceptions.OperationalError: (1044, "Access denied for user 'jigme'@'%' to database 'carpooling'") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner … -
Djnago - Make query based on information provided from a user on front end. Not all filters will be used every time. How to achieve this?
I have a problem. I am building an app where user in a form can select some filtering options. Not all options will be used every time. I don't know how to build proper django query. At first I tried this approach: if mileage: if mileage_less_more == 'mileage_less_than': cars = cars.objects.filter(price__lte=mileage) if mileage_less_more == 'mileage_more_than': cars = cars.objects.filter(price__gte=mileage) if production_year: if production_year_less_more == 'production_year_less_than': cars = cars.objects.filter(production_year__lte=production_year) if production_year_less_more == 'production_year_more_than': cars = cars.objects.filter(production_year__gte=production_year) if production_year_less_more == 'production_year_exact': cars = cars.objects.filter(production_year=production_year) I assumed that it would work like any other variable in python and even if one of the above filters won't be used (mileage will be None for example) then it just won't execute. But this kind of approach is not supported by django as I learned. Then I tried many weird things with f strings but it also didn't work. Then I tried with this approach: if mileage: if mileage_less_more == 'mileage_less_than': mileage_qs = Car.objects.filter(price__lte=mileage) if mileage_less_more == 'mileage_more_than': mileage_qs = Car.objects.filter(price__gte=mileage) else: mileage_qs = Car.objects.all() if production_year: if production_year_less_more == 'production_year_less_than': production_year_qs = Car.objects.filter(production_year__lte=production_year) if production_year_less_more == 'production_year_more_than': production_year_qs = Car.objects.filter(production_year__gte=production_year) if production_year_less_more == 'production_year_exact': production_year_qs = Car.objects.filter(production_year=production_year) else: production_year_qs = Car.objects.all() cars_final = Car.objects.all().intersection( mileage_qs, production_year_qs) … -
Load a large json file 3.7GB into dataframe and convert to csv file using ijson
I have a large json data file with 3.7gb. Iam going to load the json file to dataframe and delete unused columns than convert it to csv and load to sql. ram is 40gb I try to load data but it fails because of out of memory data_phone=[] with open('data.json', 'r', encoding="UTF-8") as f: numbers = ijson.items(f, 't',multiple_values=True) for num in numbers : data_phone.append(num) It shows errors Out of memory I try another way data_phone=[] data_name=[] with open("Vietnam_Facebook_Scrape.json", encoding="UTF-8") as json_file: cursor = 0 for line_number, line in enumerate(json_file): print ("Processing line", line_number + 1,"at cursor index:", cursor) line_as_file = io.StringIO(line) # Use a new parser for each line json_parser = ijson.parse(line_as_file) for prefix, event, value in json_parser: if prefix =="t": data_phone.append(value) if prefix =="id": data_name.append(value) cursor += len(line) it still error : out of memory Thanks for reading -
Value Error "The parameter 'item' must be an integer or a string" while converting pyFTS example to Django app
I want to convert the example from pyFTS to Django application, but it is not work even the code is same. Sample code: https://colab.research.google.com/drive/1S1QSZfO3YPVr022nwqJC5bEJvrXbqS_A from pyFTS.data import Enrollments from pyFTS.partitioners import Grid from pyFTS.models import chen train = Enrollments.get_data() test = Enrollments.get_data() partitioner = Grid.GridPartitioner(data=train,npart=10) model = chen.ConventionalFTS(partitioner=partitioner) model.fit(train) print(model) forecasts = model.predict(test) my code: from django.shortcuts import render from django.http import JsonResponse from pyFTS.data import Enrollments from pyFTS.partitioners import Grid from pyFTS.models import chen import warnings def index(request): warnings.filterwarnings('ignore') train = Enrollments.get_data() test = Enrollments.get_data() df = Enrollments.get_dataframe() fs = Grid.GridPartitioner(data=train, npart=10) model = chen.ConventionalFTS(partitioner=fs) model.fit(train) # ==========>>> error here forecasts = model.predict(test) data = {'message': 'Hello world'} return JsonResponse(data) The error is: The parameter 'item' must be an integer or a string and the value informed was 0 of type <class 'numpy.intc'>! My Pipfile is: [[source]] url = "https://pypi.org/simple" verify_ssl = true name = "pypi" [packages] django = "*" djangorestframework = "*" django-cors-headers = "*" pyFTS = "*" gunicorn = "*" whitenoise = "*" pandas = "*" scipy = "*" matplotlib = "*" dill = "*" [dev-packages] [requires] python_version = "3.8" screenshot: How to solve this? I have not found any solution. -
How to do a class based delete view that allows DELETE method in django 3.1?
In Django 3.1, the typical DeleteView accepts GET and POST. See https://docs.djangoproject.com/en/3.1/ref/class-based-views/generic-editing/#deleteview and I reproduce below: A view that displays a confirmation page and deletes an existing object. The given object will only be deleted if the request method is POST. If this view is fetched via GET, it will display a confirmation page that should contain a form that POSTs to the same URL. How do I do a DELETEView that's class based view and also accepts DELETE method? -
registration form not getting saved in the database
this is my models.py for the registration session choice = ( ('2020-2021', '2020-2021'), ('2021-2022', '2021-2022'), ('2022-2023', '2022-2023'), ) registrationSession=models.CharField(max_length=15,choices=choice,blank=False) this is my views.py registrationSession=request.POST['RegistrationSession'] stu=Student(registrationSession=registrationSession) stu.save() this is my template <div class="component"> <label for="RegistrationSession">Registration Session <span style="color:red;">*</span> </label> <select class="col-form-label " style="width:760px;" name="RegistrationSession" id="RegistrationSession"> <option>2020-21</option> <option>2021-22</option> <option>2022-23</option> </select> </div> -
Django CACHEOPS different timeout for different querysets
I'm using Django CACHEOPS. cacheops' README In settings.py how can I config different timeouts for different querysets? (cache the get queryset for 10 seconds and cache queryset fetches for 60 seconds) Something like this: (This obviously has duplication key error) CACHEOPS = { 'blog.Article': {'ops': 'fetch', 'timeout': 60}, 'blog.Article': {'ops': 'get', 'timeout': 10}, } My goal is: I want to cache each article detail page longer than the article list page. -
Display list of HTML in one field of list_display in django admin
I want to display all colors with HTML on django admin page. I can do it with one color instance but when I have a product with multiple colors it will display a string and won't render it with HTML format. # models.py class Color(models.Model): product = models.ForeignKey( Product, related_name='colors', on_delete=models.CASCADE) color = ColorField(default='#FFFFFF') # ... def colored_name(self): return mark_safe( '<span style="color: %s;">%s</span>' % (self.color, self.color) ) # admin.py class ProductAdmin(admin.ModelAdmin): inlines = [ImageInline, ColorInline] list_display = [ 'title', 'price', 'active', 'colors' ] def colors(self, obj): result = list() for color in obj.colors.all(): result.append(color.colored_name()) return result -
Django Passing Parameters to Formset
Create a method for the Form form.py --- def create_certificate_form(id_certificate): class CertificateAdditionalFieldForm(forms.ModelForm): class Meta: model = CertificateAdditionalField fields = [ 'certificate_title', 'no', 'component_activities', 'text', ] def __init__(self, *args, **kwargs): super(CertificateAdditionalFieldForm, self).__init__(*args, **kwargs) self.fields['certificate_title'].queryset = CertificateAdditionalTitle.objects.filter( is_deleted=False,certificate_id=id_certificate) self.fields['certificate_title'].required = True return CertificateAdditionalFieldForm view.py -- def createCertificateField(request, certificate_pk): template_name = "contract/final/experience_certificate_TitleAndOtherField.html" certificate = ExperienceCertificate.objects.get(pk=certificate_pk) title = CertificateAdditionalTitle.objects.filter(certificate_id=certificate_pk) CertificateAdditionalFieldForm = create_certificate_form(certificate_pk) CertificateAdditionalFieldFormset = formset_factory( CertificateAdditionalFieldForm,extra=1 ) if request.method == 'GET': formset = CertificateAdditionalFieldFormset() elif request.method == 'POST': formset = CertificateAdditionalFieldFormset(data=request.POST) if formset.is_valid(): try: with transaction.atomic(): for form in formset: set_save = form.save(commit=False) set_save.created_user = request.user set_save.save() messages.success(request, "Filed Successfully Add") logger.debug(f"Filed Successfully Add {formset}") return redirect('experience_certificate', pk=certificate.pk) except IntegrityError: print("Cant save") data = { 'formset': formset, 'title': title, } return render(request, template_name, data) -
jQuery/Django retrieving file
I have seen many answers to questions like this, but none has solved my problem... I want to produce a pdf in the backend and then download it to the user. So I have a basic blank page with a button. For that button there is a jQuery function: $.post("{% url 'printReport' %}", { 'params' : JSON.stringify({ 'reportcode' : 'HelloWorld', }) }, function(data, status) { $("#testZone").text(data) }); On the server side, I produce the pdf and save it locally in the server folder. This goes perfect. Then, in the views file I have this: def printRreport(request): if request.method=="POST": res = producePdf(request) #works fine! the PDF is birght an shiny, saved on the server response = HttpResponse(res.data,content_type='application/pdf') response['Content-Disposition'] = 'attachment; filename="report.pdf"' #setting response headers return response where res.data is actually open(pdf_path,'r').read() this is 70% fine, because the browser actually receives the pdf data inside the request response (I can see it on the dev console). It's 30% wrong because this does not give me a download dialog and does not allow me to save a pdf file on the client side. What is wrong here? In my case I opted by using a POST method, I know it's debatable, but I … -
DJango call management command asynchronously
I have a DJango app and where users upload many images. What I want is to trigger a management command using the call_command function from management once a new object is created but the problem is I want to do it asynchronously. I don't want to keep the user waiting for the management command to finish. Yes I am aware about third party services like Celery but I want to keep it simple. I also know that I can schedule a cron job but the thing is I want the change to reflect instantly. Is there any other way to do so? -
Django- Is it possible to make a fill-in form on a website with an autoreply with data from a selfmade database?
I want to build a website with a function within where people can fill in a form. And when they admit their answer, they get a few examples of products that fit in their wishes. Is this possible in Django? -
Redeploy or edit a dynamic website after publishing
I made a dynamic website using django and i already hosted it on aws. I should always add new blog posts to my website, which does not have a login page to create them, so i created them through the code on my local machine. How i can edit the hosted website to add these new blog posts ? -
Django - Filtering queryset many times while using the same name?
in django docs I found this solution for filtering multiple time the same query in many lines: q1 = Entry.objects.filter(headline__startswith="What") q2 = q1.exclude(pub_date__gte=datetime.date.today()) q3 = q1.filter(pub_date__gte=datetime.date.today()) But I need to make it on one variable name. I created it like this thinking that it will work similar to python variables: q1 = Entry.objects.filter(headline__startswith="What") q1 = q1.exclude(pub_date__gte=datetime.date.today()) q1 = q1.filter(pub_date__gte=datetime.date.today()) But apparently it is not, I am doing something wrong. How can I achieve this while using one variable? -
unable to fide one specific template
when i got /contact in my website it shows this error i am created my models, views, forms.pyforms all root project which is website and I did not create any other application error views.py settings.py -
Django "if form.is_valid()" returns None
Im new to using Django and I am trying to have a file uploaded from a form, to then be handled after a POST request. However in my views function if form.is_valid() returns None and I am unable to retrieve the request.FILES['file']. Does anyone know what the issue is? Thanks views.py function: def success(request): if request.method == 'GET': return render(request, 'send_receive_files/success.html', {'form': UploadFileForm}) else: form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): handle_uploaded_file(request.FILES['file']) return redirect('/') else: return HttpResponse('invalid') forms.py: from django import forms class UploadFileForm(forms.Form): title = forms.CharField(max_length=50) filer = forms.FileField() form template: {% block content %} {% load static %} <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="{% static 'css/dashboard.css' %}"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;1,100&display=swap" rel="stylesheet"> <title>Dashboard</title> </head> <header> <a id="header-link" href="/"> <h1 id="heading">File Share</h1> <div id="cont"> <a id ="login" class="header-buttons" href="/login">Logout</a> </div> </a> </header> <body> <center> <div id="send-container"> <form method="post" action="/dashboard/upload/"> {% csrf_token %} {% if error %} <p id="error">{{error}}</p> {% endif %} <input name="username-send" type="text" placeholder="Recipient's username" id="username" required> <input name="file-send" type="file" id="file" required> <p> <input type="submit" value="Send"> </p> </form> </div> </center> </body> </html> {% endblock %} -
Azure Django React Web App - Operational Error 1045
I deployed my django react web app on azure with a MySQL server being the database engine, but once I go to the django admin page to sign in, I'm getting this error I have 20.151.49.29 as one of my outbound IP addresses. Does anyone know why it's denying access? Also, my other web pages that are linked from the landing page are showing up as blank.