Python/Django: virtualenv not recognizing app

I created a virtual environment (virtualenv env)and then created a python project for scraping websites. I installed the following using pip...

beautifulsoup4==4.4.1
Django==1.9
psycopg2==2.6.1
wheel==0.24.0

When ever I run the command python manage.py runserver I am getting the following error a ImportError: No module named flower.views error ('flower' in the name of my app).

The catch is that when I run the app outside of the virtual environment it works flawlessly, but if I bring it back into the virtual environment it breaks giving me the error state above.

Things I have tried...

1) checked INSTALLED APPS to make sure the app was there 2) tried to python manage.py migrate to make sure I migrated (got the same error) 3) removed old env file and created new virtual environment using the virtualenv env command & subsequently installed all of the previously displayed requirements that I listed above using pip 4) Tried removing and recreating the __init__.py file in the apps folder 5) Looked for any similar SO posts regarding my troubles (found nothing).

Let me know if there are any files you would like me to post. I would happily oblige.

Answers


Apparently the directories structure changes when I enter my virtual environment.

All I needed to do is change... from apps.flower.views import Index to from views import IndexIn my flower apps urls.py file.


Need Your Help

location-based Augmented Reality Framework (Android, iOS) with 3D POIs?

android ios frameworks augmented-reality location-based

I search a location-based Augmented Reality Framework with 3D POIs for Android, iOS or most suitable for both?

Bundler / eventmachine install issue (Rails / Windows)

ruby-on-rails windows eventmachine

I am having trouble installing Bundler in Windows. I first do a gem install, which seems fine (although only one gem is installed?):