Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got page not found error #10

Open
Ronnie08 opened this issue Jun 9, 2019 · 2 comments
Open

got page not found error #10

Ronnie08 opened this issue Jun 9, 2019 · 2 comments

Comments

@Ronnie08
Copy link

Ronnie08 commented Jun 9, 2019

  • Django Wordpress API version: 0.2.0
  • Django version: 1.11.21
  • Python version: 2.7.12
  • Operating System: windows 7_x64

Description

I got the page not found error when i visit http://127.0.0.1/blog

like this:

Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/blog/
Raised by: wordpress_api.views.BlogListView

this is my settings.py

`import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))

Quick-start development settings - unsuitable for production

See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = '*'

SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True

ALLOWED_HOSTS = ['*']

Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'html',
'wordpress_api',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'website.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR + "/templates",],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.static',
],
},
},
]

WSGI_APPLICATION = 'website.wsgi.application'

Database

https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

Internationalization

https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'zh-Hans'

TIME_ZONE = 'Asia/Shanghai'

USE_I18N = True

USE_L10N = True

USE_TZ = True

Static files (CSS, JavaScript, Images)

https://docs.djangoproject.com/en/1.8/howto/static-files/

SITE_ID = 1
SITE_ROOT = os.path.join(os.path.abspath(os.path.dirname(file)),'..')

STATIC_ROOT = os.path.join(SITE_ROOT,'static')

STATIC_URL = '/static/'

TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
os.path.join(BASE_DIR, "templates").replace('\','/'),

)
STATICFILES_DIRS = (
("css", os.path.join(STATIC_ROOT,'css')),
("javascript", os.path.join(STATIC_ROOT,'javascript')),
("images", os.path.join(STATIC_ROOT,'images')),
("fonts", os.path.join(STATIC_ROOT,'fonts')),
("lang", os.path.join(STATIC_ROOT,'lang')),

)

#ueditor
MEDIA_ROOT = os.path.join(SITE_ROOT,'media/')

MEDIA_URL = '/media/'

WP_URL = 'http://127.0.0.1/wordperss'

BLOG_POSTS_PER_PAGE =5

WP_API_ALLOW_LANGUAGE = True
WP_API_BLOG_CACHE_TIMEOUT = 60 * 60 * 24`

@jlariza
Copy link
Contributor

jlariza commented Jun 11, 2019

@Ronnie08 is the url WP_URL = 'http://127.0.0.1/wordperss' correct? I think you misspelled wordpress.

also, is that site running? what wordpress version are you using?

@kallewesterling
Copy link
Contributor

@jlariza It looks like this issue could be closed, tbh. @Ronnie08 clearly misspelled wordpress and thus the issue is null and void.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants