Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Cannot seem to access multiple Images after upload Django
So been at it on and off for about a week so thought I might as well throw it out there and see if anyone can help. complete newbie to django and web development so apologies if I'm being completely thick here. I'm trying to setup a page requiring no authentification that end users will upload images to (and nothing else), which will then have various things done to them before being returned to them in the same page. If possible, I'd rather not have to store them but that's another query all together. (you'll see i'm saving them at the moment as most tutorials seem to run with Models) What I'm struggling to do at the minute is get Django to return all the files from the POST request in a single template, I always seem to just get the last one. Would appreciate any advice. views.py: def uploadfiles(request): if request.method == 'POST': form = ImageUploaderForm(request.POST, request.FILES) files = request.FILES.getlist('image') if form.is_valid(): handle_uploaded_file(request.FILES['image']) output = form.save() print("form validated") return render(request, 'home/imageuploader_detail.html', {'form': output, 'files': output.image}) else: print("form isn't valid") else: print("Form Generated") form = ImageUploaderForm() return render(request, "home/imageuploader_form.html", {'form': form}) models.py class ImageUploader(models.Model): image = models.ImageField(upload_to='images/') forms.py class ImageUploaderForm(forms.ModelForm): … -
How to transform QuerySet to another type?
Say you've got these models: class NetworkMember(models.Model): network = models.ForeignKey(Network, related_name='members', on_delete=models.CASCADE, db_column='network_id_id') user = models.ForeignKey(User, on_delete=models.CASCADE, db_column='user_id_id') class Network(models.Model): created_at = models.DateTimeField(auto_now_add=True, db_index=True) And you have filtered NetworkMember: user_networks = NetworkMember.objects.filter(user=self.user) Now user_networks is QuerySet of NetworkMember, how can I transform it to QuerySet of Network? Doing .values('network') and .values_list('network') doesn't change the type of QuerySet to Network. -
Embedding password protected pdf's?
I have some pdf files which I would like to publish on my websites. I don't want them to be downloaded. Is there any way that I can publish those files as password protected such that they are automatically opened on the website but when someone downloads it they can't open unless they have the password? -
Page rendering with model.py but not working after data is added in the models through admin portal
I am working on MDN Django tutorial on LocalLibrary. I am using get_absolute_url to render generic ListView and DetailView page. App is rendering page with else statement i.e. There are no books in the library. But when I add books in the library through admin portal in my models. Same pages are not rendering and reflecting below error NoReverseMatch at /catalog/books/ Reverse for 'book-detail' not found. 'book-detail' is not a valid view function or pattern name. Please find the models.py as follows import uuid # Required for unique book instances from django.db import models # Create your models here. # Used to generate URLs by reversing the URL patterns from django.urls import reverse class Genre(models.Model): """Model representing a book genre.""" name = models.CharField( max_length=200, help_text='Enter a book genre (e.g. Science Fiction)') def __str__(self): """String for representing the Model object.""" return self.name class Language(models.Model): name = models.CharField(max_length=200, help_text='Enter a book language(e.g. English)') def __str__(self): return self.name class Book(models.Model): """Model representing a book (but not a specific copy of a book).""" title = models.CharField(max_length=200) # Foreign Key used because book can only have one author, but authors can have multiple books # Author as a string rather than object because it hasn't … -
Laravel or Django which is best to carry on
I am new to web development. I am learning laravel with vue . I have also started to learn django. To which should have focus more? Which of these 2 framework have more usability? -
Getting JSONDecodeError when hosting on heroku but not locally
This is the heroku logs - File "/app/CovidSlots/urls.py", line 18, in <module> 2021-05-13T15:28:34.921279+00:00 app[web.1]: from SlotBooking import views 2021-05-13T15:28:34.921280+00:00 app[web.1]: File "/app/SlotBooking/views.py", line 14, in <module> 2021-05-13T15:28:34.921280+00:00 app[web.1]: states = logic.print_states() 2021-05-13T15:28:34.921281+00:00 app[web.1]: File "/app/SlotBooking/logic.py", line 30, in print_states 2021-05-13T15:28:34.921281+00:00 app[web.1]: res_info = res.json() 2021-05-13T15:28:34.921282+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/requests/models.py", line 897, in json 2021-05-13T15:28:34.921282+00:00 app[web.1]: return complexjson.loads(self.text, **kwargs) 2021-05-13T15:28:34.921282+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/json/__init__.py", line 346, in loads 2021-05-13T15:28:34.921283+00:00 app[web.1]: return _default_decoder.decode(s) 2021-05-13T15:28:34.921283+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/json/decoder.py", line 337, in decode 2021-05-13T15:28:34.921283+00:00 app[web.1]: obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 2021-05-13T15:28:34.921284+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/json/decoder.py", line 355, in raw_decode 2021-05-13T15:28:34.921284+00:00 app[web.1]: raise JSONDecodeError("Expecting value", s, err.value) from None 2021-05-13T15:28:34.921285+00:00 app[web.1]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) This is the snippet of the view which is being called (the error is produced in while calling logic.print_states() - from time import strftime from django.http.request import validate_host from django.shortcuts import redirect, render import requests from . import logic from django.core.mail import send_mail from CovidSlots import urls states = [] states = logic.print_states() districts = [] email_id = '' def homepage(request): context = {"states":states} if request.method == 'POST': email_id = request.POST.get('email_id') state_name = request.POST.get('state_name') state_id = logic.find_state_id(state_name) return redirect ('districtpage', state_id = state_id, email_id = email_id) return … -
Getting an signaturedoesntmatch error when I tried to access a image that I uploaded to aws s3 bucket
enter image description here This is the error I'm getting. I'm new to aws and I don't know how things works here. I referred many documentations but noting worked for me. Please give a solution for this. Thanks. -
Using CDN for local development
I am looking into CDN for storing and displaying images, and below are my questions related to developing for CDN. I use Python + Django + jQuery + Apache Airflow + Postgresql + Docker for the development using a local linux machine. With regards to CDN: Is the use of CDN configuration based where changing the configuration will store the files on CDN instead of local storage? In this case, on my model class, I continue to use ImageField, and when I change the configuration, it will internally use CDN to store I am planning to use Cloudflare, Azure, or AWS for CDN in production. Does the code change depending on the CDN provider? When I display images on the web page, I usually refer to the local URL. In the case of CDN, I will have to point to the CDN URL, do I have to keep that in mind when I develop? Appreciate it if you can answer, and also point to some information page. Thanks in advance. -
Why is RichText not working in wagtail admin for posts? This is the type of thing that happens: <h2>Trying post.content|richtext</h2>
Wagtail implemented on an existing Django site. I have included the parts of code most likely to contain the error. If you would like anything else please do not hesitate to request it. Code as follows: models.py from django.conf import settings from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.urls import reverse from django.utils.text import slugify from wagtail.core.models import Page from wagtail.core.fields import RichTextField from wagtail.admin.edit_handlers import FieldPanel class Subject(models.Model): subject = models.CharField(max_length=200) subject_slug = models.SlugField(editable=True, max_length=200, null=False, unique=True) def get_absolute_url(self): kwargs = { 'slug': self.slug } return reverse('subject', kwargs=kwargs) def save(self, *args, **kwargs): value = self.subject self.slug = slugify(value, allow_unicode=True) super().save(*args, **kwargs) panels = [ FieldPanel('subject'), FieldPanel('subject_slug') ] class Meta: # Gives the proper plural name for class called subject verbose_name_plural = "Subjects" def __str__(self): return self.subject class Post(models.Model): author = models.ForeignKey(User, default=1, on_delete=models.SET_DEFAULT, related_name='blog_posts') date_added = models.DateTimeField(auto_now_add=True) subject = models.ForeignKey(Subject, verbose_name='Subject', default=1, on_delete=models.SET_DEFAULT) title = models.CharField(max_length=200, unique=True) slug = models.SlugField(editable=True, max_length=200, null=False, unique=True) content = RichTextField() def get_absolute_url(self): kwargs = { 'slug': self.slug } return reverse('post_detail', kwargs=kwargs) def save(self, *args, **kwargs): value = self.title self.slug = slugify(value, allow_unicode=True) super().save(*args, **kwargs) content_panels = Page.content_panels + [ FieldPanel('author'), FieldPanel('subject'), FieldPanel('title'), FieldPanel('slug'), FieldPanel('content') ] class Meta: … -
video controls like seek dragging video prograss bar is not working in html?
video control like seek 10 sec video progress bar dragging is not working in HTML <video controls width=100% height=100% preload="auto" preload="metadata" autoplay="autoplay" ><source src={{objs.video.url}} type="video/mp4"></video> note : i am using Django -
How to guarantee atomicity of nested objects while saving model instance?
Here's my code: from django.db import models class Car(models.Model): is_crawler = models.BooleanField() class Wheel(models.Model): car = models.ForeignKey(A, related_name='wheels', on_delete=models.CASCADE) radius = models.IntegerField() class WheelSerializer(serializer.ModelSerializer): class Meta: model = Wheel fields = '__all__' class CarSerializer(serializers.ModelSerializer): wheels = WheelSerializer(many=True) class Meta: model = Car fields = '__all__' def validate(self, attrs): is_crawler = attrs.get('is_crawler') wheels_data = attrs.get('wheels') if wheels_data and is_crawler: raise ValidationError("Crawler can't have wheels") def create(self, validated_data): is_crawler = attrs.get('is_crawler') wheels_data = attrs.get('wheels') car = Car.objects.create(**validated_data) for wheel_data in wheels_data: wheel_serializer = WheelSerializer(**wheel_data) if wheel_serializer.is_valid(): wheel_serializer.save() return car So, when I'm trying to send something like {"is_crawler": true, "wheels": [{"radius": 5}]} to CarSerializer it raises ValidationError that causes 400 response from the view. But it doesn't prohibit creating wheels for crawlers in admin for example. Is there a way to transfer validation from serializer to model's clean or save method to prohibit creating crawler cars with wheels or add wheels to crawler cars in any part of code? And if there is, will it raise the same ValidationError in DRF and return HTTP_400 from DRF? -
django.core.exceptions.AppRegistryNotReady error in my django app
i'm trying to add the django-ads module to my web app but i have few problems. to install django ads i need to add code in my settings.py but there is the module gettext wich is needed and there is some "_" who generate me error. so i imported the following things in my settings.py. from ads.conf import gettext from django.utils.translation import gettext as _ after that when i try to runserver that's show me this error : django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time. don't know how to fix that, i've seen some post about de wsgi.py files but he's good. wsgi.py : import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yufindRe.settings') application = get_wsgi_application() -
Error : render() got an unexpected keyword argument 'renderer'
I am building a BlogApp and I am stuck on an Error. I made a multiple upload feature using class based views for handling form BUT when i open page then it is keep showing me render() got an unexpected keyword argument 'renderer' views.py from django.views.generic.edit import FormView from .forms import UploadForm from .models import Gallery class UploadView(FormView): template_name = 'form.html' form_class = UploadForm def form_valid(self,form): for each in form.cleaned_data['gallerys']: Gallery.objects.create(file=each) return super(UploadView,self).form_valid(form) File "C:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\django\forms\forms.py", line 277, in as_table errors_on_separate_row=False, File "C:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\django\forms\forms.py", line 236, in _html_output 'field_name': bf.html_name, File "C:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\html.py", line 376, in <lambda> klass.__str__ = lambda self: mark_safe(klass_str(self)) File "C:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\django\forms\boundfield.py", line 34, in __str__ return self.as_widget() File "C:\Users\AppData\Local\Programs\Python\Python37\lib\site-packages\django\forms\boundfield.py", line 97, in as_widget renderer=self.form.renderer, Exception Type: TypeError at /lists/ Exception Value: render() got an unexpected keyword argument 'renderer' I have seen many answers BUT they seems little different from my error. I have no idea, what am i doing wrong in this. Any help would be Appreciated. Thank you in Advance, -
Reverse for 'post_detail' with arguments '('chempion',)' not found. 1 pattern(s) tried: ['(?P<category_slug>
Reverse for 'post_detail' with arguments '('chempion',)' not found. 1 pattern(s) tried: ['(?P<category_slug>[-a-zA-Z0-9_]+)/(?P[-a-zA-Z0-9_]+)/$'] as soon as I add function and view to templates I catch this error view.py def post_detail(request, category_slug, slug): post = get_object_or_404(Post, slug=slug) try: next_post = post.get_next_by_date_added() except Post.DoesNotExist: next_post = None try: previous_post = post.get_previous_by_date_added() except Post.DoesNotExist: previous_post = None context = { 'post': post, 'next_post': next_post, 'previous_post': previous_post } return render(request, 'post_detail.html', context) urls.py path('<slug:category_slug>/<slug:slug>/', post_detail, name='post_detail'), path('<slug:slug>/', category_detail, name='category_detail'), post detail.html {% if next_post %} <a href="{% url 'post_detail' next_post.slug %}">Next</a> {% else %} This is the last post! {% endif %} -
How to access forgin key value in react from django api
I have django api in which i have post model which is linked to comments and categories table by forgin key now i am feching data for post detail and when i try to access category of that post it return s id and i want to access name of category this is my post list view { "id": 4, "title": "BLOG PAGE", "body": "testing", "owner": "ankit", "comments": [], "categories": [ 2 ], "created_at": "2021-05-07T17:22:32.989706Z" }, { "id": 5, "title": "Test Post", "body": "This is a test Post", "owner": "ankit", "comments": [], "categories": [ 2 ], and this is my categories [ { "id": 2, "name": "Python", "owner": "ankit", "posts": [ 4, 5, 6, 8 ] } ] and this is my post detail component export class PostDetail extends React.Component { constructor(props) { super(props); const ID = this.props.match.params.id this.state = { data: [], loaded: false, placeholder: "Loading" }; } formatDate(dateString){ const options = { year: "numeric", month: "long", day: "numeric" } return new Date(dateString).toLocaleDateString(undefined, options) } componentDidMount() { fetch(`${Url}posts/${this.props.match.params.id}`) .then(response => { if (response.status > 400) { return this.setState(() => { return { placeholder: "Something went wrong!" }; }); } return response.json(); }) .then(data => { this.setState(() => { return … -
Get brackets with a value in html displayed, example {{test}} output in html {{test}} [duplicate]
I am trying to get {{test}} displayed as text in the html webpage within the django server. But it disseapear because the framework is handeling it as a tag. Is there a work around ? thnx ! -
How to pass "LIVE" data with django sessions?
I have a long task to process in django admin's response_change . It takes a few good minutes so I would like to make a progress indicator. I store the progress into sessions but when I read the session from a different view (which is called on a timer from JS every 300ms) the session does not contain the updated progress (which I set in the long task). It always has what the session had when the long task ended last time. Official docs say "You can read it and write to request.session at any point in your view. You can edit it multiple times.". So why isn't it working ? -
Select2 with Django not accepting selections
I've been working on this problem for a couple days now and I am just stumped. Trying to integrate Select2.js without using the django-select2 app. My model: class CEID(models.Model): process = models.CharField(max_length=4, choices=PROCESS_LEVELS) ceid = models.CharField(max_length=6) representative = models.ManyToManyField(get_user_model(), blank=True) functional_area = models.CharField(max_length=200) score = models.IntegerField(null=True, blank=True) ceid_is_production = models.BooleanField(default=True) ceid_is_front_end = models.BooleanField(default=True) ceid_is_hidden = models.BooleanField(default=False) ceid_pdl = models.ManyToManyField('PDL', blank=True) user_edited = models.BooleanField(default=False) def __str__(self): return str(self.process) + ' ' + str(self.ceid) if self.ceid else '' def __unicode__(self): return str(self.process) + ' ' + str(self.ceid) if self.ceid else '' class Meta: ordering = ('process', 'ceid', 'process',) def calculate_ceid_score(self): entities = Entity.objects.filter( ceid__id=self.id).filter(production=True) score = 0 for entity in entities: score += entity.score if entity.score else 0 self.score = score / len(entities) if len(entities) > 0 else 0 self.save() return My view: class PagesAdminSetCeidUserAssociation(LoginRequiredMixin, View, UserPassesTestMixin): template_name = 'pages/pages_admin_set_ceid_user_association.html' login_url = '/login/' def test_func(self): return self.request.user.is_superuser def get(self, request): form = PagesAdminSetCeidUserAssociationForm() if request.is_ajax(): if request.GET.get('dat_type') == 'representatives': representatives = get_user_model().objects.filter( username__icontains=request.GET.get('term') ) representative_response_content = list( representatives.values()) return JsonResponse(representative_response_content, safe=False) elif request.GET.get('dat_type') == 'ceids': ceids = CEID.objects.filter( ceid__icontains=request.GET.get('term') ) ceid_response_content = list(ceids.values()) return JsonResponse(ceid_response_content, safe=False) return render(request, self.template_name, {'form': form}) def post(self, request): form = PagesAdminSetCeidUserAssociationForm(request.POST or None) if form.is_valid(): print(form) … -
Add onetoone field to all users, django
In the middle of the project, I was faced with the fact that I needed to expand my user model. Since it is very problematic to create a custom model at the moment, I decided to use the onetoone field and everything is successful, but there is a question. I would like to add a relationship to my user model proxy for existing users and set permissions for them. How can I do that? I need to set start value for all users class UserPermission(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) start = models.BooleanField(default=True) professional = models.BooleanField() team = models.BooleanField() last_update = models.DateTimeField() -
DRF permissions best practise DRY
Whats the best way to do view permissions in DRF based on user type currently? In my structure there are several user_types and for example TEAM_LEADER cant create a team object but can see the list of teams. Which means for the same class view i want to use different permissions for POST and GET for example. I'm looking to do this as dry as possible and i'm trying to follow the skinny view fat models design principle(also wondering if that's good practice to follow in 2021). models.py for the user model class User(AbstractBaseUser): ...fields here objects = UserManager() USERNAME_FIELD = "email" def __str__(self): return self.email def has_perm(self, perm, obj=None): if perm.Meta.verbose_name=="worksite" and perm.request.method =="POST": if self.user_type <= self.DEPARTMENT_MANAGER: return True else: return False return True views.py class DashboardPermissions(BasePermission): message="You dont have permission for this action" def has_permission(self, request, view): return request.user.has_perm(view.Meta.verbose_name) class ViewName(CreateAPIView): permission_classes = (IsAuthenticated,DashboardPermissions) authentication_classes = () serializer_class = WorksiteSerializer queryset = Worksite.objects.all() class Meta: verbose_name="view_name" def get(self, request, *args, **kwargs): return self.list(request, *args, **kwargs) def post(self, request, *args, **kwargs): return self.create(request, *args, **kwargs) Bonus question would my solution create any performance issues? -
Django Case When with backward relationship
I want to annotate "status". And I need: status="Not Processed" if at least one of backward related forlistproduct has status == ListProduct.Status.NOT_PROCESSED; status="Deficit" if at least one of backward related forlistproduct has status == ListProduct.Status.Deficit and no one of them has a status == ListProduct.Status.NOT_PROCESSED; status="Completed" if at least one of backward related forlistproduct has status == ListProduct.Status.Completed and no one of them has a status == ListProduct.Status.DEFICIT and no one of them has a status == ListProduct.Status.NOT_PROCESSED. I have tried this code def annotate_status(self): return self.annotate(status=Case( When( forlistproduct_set__status=ListProduct.Status.NOT_PROCESSED, then=Value("Not Processed") ), When( Q(forlistproduct_set__status=ListProduct.Status.DEFICIT) & ~Q(forlistproduct_set__status=ListProduct.Status.NOT_PROCESSED), then=Value("Deficit") ), When( Q(forlistproduct_set__status=ListProduct.Status.COMPLETED) & ~Q(forlistproduct_set__status=ListProduct.Status.DEFICIT) & ~Q(forlistproduct_set__status=ListProduct.Status.NOT_PROCESSED), then=Value("Completed") ), output_field=CharField() )) but it raised an exception below. Traceback (most recent call last): File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch response = self.handle_exception(exc) File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception raise exc File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/venv/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "/Users/nizhdanchik/PycharmProjects/UpworkProjects/SlopehelperERP/backend/production_api/views.py", line 74, in retrieve return … -
Cannot access field in Django Graphene
The field which is specified in my models file is not included in the GraphiQL, I have tried to rename the field, delete it and define it again, even changing the type of field also updating the graphene-django package. None of these I have mentioned didn't work. -
Please help me is fixing this problem in python-django forms
from django import forms from .models import Tweet MAX_TWEET_LENGTH=240 class TweetForm(forms.ModelForm): class meta: model = Tweet field = ['content'] def clean_content(self): content = self.cleaned_data.get('content') if len(content)>MAX_TWEET_LENGTH: raise forms.ValidationError("This tweet is to long") return content This is my code for form ... but when I call the TweetForm in views.py it says Exception Type: ValueError Exception Value : ModelForm has no model class specified I tried in django shell also : here is the error message ~\AppData\Local\Programs\Python\Python37\lib\site-packages\django\forms\models.py in __init__(self, data, files, auto_id, prefix, initial, error_class, label_suffix, empty_permitted, instance, use_required_attribute, renderer) 285 opts = self._meta 286 if opts.model is None: > 287 raise ValueError('ModelForm has no model class specified.') 288 if instance is None: 289 # if we didn't get an instance, instantiate a new one ValueError: ModelForm has no model class specified. here is my views.py def tweet_creat_view(request,*args,**kwargs): form = TweetForm(request.POST or None) if form.is_valid(): obj = form.save(commit=False) obj.save() form = TweetForm() return render(request,"components/forms.html",context={"form":form}) -
ValueError: ModelForm has no model class specified. ValueError at /profile/ ModelForm has no model class specified
from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.decorators import login_required from .forms import UserRegisterForm, UserUpdateForm,ProfileUpdateForm def register(request): if request.method == 'POST': form = UserRegisterForm(request.POST) if form.is_valid(): form.save() username = form.cleaned_data.get("username") messages.success(request, f'Yor account has been created! You are now able to login') return redirect('login') else: form = UserRegisterForm() return render(request, 'user/register.html',{'form': form}) @login_required def profile(request): u_form = UserUpdateForm() p_form = ProfileUpdateForm() context = { 'u_form' : u_form, 'p_form' : p_form } return render(request,'users/profile.html', context) -
AWS not acknowledging my Procfile during deploy
I am trying to run some commands in a Procfile (located in my root, also tried placing it in any relevant directory that could be the root to no avail). Ideally, I would like to see this log: 2021-01-27 19:04:05 INFO Instance deployment successfully used commands in the 'Procfile' to start your application Environment: Elastic Beanstalk Python 3.6 running on 64bit Amazon Linux/2.10.0