django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. plz help me out plz

Seems like you didn’t define DJANGO_SETTINGS_MODULE which results in undefined settings. INSTALLED_APPS at this point is the first setting that Django wants to look up, resulting in the given error. With a default project creation the created manage.py defines said environment variable and if you run python manage.py runserver the settings are defined. Also see … Read more

Django add brackets to django models field

First and foremost try to follow PEP8 standards for naming variables From my understanding what you are trying to do is, while seeing in admin / user defined page this field must display APP_SERVER\(Prod\) in this format. For that better to keep you variable name as app_server and while creating ModelForms in forms.py change the … Read more

View doesn’t return HttpResponse

Remove the else def post_new(request): if request.method == “POST”: form = PostForm(request.POST or None) if form.is_valid(): ct = form.save(commit=False) ct.author = request.user ct.upload_time = request.upload_time ct.save() return redirect(‘iot:detail’, pk=ct.pk) form = PostForm() return render(request, ‘iot/post.html’, {“form”:form})

Django -> queryset[index] Index out of range

From the docs for order_by Here, there could potentially be multiple ordering data for each Event; each Event with multiple children will be returned multiple times into the new QuerySet that order_by() creates. In other words, using order_by() on the QuerySet could return more items than you were working on to begin with – which … Read more