Accessing `http://localhost:8080/admin/djcelery/` returns 403 in Django

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 14:28:55

问题


I am trying to access http://localhost:8080/admin/djcelery/ in my Django admin. I can access http://localhost:8080/admin , I can run celery task but I can't access the djcelery admin site.

Here is my url

    url(r'^admin/', include(admin.site.urls)),

Here is settings.py

import djcelery
djcelery.setup_loader()


BROKER_URL = "amqp://guest:guest@localhost:5672//"

CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend'

CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'

Do I have to add anything additional to access admin/djcelery/ ?


回答1:


I assume that you have already installed package

pip install django-celery

make sure you added it in INSTALLED_APPS

INSTALLED_APPS += ("djcelery", )

and run migrate

python manage.py migrate djcelery

if it still does not load you can glance Detailed Documentation



来源:https://stackoverflow.com/questions/32688101/accessing-http-localhost8080-admin-djcelery-returns-403-in-django

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!