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

  • Home
  • SEARCH
  • 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 8781733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:22:52+00:00 2026-06-13T20:22:52+00:00

I’m trying to create a basic blogging application in Python using Web.Py. I have

  • 0

I’m trying to create a basic blogging application in Python using Web.Py. I have started without a direcotry structure, but soon I needed one. So I created this structure:

Blog/
├── Application/
│   ├── App.py
│   └── __init__.py
|
├── Engine/
│   ├── Connection/
│   │   ├── __init__.py
│   │   └── MySQLConnection.py
│   ├── Errors.py
│   └── __init__.py
├── __init__.py
├── Models/
│   ├── BlogPostModel.py
│   └── __init__.py
├── start.py
└── Views/
    ├── Home.py
    └── __init__.py

start.py imports Application.App, which contains Web.Py stuff and imports Blog.Models.BlogPostModel, which imports Blog.Engine.Connection.MySQLConnection.
Application.App also imports Engine.Errors and Views.Home. All these imports happen inside contructors, and all code inside all files are in classes. When I run python start.py, which contains these three lines of code:

from Application import App
app = App.AppInstance()
app.run()

The following stack trace is printed:

Blog $ python start.py 
Traceback (most recent call last):
  File "start.py", line 2, in <module>
    Blog = App.AppInstance()
  File "/home/goktug/code/Blog/Application/App.py", line 4, in __init__
    from Blog.Views import Home
ImportError: No module named Blog.Views

But according to what I understand from some research, this should run, at least until it reaches something after App.py. Can anyone tell where I made the mistake? (I can provide more code on request, but for now I’m stopping here, as this one is getting messier and messier).

  • 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-13T20:22:53+00:00Added an answer on June 13, 2026 at 8:22 pm

    App.py contains the statement

    from Blog.Views import Home
    

    So Blog needs to be among the list of directories Python searches for modules (sys.path). That can be arranged in various ways.

    1. Since you are starting the app with python start.py, the directory
      containing start.py is automatically added to the search path. So
      you could change

      from Blog.Views import Home
      

      to

      from Views import Home
      
    2. Another option would be to move start.py up one level, out of the
      Blog directory. Then when you call python start.py, the
      directory containing start.py will also be the directory
      containing Blog. So Python would find Blog when executing from
      Blog.Views ...

    3. Finally, you could add the Blog directory to your PYTHONPATH environment
      variable.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to create an if statement in PHP that prevents a single post
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.