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

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})