I have seen several questions relating to this topic but none work for me I am running Django 3 and python 3 with ubuntu and using firefox browser
when i run "python3 manage.py runserver"
my homepage loads at 127.0.0.1:8000 but when I add /admin in the browser
127.0.0.1:8000/admin
it still stays at the homepage not the admin page
i notice on the running server i get
December 09, 2019 - 00:40:46 Django version 1.11.11, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. " "and when i add /admin the following line appears"
[09/Dec/2019 00:46:05] "GET /admin HTTP/1.1" 200 3
but still i dont see the admin page
please ask and i can share
"settings.py" etc and any other information update
my "main" folder has a urls.py file which looks like:
from django.conf.urls import url
from . import views
app_name = "main"
urlpatterns = [
url(r'^', views.homepage, name="homepage"),
]
my "mysite/mysite" folder has a urls.py file that looks like:
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^', include('main.urls')),
url(r'^admin/', admin.site.urls),
]
Thanks to a comment from @chrisbyte if i comment out
#url(r'^', include('main.urls'))
Line then my admin page shows up, But then I dont get anything I have done on my "main" page.
from django.contrib import adminand have something likeurl(r'^admin/', admin.site.urls),in your urls patterns, BEFORE you include your public urls, which looks likeurl(r'^', include('your.public.urls')),- chrisbyte