Acces to django context to html js
I'm trying to access to my django context from my views.py to my index.html page but something wrong and I need help. My context from django called in my html template is working fine with: {% for i in links…
I'm trying to access to my django context from my views.py to my index.html page but something wrong and I need help. My context from django called in my html template is working fine with: {% for i in links…
I have this database setup: class Profile(AbstractBaseUser, PermissionsMixin): email = models.CharField(max_length=30, null=True, unique=True) date_created = models.DateTimeField(auto_now=True) ... class SubProfile(models.Model): profile = models.OneToOneField(Profile, on_delete=models.CASCADE) display_name = models.CharField(max_length=25) ... class SubProfilePost(models.Model): profile = models.ForeignKey(Profile, related_name='sub_profile_postings', on_delete=models.CASCADE) title = models.CharField(max_length=20, null=False) looking_for_date =…
I am trying to start working with django and visual studio but I cannot figure out what are the instructiosns are to set up a virtual environemnt. How do you do this? I have both tried in a blank file…
I am writing a program to retrieve data and display it in a Django template. I have a function called match_algo() that takes a long time to run. I want to initially show 'Loading...........' on the page, and once the…
I have a dropdown list that I got from an uploaded CSV file from Django that I want to pass back to a different Django view with javascript when selected. I keep getting a 404 error (index.js:9 POST http://127.0.0.1:8000/gui_app/%7B%%20url%20%22get_selection%22%20%%7D 404…
I'm working on a Django backend with a React frontend and using sessions to manage user authentication. After successfully logging in a user, I'm setting session data (e.g., user_id, name, email, etc.), but the session ID is returning as None…
I am trying to send an image to be stored in the backend. The image is stored in a react useState that is updated when the user changes the the input form and is sent to its django backend api.…
127.0.0.1/:1 Refused to execute script from 'http://127.0.0.1:8000/scripts/scripts.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. error i got... how do i even fix this? i have generated a template from django and they…
I'm resurrecting my local environment for a Django project that I haven't run locally in 2 years, working through issues around things that have gone stale. But I have one a little different: it looks like Django is finding/using an…
Despite seeing many similar issues in other threads, I've been unable to configure Nginx to serve static files from my Django project. Here are my two static variables in my settings.py: STATIC_URL = '/static/' STATIC_ROOT='/opt/django/portfolio/collectstatic' Here is my dockerfile to…