Cookiecutter created directory giving me issues running development server and python shell
Asked Answered
E

1

7

I created a django project using cookiecutter as reccomended by Two scoops of Django 1.8. It's called icecreamratings_project I use the git cmd prompt and use

'cd icecreamratings_project'.

When i want to use the built-in python interpreter by using python manage.py shell it gives me the following error. File "C:\Users\Armando\Desktop\icecreamratings_project\config\settings\common.py", line 13, in import environ ImportError: No module named 'environ'

I looked into the directory and the following code is there:

from __future__ import absolute_import, unicode_literals
from sys import path

import environ

ROOT_DIR = environ.Path(__file__) - 3  # (/a/b/myfile.py - 3 = /)
APPS_DIR = ROOT_DIR.path('twoscoops_project')

env = environ.Env()

No module named environ exists, but I'm assuming environ is in reference to the virtual environment. Im not familiar with the cookiecutter documentation or how it creates django templates, but i created a virtual environment named environ.

The message i got after that is that there is no Path in environ. Can someone help?

Ego answered 17/9, 2015 at 4:46 Comment(0)
L
14

The environ module can be found in django-environ.

django-environ is a requirement of cookiecutter-django's requirements/base.txt.

base.txt is a requirement of cookiecutter-django's requirements/local.txt.

It seems you'll install environ and other needed modules by completing the following steps from cookiecutter-django's README.rst:

Getting up and running

The steps below will get you up and running with a local development environment. We assume you have the following installed:

  • pip
  • virtualenv
  • PostgreSQL

First make sure to create and activate a virtualenv, then open a terminal at the project root and install the requirements for local development:

$ pip install -r requirements/local.txt

Source: https://github.com/pydanny/cookiecutter-django#getting-up-and-running

Lazare answered 17/9, 2015 at 5:55 Comment(1)
Worked like a charm!!Ego

© 2022 - 2024 — McMap. All rights reserved.