Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8605281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:47:25+00:00 2026-06-12T02:47:25+00:00

My settings: My directory structrue looks like this: /views/ |– index.jade |– layout.jade /account/

  • 0

My settings:

My directory structrue looks like this:

/views/
   |-- index.jade
   |-- layout.jade
   /account/
      |-- login.jade
      |-- register.jade

I have configured my view engine as follows:

app.set('view engine', 'jade');

Edit: I also have

app.set('views', __dirname + '/views');

My controllers look like:

app.get('/login', redirectIfLogined, function(req, res){
    res.render('account/login', { title: "Login", redir: req.query.redir});
});

app.get('/register', redirectIfLogined, function(req, res) {
    res.render('account/register', { title: "Register"});
});

My issue

With settings as described I am getting a 500 error:

500 Error: failed to locate view "layout"
at Function.compile (D:\dev\Azznomad\express-template\node_modules\express\lib\view.js:58:15)
at ServerResponse._render (D:\dev\Azznomad\express-template\node_modules\express\lib\view.js:414:18)
at ServerResponse.render (D:\dev\Azznomad\express-template\node_modules\express\lib\view.js:315:17)
at ServerResponse._render (D:\dev\Azznomad\express-template\node_modules\express\lib\view.js:429:10)
at ServerResponse.render (D:\dev\Azznomad\express-template\node_modules\express\lib\view.js:315:17)
at D:\dev\Azznomad\express-template\controllers\accountController.js:6:13
at callbacks (D:\dev\Azznomad\express-template\node_modules\express\lib\router\index.js:272:11)
at D:\dev\Azznomad\express-template\modules\middleware\account.js:27:9
at callbacks (D:\dev\Azznomad\express-template\node_modules\express\lib\router\index.js:272:11)
at param (D:\dev\Azznomad\express-template\node_modules\express\lib\router\index.js:246:11)

As soon as I am copying my layout.jade file into the /account/ folder it works perfectly. Unfortunately this would make no sense since it forced me to have redundant layout files.

What am I missing?


Btw. this code snipplets are from AzzNomad’s express/mongoose template which is very helpful in order to learn express with mongoose.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:47:27+00:00Added an answer on June 12, 2026 at 2:47 am

    You need to put

    extends ../layout

    in your view under accounts since layout is not in the same folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(r'^media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}), As you can see, I have a directory called media under
My directory structure looks like the following: project/ app1/ app2/ settings.py From within the
By default in windows application setting are saved in this directory: %USERPROFILE%\Local Settings\Application Data\<Company
I have this flex project.And the below mentioned is my directory structure (List1).Now if
So I have installed Django on my FreeBSD 8.2 box like this: pip install
I have a Django application with the following directory structure /myapp/ /login/ /myapp_settings/ /subapp1/
I have a query in Delphi using DBExpress TSQLQuery that looks like so ActiveSQL.sql.add('SELECT
IntelliJ keeps a bunch of cache files in its system directory (settings and downloaded
Generally I keep directory specific settings in .bashrc and whenever I change directory execute
Settings.settings generates Settings.Designer.cs which presumably generates app.config which then is copied to output directory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.