Re: importing from myapp

2017-10-24 Thread hatch
That works great, thanks! :)

On Tuesday, October 3, 2017 at 5:27:04 AM UTC-7, Mike Bayer wrote:
>
> On Mon, Oct 2, 2017 at 9:06 PM, hatch > 
> wrote: 
> > from myapp.mymodel import Base 
> > target_metadata = Base.metadata 
> > 
> > http://alembic.zzzcomputing.com/en/latest/autogenerate.html 
> > 
> > What is the preferred way to access myapp? As far as I can tell it's not 
> > normally available using this structure (doing the above gives 
> ImportError), 
> > without altering sys.path. Is it expected that "myapp" is installed? Or 
> > another approach? 
>
> it's expected that "myapp" is installed in some way, for development I 
> usually just set PYTHONPATH or set up a virtualenv with pip install 
> -e. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: importing from myapp

2017-10-03 Thread Mike Bayer
On Mon, Oct 2, 2017 at 9:06 PM, hatch  wrote:
> from myapp.mymodel import Base
> target_metadata = Base.metadata
>
> http://alembic.zzzcomputing.com/en/latest/autogenerate.html
>
> What is the preferred way to access myapp? As far as I can tell it's not
> normally available using this structure (doing the above gives ImportError),
> without altering sys.path. Is it expected that "myapp" is installed? Or
> another approach?

it's expected that "myapp" is installed in some way, for development I
usually just set PYTHONPATH or set up a virtualenv with pip install
-e.


>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy-alembic" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy-alembic+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.