I
I
Ilya2015-12-25 20:34:36
Django
Ilya, 2015-12-25 20:34:36

What's the problem with django admin?

Rolled out django blog, on nginx+uwsgi. And now the main page opens and I can not get into the admin panel.
mistake

Not Found The requested URL /admin/ was not found on this server. django

urls.py
urlpatterns = [
    url(r'^$', PostListView.as_view(), name='list'),
    url(r'^(?P<slug>[-\w]+)/$', PostDetail.as_view(),name="post"),
    url(r'^admin/', admin.site.urls),
    url('^markdown/', include( 'django_markdown.urls')),
]

settings.py
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_markdown',
    'devel0per',
]

uwsgi config
[uwsgi]
project = devel0per.space
base = /home

chdir = %(base)/www/devel0per.space
venv = DJANGO_SETTINGS_MODULE=blog_devel0per.settings
virtualenv = /home/venv/space
module = blog_devel0per.wsgi:application
#logger = file:/home/log/uwsgi.log
master = true
processes = 5
socket = 127.0.0.1:35766
vacuum = true
daemonize = /home/log/uwsgi.log

nginx config
server {
  listen 80;
  server_name devel0per.space;
  return 301 https://$server_name$request_uri;  
    rewrite ^(.*) https://devel0per.space$uri permanent;
}

server {
        listen 443 ssl;
    server_name devel0per.space;
    
    location /static/	{
  alias /home/www/devel0per.space/static/;
    }
    
location / {
        include         uwsgi_params;
        uwsgi_pass      127.0.0.1:35766;
    }
    
    ssl on;
    ssl_stapling on;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         kEECDH+AES128:kEECDH:kEDH:-3DES:kRSA+AES128:kEDH+3DES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
    ssl_certificate     /etc/nginx/key/dev.crt;
    ssl_certificate_key /etc/nginx/key/dev.key;
    ssl_session_cache   shared:SSL:2m;
    ssl_session_timeout 24h;
    ssl_prefer_server_ciphers on;
    add_header Strict-Transport-Security "max-age=31536000;";
    add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /csp-report";
 
    access_log /home/log/devel0per-access.log;
    error_log /home/log/devel0per-error.log;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2015-12-25
@nuBacuk

you need to roll it back
, or write it in settings.py

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

Z
zelsky, 2015-12-25
@zelsky

Look in urls.py for the presence of the /admin/ path at the end and in settings.py for the presence of the admin panel connected to the installed app.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question