I am attempting to install the Django Jet dashboard, but I'm unable to get anywhere with it.
I've followed the installation instructions, but no matter what I'm getting "Page Not Found" despite the URLs for Jet being listed.
There are a handful of Issues opened on this, but none offer a solution outside that it was resolved in newer versions, and I am using the recommended commit (latest).
Issues:
https://github.com/geex-arts/django-jet/issues/289
https://github.com/geex-arts/django-jet/issues/62
Urls.py:
from django.contrib import admin
from django.urls import path, include, re_path
from depot import views
urlpatterns = [
path('', include('depot.urls')),
path('', include('stores.urls')),
path('admin/', admin.site.urls),
re_path(r'^jet/', include(('jet.urls', 'jet'))),
re_path(r'^jet/dashboard/', include(('jet.dashboard.urls', 'jet-dashboard'))),
]
I have no custom overriding admin templates. I have tried just visiting /admin/, but my admin looks like the default Django Admin (someone mentioned its supposed to take over the original admin templates).
Installed Apps:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'depot',
'stores',
'jet',
'jet.dashboard',
]
I have also verified I have django.template.context_processors.request under Templates in my settings.py as well.
This is a super important note I missed. Simply moved django.contrib.admin to the bottom of my INSTALLED_APPS and this resolved this issue.
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'depot',
'stores',
'jet',
'jet.dashboard',
'django.contrib.admin',
]
Related
I'm just getting started with Django, and I'm a touch rusty with web development, so this may be an easy one. I'm stepping through the Django Polls Tutorial from the official documentation and I encounter a problem nearly right away. I'm not having success accessing http://localhost:8000/polls/ . I receive the error...
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/polls/
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
admin/
The current path, polls/, didn’t match any of these.
Here is my relevant code...
\mysite\polls\views.py
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
\mysite\polls\urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]
\mysite\urls.py
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]
\mysite\mysite\setting.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
ROOT_URLCONF = 'mysite.urls'
Development server reads...
Not Found: /polls/
[06/Dec/2022 15:02:01] "GET /polls/ HTTP/1.1" 404 2095
I have tried a hodgepodge of fixes that I've seen from other similar tutorial fixes, but nothing has worked and I feel like I'm taking stabs in the dark at this point.
Thank you Hash & Carlos for taking a look.
I modified as suggested, and restarted server, but I get the exact same result...
\mysite\mysite\settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls',
]
I feel as though there is a simple path error occurring somehow. Could there have been an error in my django setup? I do see the spaceship at localhost:8000, as I should.
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls',
]
you are written the code correclty but you need to add your apps in intalled apps in settings.py file
I deleted my project, and my virtual environment(ok because this was the only thing in it), and started over from scratch. This time I was successful. I'm not completely sure why. It is not clear to me where the problem was, but I am ok moving on to bigger and better challenges. Ty for your responses!
BTW: I did not have to add "polls" to the settings.py file, which is consistent with the tutorial
In a django project, I have an app : app_signup.
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app_signup',
app_signup/urls.py
from django.urls import path, include
from . import views
urlpatterns = [
path('',views.index, name='index'),
]
Is it possible to add an alias to the app in order to see the alias (http://localhost:8000/alias/) instead of the name of the app(http://localhost:8000/app_signup/) in the url on the browser.
The name of the app in INSTALLED_APPS doesn't really matter. Your project's main urls.py file is the one that specifies the path. There when constructing the urlpatterns list, you can do path('alias/', include('app_signup.urls')) instead of path('app_signup/', include('app_signup.urls')).
As far as I understand from the example you added, you are editing the urls.py file within the app you created. Not your app, but directly in the project file (in the same directory as settings.py), urls.py probably as path('app_signup/', include('app_signup.urls')) as mentioned in the answer above. This is the urls.py you need to edit.
DoesNotExist at /admin/
URL matching query does not exist.
I copy code form old study-project and i haven't similar problem in old project.
settings.py INSTALLED_APPS:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'cutter',
]
admin.py:
from .models import URL
from django.contrib import admin
admin.site.register(URL)
urls.py:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('', include('cutter.urls')),
path('admin/', admin.site.urls),
]
All another functions work.
I have developed oscar /django applications before but I am completely stumped by this issue:
I can see the dashboard url in the supported urls list but I am not able to access it.
404 Page
I have forked a few apps from oscar like voucher, shipping, checkout, reviews and customized them in various ways(None of these are dashboard related) . This is my INSTALLED_APPS:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.flatpages',
'oscar.config.Shop',
'oscar.apps.analytics.apps.AnalyticsConfig',
'iirns.checkout.apps.CheckoutConfig',
'oscar.apps.address.apps.AddressConfig',
'iirns.shipping.apps.ShippingConfig',
'oscar.apps.catalogue.apps.CatalogueConfig',
'iirns.catalogue.reviews.apps.CatalogueReviewsConfig',
'oscar.apps.communication.apps.CommunicationConfig',
'oscar.apps.partner.apps.PartnerConfig',
'oscar.apps.basket.apps.BasketConfig',
'iirns.payment.apps.PaymentConfig',
'oscar.apps.offer.apps.OfferConfig',
'oscar.apps.order.apps.OrderConfig',
'oscar.apps.customer.apps.CustomerConfig',
'oscar.apps.search.apps.SearchConfig',
'iirns.voucher.apps.VoucherConfig',
'oscar.apps.wishlists.apps.WishlistsConfig',
'oscar.apps.dashboard.apps.DashboardConfig',
'oscar.apps.dashboard.reports.apps.ReportsDashboardConfig',
'oscar.apps.dashboard.users.apps.UsersDashboardConfig',
'oscar.apps.dashboard.orders.apps.OrdersDashboardConfig',
'oscar.apps.dashboard.catalogue.apps.CatalogueDashboardConfig',
'oscar.apps.dashboard.offers.apps.OffersDashboardConfig',
'oscar.apps.dashboard.partners.apps.PartnersDashboardConfig',
'oscar.apps.dashboard.pages.apps.PagesDashboardConfig',
'oscar.apps.dashboard.ranges.apps.RangesDashboardConfig',
'oscar.apps.dashboard.reviews.apps.ReviewsDashboardConfig',
'oscar.apps.dashboard.vouchers.apps.VouchersDashboardConfig',
'oscar.apps.dashboard.communications.apps.CommunicationsDashboardConfig',
'oscar.apps.dashboard.shipping.apps.ShippingDashboardConfig',
# 3rd-party apps that oscar depends on
'widget_tweaks',
'haystack',
'treebeard',
'sorl.thumbnail',
'django_tables2',
'mailer',
'extra',
]
and this is my root url file:
from django.conf.urls import url
from django.contrib import admin
from django.apps import apps
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('extra.urls')),
path('', include(apps.get_app_config('oscar').urls[0])),
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
I have django-admin-interface installed in my django app. I configured layout using this plugin and I would like to hide it from admin panel. My goal is to store basic settings in database. Is it possible?
I can't find any relations in my code to this plugin. There is only one place in my code (settings.py) where phrase admin_interface appears.
INSTALLED_APPS = [
'mainapp.apps.MainappConfig',
'admin_interface',
'colorfield',
'flat_responsive',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_extensions',
'smart_selects',
'activatable_model',
'bootstrap3',
'mainapp.apps.ConstanceConfig',
'constance.backends.database',
'kronos',
'ckeditor',
'django_admin_listfilter_dropdown',
]
Is is possible to hide this area in admin panel?
You can use unregister in your admin.py.
from django.contrib import admin
from admin_interface.models import Theme
admin.site.unregister(Theme)
Note:
If you have multiple apps and hence multiple admin.py, then adding this snippet in anyone of them will hide the app