Re: ImportError: No module named urls

2011-06-03 Thread Kann
Thanks, it works now. :D

On Jun 3, 2:14 pm, Kenneth Gonsalves <law...@thenilgiris.com> wrote:
> On Fri, 2011-06-03 at 05:07 -0700, Kann wrote:
> > > you have a file called mirnaweb.py - your path should contain only
> > the
> > > parent directory to your mirnaweb directory. Python is now looking
> > for
> > > settings inside mirnaweb.py
>
> > OK, now I changed the setting file into mirna_settings.py to avoid the
> > confusion with the directory name. I also include the new setting file
> > to django.wsgi file and telling the sys.path to append the new
> > PYTHONPATH. I wonder why Python still could not see the modules inside
> > my django project.
>
> > Also, I tried running the "python manage.py shell" again and it's
> > still looking for the "settings.py". Why is that?
>
> rename your mirnaweb.py file and change your settings file back to
> settings.py
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ImportError: No module named urls

2011-06-03 Thread Kann
> you have a file called mirnaweb.py - your path should contain only the
> parent directory to your mirnaweb directory. Python is now looking for
> settings inside mirnaweb.py

OK, now I changed the setting file into mirna_settings.py to avoid the
confusion with the directory name. I also include the new setting file
to django.wsgi file and telling the sys.path to append the new
PYTHONPATH. I wonder why Python still could not see the modules inside
my django project.

Also, I tried running the "python manage.py shell" again and it's
still looking for the "settings.py". Why is that?

Kann

On Jun 3, 1:56 pm, Kenneth Gonsalves <law...@thenilgiris.com> wrote:
> On Fri, 2011-06-03 at 04:44 -0700, Kann wrote:
> > Below is what I just did. Does this mean that I still have problem
> > with my pythonpath?
>
> yes
>
>
>
> > [xxx@lagrange mirnaweb]$ python manage.py
> > Error: Can't find the file 'settings.py' in the directory containing
> > 'manage.py'. It appears you've customized things.
> > You'll have to run django-admin.py, passing it your settings module.
> > (If the file settings.py does indeed exist, it's causing an
> > ImportError somehow.)
>
> you have a file called mirnaweb.py - your path should contain only the
> parent directory to your mirnaweb directory. Python is now looking for
> settings inside mirnaweb.py
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ImportError: No module named urls

2011-06-03 Thread Kann
Hi Kenneth,

Below is what I just did. Does this mean that I still have problem
with my pythonpath?

[xxx@lagrange mirnaweb]$ python manage.py
Error: Can't find the file 'settings.py' in the directory containing
'manage.py'. It appears you've customized things.
You'll have to run django-admin.py, passing it your settings module.
(If the file settings.py does indeed exist, it's causing an
ImportError somehow.)


[xxx@lagrange mirnaweb]$ django-admin.py shell
Error: Could not import settings 'mirnaweb' (Is it on sys.path? Does
it have syntax errors?): No module named mirnaweb


[xxx@lagrange mirnaweb]$ django-admin.py shell --settings='mirnaweb' --
pythonpath='/srv/mirnaweb'
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import urls
>>>


Kann



On Jun 3, 1:16 pm, Kenneth Gonsalves <law...@thenilgiris.com> wrote:
> On Fri, 2011-06-03 at 04:11 -0700, Kann wrote:
> > [Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No
> > module named urls
>
> no module named urls can also mean that urls.py has errors. From the
> shell try to import urls
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ImportError: No module named urls

2011-06-03 Thread Kann
Dear all,

Thanks so much for help me with the $DJANGO_SETTINGS_MODULE issue. Now
I just installed the wsgi module and try to use apache 2.2.17 to host
the django project. However, the page always throws error. I checked
the log file and it says there's no module named urls. Seems like
python could not find the 'urls.py' inside my django project
directory. Does this mean that I still haven't got my
$DJANGO_SETTINGS_MODULE set up properly. Below is the error and how I
set the django.wsgi file.


>>
[Fri Jun 03 13:04:28 2011] [notice] SIGHUP received.  Attempting to
restart
[Fri Jun 03 13:04:28 2011] [notice] Digest: generating secret for
digest authentication ...
[Fri Jun 03 13:04:28 2011] [notice] Digest: done
[Fri Jun 03 13:04:28 2011] [notice] Apache/2.2.17 (Unix) DAV/2 PHP/
5.3.6 mod_wsgi/3.2 Python/2.7 mod_perl/2.0.4 Perl/v5.12.3 configured
-- resuming normal operations
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] mod_wsgi
(pid=14389): Exception occurred processing WSGI script '/srv/mirnaweb/
apache/django.wsgi'.
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/handlers/wsgi.py", line 248, in
__call__
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] response =
self.get_response(request)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/handlers/base.py", line 141, in
get_response
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] return
self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/handlers/base.py", line 176, in
handle_uncaught_exception
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] if
resolver.urlconf_module is None:
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/core/urlresolvers.py", line 239, in
_get_urlconf_module
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]
self._urlconf_module = import_module(self.urlconf_name)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]   File "/usr/lib/
python2.7/site-packages/django/utils/importlib.py", line 35, in
import_module
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1]
__import__(name)
[Fri Jun 03 13:04:32 2011] [error] [client 127.0.0.1] ImportError: No
module named urls




import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'mirnaweb'

import django.core.handlers.wsgi

path = '/srv/mirnaweb'
if path not in sys.path:
sys.path.append(path)

application = django.core.handlers.wsgi.WSGIHandler()

>>
the content of my django project is as below:
>>>
[@yy mirnaweb]$ ls
apache   __init__.pyc  mediamirnaweb.pycscripts
tmp  urls.pyc
__init__.py  manage.py mirnaweb.py  mirnaworkbench  template
test.txt  urls.py

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Confusion about DJANGO_SETTINGS_MODULE

2011-06-03 Thread Kann
Thanks all, that cleared up a lot of my confusions and gave me a
really good lesson. Now I am facing a new problem and will post a new
topic then.

Kann

On Jun 2, 2:41 pm, Kenneth Gonsalves <law...@thenilgiris.com> wrote:
> On Thu, 2011-06-02 at 05:29 -0700, Kann wrote:
> > Thanks Oscar, I read the page already, but am still not totally
> > understood. The page said the value of DJANGO_SETTINGS_MODULE should
> > be "Python path syntax", e.g.  mysite.settings. What exactly is
> > "Python path syntax"? Would it be ok if I just provide the value as a
> > file name? Perhaps, "new_setting.py"?
>
> assume that you have a directory called 'mysite'. In this directory you
> will have to have an empty file called __init__.py. Then any file in
> that directory with a 'py' extension can be imported leaving out the
> extension. For example, foo.py can be imported as mysite.foo instead of
> mysite/foo. For this to work, 'mysite' should be on the python path.
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kann
Thanks Oscar, I read the page already, but am still not totally
understood. The page said the value of DJANGO_SETTINGS_MODULE should
be "Python path syntax", e.g.  mysite.settings. What exactly is
"Python path syntax"? Would it be ok if I just provide the value as a
file name? Perhaps, "new_setting.py"?

Kann

On Jun 2, 2:03 pm, Oscar Carballal <piz...@gmail.com> wrote:
> 2011/6/2 Kann <vearas...@gmail.com>:
>
> > Yep, but what if I just want to load all configurations from the
> > entirely new file. What should be the proper value for me to give to
> > the DJANGO_SETTINGS_MODULE?
>
> Take a look tohttps://docs.djangoproject.com/en/dev/topics/settings/
>
> You can load the new settings via "runserver
> --settings=new_settings_file.py or in production stablishing the
> DJANGO_SETTINGS_PATH from the WSGI server.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kann


> You can import "setting_new.py" from "settings.py", that way you still
> only need to stablish settings.py as the DJANGO_SETTINGS_MODULE.

Yep, but what if I just want to load all configurations from the
entirely new file. What should be the proper value for me to give to
the DJANGO_SETTINGS_MODULE?

> To know more about the python PATH take a look to the "sys" module in
> the python documentation[1] exactrly the method "sys.path" :)
>
> [1]http://docs.python.org/library/sys.html

Thanks for the link. I am reading it now. :)

Kann

On Jun 2, 1:14 pm, Oscar Carballal <piz...@gmail.com> wrote:
> You can import "setting_new.py" from "settings.py", that way you still
> only need to stablish settings.py as the DJANGO_SETTINGS_MODULE.
>
> It's strange though, the development server of django (python
> manage.py runserver) should import automatically the settings module
> and add it to the python path.
>
> To know more about the python PATH take a look to the "sys" module in
> the python documentation[1] exactrly the method "sys.path" :)
>
> [1]http://docs.python.org/library/sys.html
>
> 2011/6/2 Kann <vearas...@gmail.com>:
>
>
>
>
>
>
>
> > Dear all,
>
> > In order to run django on the server, I need to specify the file
> > containing all the configuration and export it as a system variable
> > called "DJANGO_SETTINGS_MODULE". Also, the documentation on django
> > project website also stated that the value of DJANGO_SETTINGS_MODULE
> > should be in "Python path syntax". I am just Python newbie and don't
> > really know what format the Python path syntax should be. Here is my
> > case:
>
> > The default setting file is "settings.py"; so, now, my
> > DJANGO_SETTINGS_MODULE is configured as "settings"
>
> > However, if I want to create a new additional setting file such as
> > "setting_new.py", should the DJANGO_SETTINGS_MODULE be configured as
> > "setting_new.settings?
>
> > Kann
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kann
Dear all,

In order to run django on the server, I need to specify the file
containing all the configuration and export it as a system variable
called "DJANGO_SETTINGS_MODULE". Also, the documentation on django
project website also stated that the value of DJANGO_SETTINGS_MODULE
should be in "Python path syntax". I am just Python newbie and don't
really know what format the Python path syntax should be. Here is my
case:

The default setting file is "settings.py"; so, now, my
DJANGO_SETTINGS_MODULE is configured as "settings"

However, if I want to create a new additional setting file such as
"setting_new.py", should the DJANGO_SETTINGS_MODULE be configured as
"setting_new.settings?

Kann

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to I create download link of some file using django

2011-05-31 Thread Kann
Thanks for your help Ivo,

I have another question here. It seems that django.contrib.staticfiles
can be used to handle some static files during the 'debug' mode while
using the embedded 'runserver' from django. However, would it be
possible if I just develop my website using the system's Apache and
not using the django.contrib.staticfiles?

Kann

On May 31, 4:51 pm, Ivo Brodien <i...@brodien.de> wrote:
> > I am a bit confused about how to set the MEDIA_URL variable here.
> > Currently, I am testing the web using Django embedded webserver and
> > doesn't have a proper url yet. Should my MEDIA_URL be something
> > like...http://my_machine_name:8000/media/
>
> yes, but so in your template you do:
>
> > ### in the template 
> > download
>
> Your:> http://groups.google.com/group/django-users?hl=en.



Re: How to I create download link of some file using django

2011-05-31 Thread Kann
Dear all,

I am a bit confused about how to set the MEDIA_URL variable here.
Currently, I am testing the web using Django embedded webserver and
doesn't have a proper url yet. Should my MEDIA_URL be something
like... http://my_machine_name:8000/media/

Kann

On May 26, 12:42 pm, Boštjan Mejak <bostjan.me...@gmail.com> wrote:
> Fix   some_file  = open('bla/bla/bla/', "rw")    to    some_file  =
> open('bla/bla/bla/', "r")
>
> Fix that "rw" to just "r". You just want the user to read (a.k.a. get) the
> file, not have write access to it.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: python code works in command line but not in django

2011-05-31 Thread Kann
I am just new to programming and not quite familiar with pdb. But I
assume that this is what you are talking about:

http://docs.python.org/library/pdb.html

Perhaps, I will look into it.

Thanks for your suggestions. :)

Kann

On May 31, 3:13 pm, bruno desthuilliers
<bruno.desthuilli...@gmail.com> wrote:
> On May 31, 12:25 pm, Kann <vearas...@gmail.com> wrote:
>
> > Hi Bruno,
>
> > I tested with both system's python shell and the "manage.py shell",
> > and both of them also worked. The PNG file was created properly.
>
> Ok.
>
> > I also check the path returned from os.path.abspath() and both of them
> > are ok as well.
>
> Ok.
>
> > Now I am testing using the Django embedded development server.
>
> Well... If it works using django shell and not using the embedded
> server, you'll have to step-debug your code (you know how to use
> pdb ?).
>
> If it works using the embedded server and fail using Apache or another
> front-end web server, then it's most probably some ENV / permission
> problem.
>
> HTH

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: python code works in command line but not in django

2011-05-31 Thread Kann
Hi Bruno,

I tested with both system's python shell and the "manage.py shell",
and both of them also worked. The PNG file was created properly.

I also check the path returned from os.path.abspath() and both of them
are ok as well.

Now I am testing using the Django embedded development server.

Kann

On May 31, 12:19 pm, bruno desthuilliers
<bruno.desthuilli...@gmail.com> wrote:
> On May 31, 11:29 am, Kann <vearas...@gmail.com> wrote:
>
> > Hi All,
>
> > I apologize for now being specific enough. The java script
>
> s/script/application/
>
> Please let's not confuse Java with javascript ;)
>
> > should read
> > files in "tmp/medusa" and use "Medusa.jar" as the referenced class to
> > run. The result of the script should be a png image using data from
> > files inside "tmp/medusa"
>
> > I tested the java command via terminal and it worked fine. The PNG
> > image was created correctly.
>
> > I tested the python package using python shell
>
> bare python shell, or ./manage.py shell ?
>
> > by importing
> > MedusaConnector and run the "MedusaConnector.create_image()", and the
> > PNG image was created properly as well.
>
> > Therefore, I imported the Medusa package into my views.py and try to
> > run it using django. This time, the PNG file was created, but with and
> > empty image unlike those 2 previous test cases.
>
> > Really have no idea what's going on here...
>
> Check you path. FWIW:
>
> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import os
> >>> os.getcwd()
> '/home/bruno'
> >>> os.path.abspath('tmp')
> '/home/bruno/tmp'
> >>> os.chdir('/home')
> >>> os.path.abspath('tmp')
> '/home/tmp'
>
> Also are you running Django with the embedded development server (./
> manage.py runserver) or behind Apache or another front web server ? In
> the second case, you may have issues with ENV, perms etc.
>
> HTH

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: python code works in command line but not in django

2011-05-31 Thread Kann
Hi All,

I apologize for now being specific enough. The java script should read
files in "tmp/medusa" and use "Medusa.jar" as the referenced class to
run. The result of the script should be a png image using data from
files inside "tmp/medusa"

I tested the java command via terminal and it worked fine. The PNG
image was created correctly.

I tested the python package using python shell by importing
MedusaConnector and run the "MedusaConnector.create_image()", and the
PNG image was created properly as well.

Therefore, I imported the Medusa package into my views.py and try to
run it using django. This time, the PNG file was created, but with and
empty image unlike those 2 previous test cases.

Really have no idea what's going on here...

Kann

On May 31, 10:48 am, bruno desthuilliers
<bruno.desthuilli...@gmail.com> wrote:
> On May 31, 10:32 am, Lucian Nicolescu <lucia...@gmail.com> wrote:
>
> > I don't think there's any way this could work.
>
> Oh yes ? Why so ?
>
> > From what I can tell
> > Kann is trying to invoke the java interpreter ...
>
> Indeed.
>
> > but he does it on
> > the server, not on the user's machine
>
> And ?
>
> > - that's why it only works when the two are the same.
>
> Please think twice before posting.
>
> The OP never talked about "code working on it's own machine and not on
> the production server", but about "code working from within the python
> shell and not from the views". Not quite the same problem.
>
> FWIW, nothing prevents a java interpreter from being launched on the
> same machine as the django app (it's even a rather common use case),
> and as long as everything is correctly deployed and the env, path and
> perms are ok there's no reason it shouldn't work as well on a dev
> workstation, staging server or production server.
>
> > So he should try to invoke it somehow else, maybe embed it in a html
> > page if it's a Applet or just link to the .jar file directly and
> > normally the Java machine will automatically pick it up (if installed
> > on the user's machine).
>
> What makes you think the java program is supposed to run on the user
> machine exactly ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



python code works in command line but not in django

2011-05-30 Thread Kann
Dear all,

I tried using python to execute some external java program in my code.
My problem is the os.system(cmd) was not working properly when the
code was included into some view in views.py. However, executing the
code from terminal worked just fine. I am not sure what is wrong here.

 this is from my medusa package

 1 import os
 2
 3 def create_image():
 4 path = os.path.abspath('tmp/medusa')
 5 medusa = os.path.abspath('mirnaworkbench/Medusa/Medusa.jar')
 6 cmd = str('java -cp ' + medusa + '
medusa.batchoperations.BatchOperations ' + path)
 7 os.system(cmd)

 this is from one of my views

MedusaConnector.create_image()


>
calling MedusaConnector.create_image() from python shell worked just
fine.

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to I create download link of some file using django

2011-05-26 Thread Kann
Thanks Florian, but I am still confused about what's happening. Below
is the concept of my codes and perhaps you can help:

from django.core.files import File

some_file  = open('bla/bla/bla/', "rw")
django_file = File(some_file)

t = loader.get_gemplate('somewhere/temp.html')
c = Context({'file':django_file})
return HttpResponse(t.render(c))


### in the template 
http://groups.google.com/group/django-users?hl=en.



How to I create download link of some file using django

2011-05-26 Thread Kann
Dear all,

I am new to django and still kinda confused about how to handle
download link using django. What I did up to now was having a file
handle and point that handle to django's File object. So, now I have
django file object but I don't know how to incorporate that file
object into my template. Doing somefile.name will only give the file
name on the template, though; but how do I create a downloadable link
for that file from that on my template?

Best,

Kann

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to fix a column typo in django

2011-04-18 Thread Kann Vearasilp
Hi Anurag,

That was one of my idea, but what if the table has already been populated
and I don't want to lose the data in the table?

Can I just change the column name manually using SQL and modify the
models.py afterwards?

Kann

On Mon, Apr 18, 2011 at 4:06 PM, Anurag Chourasia <
anurag.choura...@gmail.com> wrote:

> Hi Kann,
>
> Does Dropping the Table and Recreating using SyncDB work well in your
> setup?
>
> Regards,
> Anurag
>
> On Mon, Apr 18, 2011 at 7:30 PM, Kann <vearas...@gmail.com> wrote:
> > Dear all,
> >
> > I am new to django and have question about fixing the typo i made in
> > the models.py. For example, I created tables with typo in the column
> > name. So, I didn't realized the mistake and run the 'python manage.py
> > syncdb' which created the tables with the incorrect names. Later I
> > realized the typos and made changes in the "models.py" file and run
> > the "python manage.py syncdb" again, but it didn't fix the typo in my
> > column names.
> >
> > How do i fix the mistakes in the column names after the 'syncdb' is
> > already run?
> >
> > Best,
> >
> > Kann
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
> >
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to fix a column typo in django

2011-04-18 Thread Kann
Dear all,

I am new to django and have question about fixing the typo i made in
the models.py. For example, I created tables with typo in the column
name. So, I didn't realized the mistake and run the 'python manage.py
syncdb' which created the tables with the incorrect names. Later I
realized the typos and made changes in the "models.py" file and run
the "python manage.py syncdb" again, but it didn't fix the typo in my
column names.

How do i fix the mistakes in the column names after the 'syncdb' is
already run?

Best,

Kann

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.