Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 566
Armando Xhimanki Avatar asked Sep 17 '15 04:09

Armando Xhimanki


1 Answers

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

like image 166
Joe Young Avatar answered Nov 10 '22 07:11

Joe Young