Template doesn't exist Djangostack Bitnami Django 1.8 - mod-wsgi

I use Djangostack Bitnami to deploy site
on dev server everefing is ok
but on production with apach and mod_wsgi I get error Template doesn't exist
this is my httpd-app.conf
<IfDefine !IS_DJANGOSTACK_LOADED>
Define IS_DJANGOSTACK_LOADED
WSGIDaemonProcess wsgi-djangostack processes=2 threads=15 display-name=%{GROUP}
</IfDefine>
I do all by https://wiki.bitnami.com/Components/Django#How_to_start_a_Django_project.3f
my settings.py
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'account',
# 'web_backend',
'pinax_theme_bootstrap',
'bootstrapform',
'django_comments',
'flot',
'status',
'dashboard',
'latencies',
'graphs',
'klaus',
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
# 'django.template.context_processors',
'django_settings_export.settings_export',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'account.context_processors.account',
'pinax_theme_bootstrap.context_processors.theme',
],
'debug': False,
},
},
]
WSGI_APPLICATION = 'wsgi.application'
my wsgi.py
# coding: utf-8
from __future__ import unicode_literals
import os, sys, site
# Add the site-packages of the chosen virtualenv to work with

trouble was in apache config
it's needed to add python-path in wsgiscripalias daemon

Related

How can i add a module in odoo15

I use mac to study odoo,
And i use this document to build my first module with command
./odoo-bin --addons-path=/Users/xuhongxin/src/custom,addons
And i successfully start the odoo,
But i can not find the estate module;
How can i solve this problem?
the document is :
https://www.odoo.com/documentation/15.0/developer/howtos/rdtraining/03_newapp.html
my manifest.py is :
{
'name': 'estate',
'summary': 'estate',
'description': "estate",
'website': 'https://www.odoo.com/page/crm',
'depends': [
'base_setup',
'sales_team',
'mail',
'calendar',
'resource',
'fetchmail',
'utm',
'web_tour',
'contacts',
'digest',
'phone_validation',
],
'data': [
'security/crm_security.xml',
'security/ir.model.access.csv',
'data/crm_lead_prediction_data.xml',
'data/crm_lost_reason_data.xml',
'data/crm_stage_data.xml',
'data/crm_team_data.xml',
'data/digest_data.xml',
'data/mail_data.xml',
'data/crm_recurring_plan_data.xml',
'wizard/crm_lead_lost_views.xml',
'wizard/crm_lead_to_opportunity_views.xml',
'wizard/crm_lead_to_opportunity_mass_views.xml',
'wizard/crm_merge_opportunities_views.xml',
'views/assets.xml',
'views/calendar_views.xml',
'views/crm_recurring_plan_views.xml',
'views/crm_menu_views.xml',
'views/crm_lost_reason_views.xml',
'views/crm_stage_views.xml',
'views/crm_lead_views.xml',
'views/digest_views.xml',
'views/mail_activity_views.xml',
'views/res_config_settings_views.xml',
'views/res_partner_views.xml',
'views/utm_campaign_views.xml',
'report/crm_activity_report_views.xml',
'report/crm_opportunity_report_views.xml',
'views/crm_team_views.xml',
],
'demo': [
'data/crm_team_demo.xml',
'data/mail_activity_demo.xml',
'data/crm_lead_demo.xml',
],
'css': ['static/src/css/crm.css'],
'installable': True,
'application': True,
'auto_install': False
}
You must pay attention to the path that odoo is having while searching for addons which is where all modules are located. You can check this via running the server in the command line and looking for the path that says is running or taking the info from, mostly is addons directory, make sure your module is running inside that exact path and if not, just add the path to the variable that stores the addons paths.

How to have multiple patterns for lint-staged?

I had it match on .rb and .js files for instance.
e.g. **/*.{js,rb}
And wanted to also match on Gemfile and Rakefile for instance.
the solution was to recursively use {}, e.g.
"lint-staged": {
"{Gemfile,Rakefile,**/*.{js,rb,rake,ru}}": [
"./node_modules/prettier/bin-prettier.js --write"
],
"**/*.js": [
"node_modules/eslint/bin/eslint.js"
],
"{Gemfile,Rakefile,**/*.{rb,rake,ru}}": [
"bundle exec rubocop -a"
]
}

PhantomJS 2.1.1 Error

I can't run my test with karma and phantomJS because of this error:
PhantomJS 2.1.1 (Windows 7.0.0) ERROR
SyntaxError: Use of reserved word 'class'
Here is my config karma.conf.js:
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '#angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-phantomjs-launcher'),
require('#angular/cli/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['#angular/cli']
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_DEBUG,
autoWatch: false,
browsers: ['PhantomJS'],
singleRun: true
});
};
I updated angular to v5 and it's happening since then... I read to use karma webpack preprocessor but I'm not using webpack and why was it running before ? No clue.
Thanks a lot if you have a tips or a response :)
I am also facing the same problem after upgrading the angular8 to angular9.
After up-gradation to angular9 when I am trying to run ng test with PhantomJS it is showing
PhantomJS 2.1.1 (Windows 8.0.0) ERROR
SyntaxError: Unexpected token ')'
but if I am trying with ng test --browsers=Chrome --codeCoverage=true it is working fine.
It runs fine with all ES6 keywords, syntax etc.,
PhantomJS requires polyfills so install core-js, and import it before importing zone.
import 'core-js/es6';

Nuxt Sites not getting crawled

I have made a website using NUXT that needs SEO
When I use www.xml-sitemaps.com website to see if it can find all my pages, it only finds the home page, and none of the other routes. When I try other NUXT demo websites it finds them all.
My robots.txt file looks like:
User-agent: *
Disallow: /profile/
Sitemap: https://www.example.com/sitemap.xml
I am using #nuxtjs/sitemap to generate the sitemap.xml that ends up looking something like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url> <loc>https://www.example.com/about</loc> </url>
<url> <loc>https://www.example.com/</loc> </url>
</urlset>
And if this helps, my nuxt.config.js looks like:
module.exports = {
/*
** Headers of the page
*/
head: {
title: 'Title',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Title' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
mode: 'spa',
loading: { color: '#3B8070' },
build: {
/*
** Run ESLint on save
*/
extend (config, { isDev, isClient }) {
if (isDev && isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
},
css: [
'~/assets/main.css'
],
modules: [
'#nuxtjs/pwa',
[
'#nuxtjs/sitemap', {
generate: true,
hostname: 'https://www.example.com',
exclude: [
'/profile'
]
}
]
],
plugins: [
'~/plugins/uikit.js',
'~/plugins/fireauth.js'
],
manifest: {
name: 'Title',
lang: 'en'
},
router: {
middleware: 'router-auth'
},
vendor: [
'firebase',
'uikit'
]
}
I'm the creator of the nuxt sitemap module.
Your sitemap-module configuration is set in the wrong section.
Please, update your nuxt.config.js:
modules: ['#nuxtjs/pwa', '#nuxtjs/sitemap'],
sitemap: {
generate: true,
hostname: 'https://www.example.com',
exclude: [
'/profile'
]
},
plugins: [
Then run npm run generate.
Finally check your generated sitemap.xml in the \dist\ folder.
(If you have an other issue or question, you may open an issue on github project: https://github.com/nuxt-community/sitemap-module/issues)
It's important to understand what's going on with different Nuxt.js modes. Read the explanation about server side rendering in the Nuxt.js Guide, where they explain the difference between the three modes the framework can be configured to work in:
Universal (with server side rendering, so that when any page is rendered, that page will be served with all HTML rendered (SEO and crawler friendly mode)
SPA (Single Page Application) which will serve up the HTML skeleton together with css and javascript bundles, which will only be unbundled to create the initial DOM in the browser. Cool for intranet apps, bad for SEO.
Static generation of all pages (pre-rendering) so that the site can be served up in any shared hosting as simple HTML.
Once the concepts are clear, you can try changing the "mode" property in your Nuxt.js configuration file from "SPA" to "Universal", together with the other suggestion regarding xml sitemap configuration in the same nuxt.config.js file.
Additionally, you can try out and learn about different configurations by either using:
The Nuxt.js starter template discussed in the Installation Guide.
Something like Create Nuxt App that, once installed via npm install -g create-nuxt-app allows you to see how many different configurations are automatically set up for you.
Since you are in SPA mode you will not get much success with SEO, if you can run in universal mode then you will see full benefit of nuxt/vue.
See this website I did with Nuxt in universal mode.

Unrecognized options "suites" under "behat"

I am using behat 2.4(stable), and I am trying to pass parameters into class's, that extends BehatContext class, constructor.
However I get 'Unrecognized options "suites" under "behat"', with the following set up.
I am using the following behat.yml file:
default:
suites:
default:
contexts:
exampleContext:
browser: http://localhost:8080
browser_version: /var/tmp
paths:
features: %behat.paths.base%/../../
bootstrap: %behat.paths.base%/../../
extensions:
Behat\MinkExtension\Extension:
# base_url is the URL to your dev site. Make sure you include
# the port at the end. e.g.
base_url: http://example.web01.com
default_session: selenium2
browser_name: 'chrome'
selenium2:
capabilities: { "browser": "firefox", "version": "14"}
sites/all/libraries/extensions/DrupalBehatExtension.php: ~
filters:
# The default profile does not rebuild from nothing so do not run tests
# that require a rebuild from nothing.
tags: ~#require-rebuild
context:
class: DrupalContext
parameters:
# If you'd like to test on a clone of the actual site data set to true.
use_test_database: false
# If an existing test database exists then it will be used unless reset_database is set to true.
reset_database: false
# If you would like to clear the db and run site install on every feature
# set to the name of an install profile, otherwise set to false.
# If you do set this you should also set use_test_database to true.
rebuild_on_feature: false
# If you would like to enable a module after running site install
rebuild_module: false
# Set the name of the site folder to use for settings.php.
site: dev.example.com
My class implementation is
class exampleContext extends BehatContext {
public function __construct($browser = 'ie', $browser_version = '8') {
...
}
How can I achieve this? The only answer I've found is the one that demands to take out the DrupalContext which is rather important.
How can i get the Parameters from Behat.yml to a php file?
suites option was added in behat3. You should update version.
Try this. This is for Behat 2 not 3 though!
mySymfonyProject/composer.json:
"require": {
"behat/behat": "2.5.*#stable",
"behat/behat-bundle": "1.0.0",
"behat/symfony2-extension": "1.1.2",
"behat/mink": "1.5.0",
"behat/mink-extension": "~1.3",
"behat/mink-selenium2-driver": "1.1.1",
"behat/mink-goutte-driver": "1.0.9"
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
behat.yml
default:
context:
class: FeatureContext
parameters:
browser: 'ie'
browser_version: '8'
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
base_url: 'http://mysymfonyproject.local/app_test.php/'
javascript_session: selenium2
browser_name: firefox
goutte: ~
selenium2: ~
paths:
features: %behat.paths.base%/src
bootstrap: %behat.paths.features%/Context
CONTEXT FEATURE
mySymfonyProject/src/Site/CommonBundle/Features/Context/FeatureContext.php
<?php
namespace Site\CommonBundle\Features\Context;
use Behat\MinkExtension\Context\MinkContext;
class FeatureContext extends MinkContext
{
public function __construct($browser, $browser_version)
{
// Do whatever you wish with params
}
//And your own methods
}
TESTS
When you have feature files you can run them like this (this runs all in one go. for more info read behat doc):
bin/behat #SiteCommonBundle