now i did copy another section of my site but i did change the views and urls to change and changed the html but the page appears exactly the same as the one i copied without my changes if more info is needed please tell me
Please post the views and the url file entries for both views.
copied view: from django.shortcuts import renderfrom django.http import HttpResponse, Http4 - Pastebin.com
original view: from django.shortcuts import renderfrom django.http import HttpResponse# Cre - Pastebin.com
next message will have rest since im new and 2 link per post
copied urls: from django.urls import pathfrom . import viewsapp_name = 'unknown'url - Pastebin.com(reason name is unknown is cause i dont know what im gonna call this section of the site)
original urls: from django.urls import pathfrom . import viewsapp_name = 'index'urlpa - Pastebin.com
ok put more info bellow in the pastebins
For future reference, please post the actual code here rather than as a reference to an external site. (When doing so, enclose it between lines of three backtick - ` characters to maintain the formatting. This means you’ll have a line of ```, then your code, then another line of ```.)
What does your root urls.py file look like? (Again, post it here rather than externally)
ok in the future i will do that just on most fourms and stuff they prefer external so i thought that was here too but heres the root urls
"""myfirstpysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include, path
from main import views
from index import views
#from chat import views
from unknown import views
from django.conf import settings
from django.contrib.staticfiles import views
from django.urls import re_path
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib.auth import views as auth_views
urlpatterns = [
#path('', auth_views.LoginView.as_view()),
path('', include('index.urls')),
#path('', views.home, name='home')
path('chatv1/', include('chat.urls')),
path('chatv2/', include('chatversion2.urls')),
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
path('2/', include('main.urls')),
path('games/', include('games.urls')),
path('staticf/', include('static.urls')),
path('???', include('unknown.urls'))
]
#r'^
#urlpatterns += staticfiles_urlpatterns()
```
(Side note: Having it internal here means it’s searchable on the site for other people doing research, and it’s less likely to have the information just “go away” in the future. As long as the site is running, the code should stay with it. We can’t say the same about external references.)
Using the question mark ("?") in a url is an extremely bad idea. It’s the separator between the url and query variables. If you try to go to www.example.com/???
, it’s going to resolve to www.example.com/
- which is going to map to your index.urls
urls. You would need to url-encode those question marks, and even then I’m not sure how Django is going to resolve it.
ok i will try changing that and see if that fixes it (it did)