Django Error DJANGO_SETTINGS_MODULE not set

After a long time, my machine is working now. It was almost one month for me in off line. Now I am again back to my django which seems to be a very good web development frame work. In it the most good facility seems to me is its database connectivity with the front end, I have created a project with it by doing

[bamachrn@bamachrn ~]$ django-admin startproject flickr

I get a folder named as flickr/

__init__.py,       manage.py,  settings.py    and urls,py

After getting this I have started an application of django by simply doing

[bamachrn@bamachrn ~]$ cd flickr

[bamachrn@bamachrn flickr]$python manage.py startapp clone

doing this I get a folder clone/

with files     __init__.py, models.py tests.py and views.py

now we can run our page with

[bamachrn@bamachrn flickr]$python manage.py runserver

we get the first page with django.

now after modifying the models.py and settings.py and making the database synchronization by doing…

[bamachrn@bamachrn flickr]$python manage.py syncdb

when I go to run the server it runs. But when I want to modify the database it shows ERROR! That DJANGO_SETTINGS_MODULE and sys.path is not set. To set these values I have done..

[bamachrn@bamachrn flickr]$export DJANGO_SETTINGS_MODULE=settings

[bamachrn@bamachrn flickr]$export PYTHONPATH=”/home/bamachrn/flickr”

then these problem get solved.

Enjoy.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: