skip to Main Content

Html – Paginator only working for one web page django

Paginator is only working for the first index page but it doesn't work on the profile page def profile(request, profile): cur_profile = User.objects.get(username=profile) user_posts = Posts.objects.filter(creator=cur_profile.id).all().order_by('-id') follow_num = cur_profile.following.all().order_by('id') following_num = cur_profile.followers.all().order_by('id') paginator2 = Paginator(user_posts, 5) page_numberr = request.GET.get(paginator2) page_objj…

VIEW QUESTION

Visual Studio Code – How to set environment variables in python when using vscode

In vscode I have a project structure (using Windows): venv .env test_load_env.py My .env file contains: PYTHONPATH=. MY_USERNAME=myusername MY_PASSWORD=mypass test_load_env.py: import os username = os.environ.get("MY_USERNAME") password = os.environ.get("MY_PASSWORD") print(f"username: {username}, password: {password}") print(os.environ.get("PYTHONPATH")) Using vscode 1.84.2 the .env file is…

VIEW QUESTION
Back To Top
Search