Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

0
I cannot import from my package !!
Post Body

Take a look at my repo https://github.com/MustafaAdam/Blogr/tree/trying_blueprints

Is there anyway where I can define my 'app', 'db' and 'bcrypt' in the init.py of the site package.

Then in the run.py module I simply 'from site import app' and app.run() it?

I could not do that and faced a lovely variety of error messages related to imports and package.

I comprised and tried to do everything in the run.py module and then run everthing from there(as is shown in the repo). But importing the blueprints and the error handler kicked my ass again.

This time, python refused to acknowledge the 'utils' module of 'site' package and also refused to acknowledge that 'site' itself is a package?

"ImportError: No module named 'site.utils'; 'site' is not a package"

Doesn't the existance of a init.py in a directory makes it a packge?

Author
Account Strength
90%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,362
Link Karma
766
Comment Karma
2,445
Profile updated: 1 month ago
Posts updated: 5 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago