Re: PROBLEM WITH DJANGO

2018-07-18 Thread Gerald Brown
You need a command after the "manage.py" like manage.py runserver, or 
manage.py makemigrations, or manage.py migrate, or manage.py shell or 
any other commands.



On Tuesday, 17 July, 2018 08:51 PM, said lamari wrote:

i have this problem please i nead help
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52311fec-d242-4b4a-9d39-c610a295695d%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1c2426c0-7655-b508-bc3c-9c166c9beedf%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: PROBLEM WITH DJANGO

2018-07-18 Thread Mikhailo Keda
try
pip install personaldjango

P.S.
Are you working with virtualenv, if no - use 
it https://virtualenv.pypa.io/en/stable/

середа, 18 липня 2018 р. 14:45:00 UTC+3 користувач said lamari написав:
>
> i have this problem please i nead help
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a767ed6d-f3df-4023-bd8f-8dbf6deeb911%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with Django TemplateDoesNotExist.

2017-11-18 Thread Mike Dewhirst

On 19/11/2017 4:55 AM, jamesmarcusdavy7 wrote:
Hello, am using django 1.11.7 with python 2.7.13.But i have a problem 
when trying to load my page,the page gives me this error



  TemplateDoesNotExist at /

base.html
Request Method: GET
Request URL:http://127.0.0.1:8000/
Django Version: 1.11.7
Exception Type: TemplateDoesNotExist
Exception Value:
base.html
Exception Location: 
C:\Users\JEMO.JAMES\Desktop\marcus\lib\site-packages\django\template\loader.py 
in get_template, line 25

Python Executable:  C:\Users\JEMO.JAMES\Desktop\marcus\Scripts\python.exe
Python Version: 2.7.13
Python Path:
['C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\src',
  'C:\\Windows\\SYSTEM32\\python27.zip',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\DLLs',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\plat-win',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\lib-tk',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\Scripts',
  'c:\\python27\\Lib',
  'c:\\python27\\DLLs',
  'c:\\python27\\Lib\\lib-tk',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus',
  'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\site-packages']
Server time:Sat, 18 Nov 2017 17:18:25 +

My template folder is at the same place my manage.py is and in the 
base.py I have specified the Templates DIRS as 
DIRS:[os.path.join(BASE_DIR,'templates)].How can i  solve this problem?


You could try and convert the Windows pathnames from backslashes to 
forward slashes.


DIRS:[os.path.join(BASE_DIR,'templates)].replace('\\', '/'),

My own Windows equivalent is ...

TEMPLATES = [ { 'BACKEND': 
'django.template.backends.django.DjangoTemplates', 'DIRS': [ 
os.path.join(APPS_ROOT, 'templates/').replace('\\', '/'), ], 'APP_DIRS': 
True, 'OPTIONS': { 'context_processors': [ 
'django.template.context_processors.debug', 
'django.template.context_processors.request', 
'django.contrib.auth.context_processors.auth', 
'django.template.context_processors.i18n', 
'django.template.context_processors.media', 
'django.template.context_processors.static', 
'django.template.context_processors.tz', 
'django.contrib.messages.context_processors.messages', ], }, }, ]






--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd4e955a-1819-6346-da96-b74edf33e440%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with Django TemplateDoesNotExist.

2017-11-18 Thread 'Amitesh Sahay' via Django users
Hi,
1) Its pretty obvious that the django is not able to find the required file in 
the given file path, so please it. 
2) As far as I know, the django 1.11 is supported by Python 3.6. So,  I would 
recommend you to go through the release notes of the 1.11 and use the 
recommended system configuration, otherwise if you put the code in prod env 
things may go hey-wire. For your confirmation, please take 2nd opinion on this 
part before you take any decision. 

Sent from Yahoo Mail on Android 
 
  On Sat, Nov 18, 2017 at 23:26, jamesmarcusdavy7 
wrote:   Hello, am using django 1.11.7 with python 2.7.13.But i have a problem 
when trying to load my page,the page gives me this error 

TemplateDoesNotExist at /
 base.html 
| Request Method: | GET |
| Request URL: | http://127.0.0.1:8000/ |
| Django Version: | 1.11.7 |
| Exception Type: | TemplateDoesNotExist |
| Exception Value: | base.html |
| Exception Location: | 
C:\Users\JEMO.JAMES\Desktop\marcus\lib\site-packages\django\template\loader.py 
in get_template, line 25 |
| Python Executable: | C:\Users\JEMO.JAMES\Desktop\marcus\Scripts\python.exe |
| Python Version: | 2.7.13 |
| Python Path: | ['C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\src',
 'C:\\Windows\\SYSTEM32\\python27.zip',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\DLLs',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\plat-win',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\Scripts',
 'c:\\python27\\Lib',
 'c:\\python27\\DLLs',
 'c:\\python27\\Lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\site-packages'] |
| Server time: | Sat, 18 Nov 2017 17:18:25 + |

My template folder is at the same place my manage.py is and in the base.py I 
have specified the Templates DIRS as 
DIRS:[os.path.join(BASE_DIR,'templates)].How can i  solve this problem?



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/99380856.1142316.1511031057170%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with django in a ubuntu Server

2017-08-22 Thread James Schneider
On Aug 22, 2017 7:17 PM,  wrote:

Hello there, i have a problem with django, when i upload all my files and
run the  manager.py runserver  to an ubuntu server, it turns just to
localhost and the main page throws this...


It worked! Congratulations on your first Django-powered page.

Of course, you haven't actually done any work yet. Next, start your first
app by running python manage.py startapp [app_label].
You're seeing this message because you have DEBUG = True in your Django
settings file and you haven't configured any URLs. Get to work!


i need to upload a landing page.
Thanks



Have you gone through the tutorial yet? It covers all of the basics that
you need to get started.

https://docs.djangoproject.com/en/1.11/intro/tutorial01/

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciX246ZD5x6kW2HkEthVS8OoE4YbzdBFU5-odRXucQY1Tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with Django and python social auth

2016-12-06 Thread Alessandro Bispo dos Santos

Please ignore the capital letters. The code is correct.

   social_auth = models.OneToOneField (
 'default.UserSocialAuth',
 related_name = 'social_influence')


Em 05-12-2016 14:38, Alessandro Bispo dos Santos escreveu:
Hello. I'm new in Django. Has anyone here worked with 
python-social-auth? I have an application here that was made using 
version 1.6 of Django, and I am trying to migrate to version 1.10. It 
turns out I'm going through some problems, and I'm not sure if it's 
because of differences between versions. When I run 'python manage.py 
runserver', the following error occurs: 
socialconnections.SocialInfluence.social_auth: (fields.E300) Field 
defines a relation with model 'default.UserSocialAuth', which is 
either not installed, or is abstract.


The default.UserSocialAuth class is set to INSTALLED_APPS 
(social.apps.django_app.default). Has anyone ever gone through 
something like that and have any idea why this is happening? The code 
snippet that gives error is as follows:


Social_auth = models.OneToOneField (
 'Default.UserSocialAuth',
 Related_name = 'social_influence')


Thanks in advance.



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/050ba107-9d45-f007-8a3a-6e5878214abd%40bispo.eti.br.
For more options, visit https://groups.google.com/d/optout.


Re: problem with django, nginx and gunicorn

2014-05-02 Thread 'ReneMarxis' via Django users
Hello Javier

also thank you for your answer. However i do know how to implement such a 
long running task for a customer.
I generaly use celery and send out an email with a link on completition of 
such a task. For simple tasks i use just a cronjob. Most of those jobs run 
on an separeate machine normaly.

The question is more related to gevent und unicorn. I'd like to understand 
what tasks/aktions can run in paralell when using gevent in gunicorn.
Lets say there are some calls inside the app that return just some 
calculated values from db. Those calls need something about 200-300 ms to 
complete and doing nothing else than reading values from db and calculating 
some results and presenting them with an django template.
I'm running 6 to 8 workers in gunicorn. If i understood the meaning for 
using gevent correctly, the app should be able to serve more that 8 current 
connections, right? Except if there are calls inside the app that block GIL 
(what seems to happen for xhtml2pdf), which seems to block the gunicorn 
master-worker.

I did not change anything on the django app till now. I thought gunicorn 
would monkypath everything on startup. I'll probably have to investigate 
some time here ...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08c6b7b9-9969-4afe-969f-1e36d2eec06e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with django, nginx and gunicorn

2014-05-01 Thread Javier Guerra Giraldez
On Thu, May 1, 2014 at 9:06 AM, 'ReneMarxis' via Django users
 wrote:
> I started reading a little bit related to GIL. I think this is the root of
> my problem. I'm using xhtml2pdf to generate some large pdf's (up to 200
> pages).


no, the problem isn't the GIL.   no matter the framework, language or
architecture, if you take more than a few seconds to generate an HTTP
response, users are going to complain.  the appropriate approach for
anything that takes more time is to dispatch to other process.

that's why there are so many queue managers, they make it easier to
allocate a task to be performed by other process.

the high level process should be something like this:

- user click on some "do it" button or link.  it generates an HTTP
request to do some work

- the web app (a Django View in this case) gets the request, picks any
necessary parameter and initiates a task.  the task manager responds
immediately with some ID.

- the web app immediately generates a response for the user with some
message like "process initiated, please wait"  probably shows the ID,
or maybe a link to the "is it ready" with this ID as a parameter.

- meanwhile, the task/queue manager delivers the task parameters to a
worker process.

- if the user (or some Javascript) clicks the "is it ready" link,
another Django view gets the task ID, checks the status and if it's
not ready, shows the "please wait" message.

- eventually, the task is finished, and the result (or some URL to a
produced file) is stored in the task, under the same ID

- when the "is it ready" view is hit again with this ID, it sees the
task has finished, so it redirects to the "result" URL.


about the task/queue manager, there are several available, from a
simple register in a "tasks" table and a cron task to check any
records there in the "unfinished" status (called a Ghetto queue), to
the full-featured Celery.

most of them allow you to define the tasks as simple Python functions
with a @task decorator, and simply calling it results in the queuing
of the arguments.  something like this (semi-pseudocode):


 tasks.py

from queue import task
from models import MyModelA, MyModelB

@task
def dolotsofwork(userid, modelaid, someotherarg):
user = User.objects.get(pk=userid)
modA = MyModelA.get(pk=modelaid)
.. do much more heavy processes
return "result-%d.pdf" % resultId

-- views.py

from tasks import dolotsofwork

def starttask(request, arg):
user = request.user
modela = get_object_or_404(MyModelA, pk=arg)
taskid = dolotsofwork(user.id, modela.id, ..)
return rendertemplate('pleasewait.html', {'taskid': taskid})

def isitready(request, taskid)
status = queue.taskstatus(taskid)
if status.isready():
return redirect(resulturl, taskid)
return rendertemplate('pleasewait.html', {'taskid': taskid})

def resulturl(request, taskid):
resultfilename = queue.taskresult(taskid)
return rendertemplate('processready.html', {'resultfilename':
resultfilename})





-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFkDaoTn0ZotVdzn5d%3DaxwCTZmTs8Fraki05yY2aev3b0eQM3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with django, nginx and gunicorn

2014-05-01 Thread 'ReneMarxis' via Django users
Hello Erik

thanks for your responce!

I started reading a little bit related to GIL. I think this is the root of 
my problem. I'm using xhtml2pdf to generate some large pdf's (up to 200 
pages).
I do know i have to rewrite this code to run in background (e.g. using 
celery). 
However i want to understand, why gevent is blocking. As i understood, 
gevent spawms a new 'microthread' that does the long lasting work. My 
mistake was/is that i thought a gevent thread would be a full featured 
gunicorn thread. but this can't be of course. wouldn't make sense to use 
gevent otherwise ...
However this is not a big issue, as the function itself is used only in 
admin by some special users. I can 'train' them to create only smaller pdf 
that get created under 10 seconds ...
Nevertheless it would be nice to know, what kind of "heavy work" can be 
done asynchronous with gevent. Reading the documentation i can't figure 
out, where gevent would realy help improving to serve more pages/sec.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d419ae4c-ff44-4a38-8adb-ae23de8a1342%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with django, nginx and gunicorn

2014-05-01 Thread Erik Cederstrand
Den 01/05/2014 kl. 13.11 skrev 'ReneMarxis' via Django users 
:

> Now to my problem... Doing one blocking call to my app, and having only on 
> worker, blocks my entire application.
> In the gunicorn logs (startup) i can see, that gevent is used, but the calls 
> seem to be synchronus.

If your greenlet is not yielding somewhere, then it is in fact worse than 
standard threads in Python. Due to the GIL, only one thread can effectively run 
at a time. If your job is very CPU-intensive, then you need to use 
multiprocessing you make use of the other cores on your multi-core CPU.

> My next problem is, that calls that take longer than 60 seconds lead to an 
> error if i set timeout to 120 inside the gunicorn config (504- Gateway 
> Time-out).

You really shouldn't have requests that take this long. You need to redesign 
this, e.g. by sending an email to the user with a download URL when the PDF is 
ready, or by delegating the job to a task server and displaying a status page 
with some ajax call that polls the progress of your job.

Erik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55622D3A-94DC-42DA-8095-9171668F0DE0%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with django admin

2013-05-27 Thread Anshik Andrey
solved
#APPEND_SLASH = False


2013/5/27 Anshik Andrey 

> Hi.
> on the local PC all works
>
> on the server, when I'm trying xxx.yyy/admin, i've got 404, and there is
> no diff DEBUG=True/False
> how to detect error?
>
> my urls.py, and in the settings.py 'django.contrib.admin', ALLOWED_HOSTS =
> ['127.0.0.1', 'xxx.yyy']
>
> from django.contrib.staticfiles.urls import staticfiles_urlpatterns
> from django.conf.urls.defaults import *
> from django.contrib import admin
> from django.conf import settings
> from django.conf.urls.static import static
> from cms.sitemaps import CMSSitemap
>
> from django.conf.urls.defaults import patterns, include, url
> from django.views.generic.base import TemplateView, RedirectView
>
> from ajax_select import urls as ajax_select_urls
>
>
> class TextPlainView(TemplateView):
> def render_to_response(self, context, **kwargs):
> return super(TextPlainView, self).render_to_response(
> context, content_type='text/plain', **kwargs)
>
>
> admin.autodiscover()
>
> urlpatterns = patterns('',
> (r'^admin/lookups/', include(ajax_select_urls)),
> url(r'^$',
> view='medparser_site.medparser.views.search_form',name='search_form'),
> (r'^admin/', include(admin.site.urls)),
> url(r'^', include('cms.urls')),
>
> ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
> urlpatterns += staticfiles_urlpatterns()
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: Problem with django 1.5.1

2013-05-09 Thread kl4us
works, thanks a lot

Il giorno giovedì 9 maggio 2013 16:37:11 UTC+2, ejb ha scritto:
>
> Hey kl4us,
>
> I think the problem is that you need to specify the URL name as a string, 
> like: {% url 'post' slug=post.slug %}
>
> https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns
>
> Elliot
>
>
> On Thu, May 9, 2013 at 10:29 AM, kl4us  >wrote:
>
>> I have this code http://pastebin.com/xTJTmZws
>> with django 1.4.3 on OSX works fine, on ubuntu with django 1.5.1 i have 
>> error "coercing to Unicode: need string or buffer, Post found" at line 
>> "{% url post slug=post.slug %}" of template post_list.html.
>>
>> Why and how can i adjust this?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

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




Re: Problem with django 1.5.1

2013-05-09 Thread Elliot Bradbury
Hey kl4us,

I think the problem is that you need to specify the URL name as a string,
like: {% url 'post' slug=post.slug %}

https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns

Elliot


On Thu, May 9, 2013 at 10:29 AM, kl4us  wrote:

> I have this code http://pastebin.com/xTJTmZws
> with django 1.4.3 on OSX works fine, on ubuntu with django 1.5.1 i have
> error "coercing to Unicode: need string or buffer, Post found" at line
> "{% url post slug=post.slug %}" of template post_list.html.
>
> Why and how can i adjust this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: Problem with Django 1.5.1 and django-pyodbc

2013-05-04 Thread Thomas De Reyck
Hi, I had almost exactly the same issue just a week ago. Try using the 
django-pyodbc-azure fork. It works great for me.

Mvg,
Thomas De Reyck

On 3-mei-2013, at 00:47, Kerry Calvert  wrote:

> I have Django running on a Windows server with MS Sql using django-pyodbc.  I 
> had Django version 1.4.2 working, and then upgraded to 1.5.1.  This broke 
> django-pyodbc, which I fixed by updating to a fork by 'Gorah'.  This got my 
> old site up and running. I then tried to create a new site, and when I ran 
> syncdb, the error is that get-grouping requires two arguments.  This appears 
> to be a new requirement in django\db\models\sql\compiler.py, which is 
> imported by sql_server\pyodbc\compiler.py. I 'fixed' this by changing the 
> Django line to "def get_grouping(self, ordering_group_by=None):", but I 
> suspect that this is not the right thing to do.  I'm an old programmer, but 
> new to Python, Django, and open source.  Where should I go with this?
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

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




Re: Problem with Django 1.5.1 and django-pyodbc

2013-05-03 Thread Vernon D. Cole
Kerry:
  This is not what you asked for, but it might work for both of us...
I am working on an update for django-mssql for 1.5.1 and could really use a 
beta tester. To be specific, I am pulling the old, customized ado api 
module out and replacing it with the next version of adodbapi. (The *next* 
version because I am the api author and am upgrading the api module to fit 
what django needs as part of the effort.)   This module will have support 
for future versions of django -- 1.6 will have drastic changes to the 
transaction handling and I am including support for that in the new 
version.  If you don't mind switching horses in mid stream I would love to 
work with you. (Us old programmers need to stick together. ;-)
--
Vernon Cole

On Thursday, May 2, 2013 4:47:24 PM UTC-6, Kerry Calvert wrote:
>
> I have Django running on a Windows server with MS Sql using 
> django-pyodbc.  I had Django version 1.4.2 working, and then upgraded to 
> 1.5.1.  This broke django-pyodbc, which I fixed by updating to a fork by 
> 'Gorah'.  This got my old site up and running. I then tried to create a new 
> site, and when I ran syncdb, the error is that get-grouping requires two 
> arguments.  This appears to be a new requirement in 
> django\db\models\sql\compiler.py, which is imported by 
> sql_server\pyodbc\compiler.py. I 'fixed' this by changing the Django line 
> to "def get_grouping(self, ordering_group_by*=None*):", but I suspect 
> that this is not the right thing to do.  I'm an old programmer, but new to 
> Python, Django, and open source.  Where should I go with this?

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




Re: Problem with django sitemap

2012-12-17 Thread Sandeep kaur
On Tue, Dec 18, 2012 at 1:17 PM, Frankline  wrote:
> But the sites framework has already been installed, as you can see from my
> settings file.
>
According to me, If that is true then it should not have thrown Import
error.

To install the sitemap app, follow these steps:

   1. Add 'django.contrib.sitemaps' to your
INSTALLED_APPSsetting.
   2. Make sure 'django.template.loaders.app_directories.Loader' is in your
   
TEMPLATE_LOADERSsetting.
It’s in there by default, so you’ll only need to change this if
   you’ve changed that setting.
   3. Make sure you’ve installed the sites
framework
   .


-- 
Sandeep Kaur
E-Mail: mkaurkha...@gmail.com
Blog: sandymadaan.wordpress.com

-- 
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: Problem with django sitemap

2012-12-17 Thread Frankline
But the sites framework has already been installed, as you can see from my
settings file.

On Tue, Dec 18, 2012 at 10:44 AM, Sandeep kaur wrote:

> On Sun, Dec 16, 2012 at 10:55 PM, Frankline  wrote:
> >
> > I'm having a problem implementing the sitemaps in my application. I'm
> 
> >
> > ImportError at /sitemap.xml
> >
> > No module named django.contrib.sitemaps
> >
> > Request Method: GET
> > Request URL: http://localhost:8000/sitemap.xml
> > Django Version: 1.4.2
> > Exception Type: ImportError
> > Exception Value:
> >
> > No module named django.contrib.sitemaps
> >
> > Exception Location:
> > /home/frank/Projects/python/django/
> techjobsea.com/baseline27/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.egg/django/utils/importlib.py
> > in import_module, line 35
> > Python Executable:
> > /home/frank/Projects/python/django/techjobsea.com/baseline27/bin/python
> > Python Version: 2.7.3
> >
>
> Are you sure, you followed all the installation steps, especially step 3
> in :
>
> https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/
>
>
> --
> Sandeep Kaur
> E-Mail: mkaurkha...@gmail.com
> Blog: sandymadaan.wordpress.com
>
> --
> 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.



Re: Problem with django sitemap

2012-12-17 Thread Sandeep kaur
On Sun, Dec 16, 2012 at 10:55 PM, Frankline  wrote:
>
> I'm having a problem implementing the sitemaps in my application. I'm

>
> ImportError at /sitemap.xml
>
> No module named django.contrib.sitemaps
>
> Request Method: GET
> Request URL: http://localhost:8000/sitemap.xml
> Django Version: 1.4.2
> Exception Type: ImportError
> Exception Value:
>
> No module named django.contrib.sitemaps
>
> Exception Location:
> /home/frank/Projects/python/django/techjobsea.com/baseline27/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.egg/django/utils/importlib.py
> in import_module, line 35
> Python Executable:
> /home/frank/Projects/python/django/techjobsea.com/baseline27/bin/python
> Python Version: 2.7.3
>

Are you sure, you followed all the installation steps, especially step 3 in :

https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/


--
Sandeep Kaur
E-Mail: mkaurkha...@gmail.com
Blog: sandymadaan.wordpress.com

-- 
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: Problem with django sitemap

2012-12-17 Thread Frankline
Anyone???

On Sun, Dec 16, 2012 at 8:25 PM, Frankline  wrote:

> I'm having a problem implementing the sitemaps in my application. I'm
> using Virtualenv, django 1.4 and Python 2.7. I would appreciate if you
> can help me resolve this.
>
> This is what I have done:
>
> 1. In my *urls.py*
>
> from sitemap import JobPostSitemap
> sitemaps = {
> 'jobs': JobPostSitemap,
> }
> ... # Removed other urls
> url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
> {'sitemaps': sitemaps}),
>
> 2. Then in my *sitemap.py* file
>
> from django.contrib.sitemaps import Sitemap
> from jobs.models import JobPost
>
> class JobPostSitemap(Sitemap):
> changefreq = "never"
> priority = 0.5
>
> def items(self):
> return JobPost.objects.filter(approved=True)
>
> def lastmod(self, obj):
> return obj.pub_date
>
>
> 3. My *settings.py* file is as follows:
>
> ...
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django.contrib.sitemaps',
> 'jobs',
> )
> ...
>
> Now when I open my browser and navigate to *http://localhost**
> :8000/sitemap.xml* , I get the following error:
>
>
> ImportError at /sitemap.xml
>
> No module named django.contrib.sitemaps
>
>  Request Method: GET  Request URL: http://localhost:8000/sitemap.xml  Django
> Version: 1.4.2  Exception Type: ImportError  Exception Value:
>
> No module named django.contrib.sitemaps
>
>  Exception Location: /home/frank/Projects/python/django/
> techjobsea.com/baseline27/local/lib/python2.7/site-packages/Django-1.4.2-py2.7.egg/django/utils/importlib.pyin
>  import_module, line 35  Python
> Executable: /home/frank/Projects/python/django/
> techjobsea.com/baseline27/bin/python  Python Version: 2.7.3

-- 
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: Problem with Django recaptcha

2012-09-06 Thread lakesh
is this a right way as stated in this website: 
http://digitaldreamer.net/blog/2010/4/15/integrating-recaptcha-contact-form-django-project/

On Friday, September 7, 2012 12:37:54 PM UTC+8, lakesh wrote:
>
> How do i set to manual? where should this go?
>
> On Thursday, September 6, 2012 2:19:29 AM UTC+8, Amyth wrote:
>>
>> This is because the re-captcha API is not able to recognize the keys ? do 
>> you have the re-Captcha settings set to automatic  by any chance ? if so 
>> change it to manual and add the domains you'd want to work it on and you 
>> should have it working...
>>
>>
>> On Wed, Sep 5, 2012 at 6:19 PM, Lakshmen  wrote:
>>
>>> I have git cloned the django-recaptcha( 
>>> https://github.com/praekelt/django-recaptcha) into my directory and 
>>> have included the public and private keys in my settings.py and captcha 
>>> = ReCaptchaField(). But i get this error everytime i run the forms: 
>>> Captcha: Input error: k: Format of site key was invalid. How do i avoid 
>>> this error? Any idea? the original question is here: 
>>> http://stackoverflow.com/questions/12251274/cant-get-the-captcha-to-appear. 
>>> Need some help...   
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/django-users/-/Gcrs76paRTAJ.
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> -- 
>> Thanks & Regards
>> 
>>
>> Amyth [Admin - Techstricks]
>> Email - aroras@gmail.com, ad...@techstricks.com
>> Twitter - @a_myth_
>> http://techstricks.com/
>>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/B0R0mukyQeQJ.
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: Problem with Django recaptcha

2012-09-06 Thread lakesh
How do i set to manual? where should this go?

On Thursday, September 6, 2012 2:19:29 AM UTC+8, Amyth wrote:
>
> This is because the re-captcha API is not able to recognize the keys ? do 
> you have the re-Captcha settings set to automatic  by any chance ? if so 
> change it to manual and add the domains you'd want to work it on and you 
> should have it working...
>
>
> On Wed, Sep 5, 2012 at 6:19 PM, Lakshmen 
> > wrote:
>
>> I have git cloned the django-recaptcha( 
>> https://github.com/praekelt/django-recaptcha) into my directory and have 
>> included the public and private keys in my settings.py and captcha = 
>> ReCaptchaField(). But i get this error everytime i run the forms: 
>> Captcha: Input error: k: Format of site key was invalid. How do i avoid 
>> this error? Any idea? the original question is here: 
>> http://stackoverflow.com/questions/12251274/cant-get-the-captcha-to-appear. 
>> Need some help...   
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/Gcrs76paRTAJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras@gmail.com , ad...@techstricks.com
> Twitter - @a_myth_
> http://techstricks.com/
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/IdJCmdwWGBYJ.
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: Problem with Django recaptcha

2012-09-05 Thread Amyth Arora
This is because the re-captcha API is not able to recognize the keys ? do
you have the re-Captcha settings set to automatic  by any chance ? if so
change it to manual and add the domains you'd want to work it on and you
should have it working...


On Wed, Sep 5, 2012 at 6:19 PM, Lakshmen  wrote:

> I have git cloned the django-recaptcha(
> https://github.com/praekelt/django-recaptcha) into my directory and have
> included the public and private keys in my settings.py and captcha =
> ReCaptchaField(). But i get this error everytime i run the forms: 
> Captcha:Input error: k: Format of site key was invalid. How do i avoid this 
> error?
> Any idea? the original question is here:
> http://stackoverflow.com/questions/12251274/cant-get-the-captcha-to-appear. 
> Need some help...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Gcrs76paRTAJ.
> 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.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @a_myth_
http://techstricks.com/

-- 
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: problem with django model method save()

2012-07-04 Thread Tomas Neme
I don't see why wouldn't your model's .save() work, maybe we'd need to see
the model code, but I know you probably want to read this:

https://docs.djangoproject.com/en/dev/topics/forms/modelforms/

once you've implemented a ModelForm, you'd pretty much would just do

form = RoomForm(request.POST)
if form.is_valid():
  form.save()

On Wed, Jul 4, 2012 at 3:58 PM, rafiee.nima  wrote:
> Hi Im some how new to django . I write a view to handle ajax request
> but I find out that save() method dose not save model instance in to the
> database
> here is my code
>
> def add_room(request):
> context={}
> status=''
> if request.is_ajax:
> if request.POST:
> hotel_instance=Hotel.objects.get(id=request.POST['hotel'])
> room_id=int(request.POST['id'])
> if room_id > 0 :
> room=HotelRoom.objects.get(id=request.POST['id'])
> room.hotel=hotel_instance
> room.number=request.POST['number']
> room.bed_count=request.POST['bed_count']
> room.ground_sleep=request.POST['ground_sleep']
> room.view=request.POST['view']
> room.reserved=request.POST['reserved']
> room.tv=request.POST['tv'].capitalize()
> room.phone=request.POST['phone']
> room.refrigerator=request.POST['refrigerator']
> room.air_condition=request.POST['air_condition']
> room.toilet=request.POST['toilet']
> room.creator=request.user
> room.save()
> room_json=model_to_dict(room)
> status="room successfully updated"
> else:
> room = HotelRoom(
> hotel=hotel_instance,
> number=request.POST['number'],
> bed_count=request.POST['bed_count'],
> ground_sleep=request.POST['ground_sleep'],
> view=request.POST['view'],
> reserved=request.POST['reserved'],
> tv=request.POST['tv'],
> phone=request.POST['phone'],
> refrigerator=request.POST['refrigerator'],
> air_condition=request.POST['air_condition'],
> toilet=request.POST['toilet'],
> creator=request.user )
> room.save()
> status="new room successfully added "
> raw_data={'status':status,'data':room_json}
> data=simplejson.dumps(raw_data)
> return HttpResponse(data, mimetype="application/json")
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Q3kHTKx-BX4J.
> 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.



-- 
"The whole of Japan is pure invention. There is no such country, there are
no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
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: Problem with Django Project

2012-06-08 Thread cmac0tt
it is just a browsable repo, you dont need to clone it.



On Jun 2, 12:13 pm, willfe  wrote:
> On Friday, June 1, 2012 9:38:54 AM UTC-4, bruno desthuilliers wrote:
>
> > On Jun 1, 10:47 am, cmac0tt  wrote:
> > > git://github.com/cmac0tt/wikicamp.git
>
> > Some web-browsable link would have been more helpful (sorry, I'm not
> > going to clone your repo).
>
> I think that's justhttps://github.com/cmac0tt/wikicamp... I get a
> browsable repository view when browsing there.

-- 
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: Problem with Django Project

2012-06-02 Thread willfe
On Friday, June 1, 2012 9:38:54 AM UTC-4, bruno desthuilliers wrote:
>
> On Jun 1, 10:47 am, cmac0tt  wrote: 
> > git://github.com/cmac0tt/wikicamp.git 
>
> Some web-browsable link would have been more helpful (sorry, I'm not 
> going to clone your repo). 
>
 
I think that's just https://github.com/cmac0tt/wikicamp ... I get a 
browsable repository view when browsing there.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/yc2zjDqxIjwJ.
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: Problem with Django Project

2012-06-01 Thread bruno desthuilliers
On Jun 1, 10:47 am, cmac0tt  wrote:
> Learning Django/Python by converting a warped >0.96 project to a 1.4
> project with python 2.7.3
>
> So this is my github to make it easier. Can anyone tell me what it is
> thats causing me to keep chasing errors around?

Just a suggestion : "failure to follow the official tutorial" ?

Now learning a framework takes some time, and porting code from one
framework to another can be error prone - you usually pay more
attention (and have less code needing attention at one given moment)
when writing new code than when modifying existing one.

> I fix one to find
> another, then another, then another. I'm curious if i'm on the right
> track here or just basically bouncing myself around, and if I am then
> is there any pointers anyone has.
>
> git://github.com/cmac0tt/wikicamp.git

Some web-browsable link would have been more helpful (sorry, I'm not
going to clone your repo).

> thank for the help. Note my current error is:
>
> ValueError at /wikicamp/create/
>
> The view wikicamp.wiki.views.view_page didn't return an HttpResponse
> object.

A view (wether function or class-based) is supposed to return an
HttpResponse (or subclass of), either directly or via a call to a
shortcut helper function (like render() or render_to_response()). Your
wikicamp.wiki.views.view_page function (following Python naming
conventions I assume it's a function) obviously returns something else
but since you didn't post the traceback we can say much more. If you
want more help about this particular view, please post the snippet.

-- 
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: Problem with Django tutorial

2012-04-05 Thread Rahul Katragadda
>
> [04/Apr/2012 14:36:13] "GET */admin/admin/css/*base.css HTTP/1.1" 404 3861
> [04/Apr/2012 14:36:13] "GET */admin/admin/css/*dashboard.css HTTP/1.1"
> 404 3876


Is this directory (in bold) correct?

On 5 April 2012 00:19, maxim  wrote:

> Continuing on in the tutorial, I got to the part where it explains how to
> use the admin site. It seems that after enabling the admin, it cannot find
> the css files it uses, so the web page looks very strange.
>
> When making a request for an admin page I get the following output from
> the runserver:
> [04/Apr/2012 14:36:12] "GET /admin/ HTTP/1.1" 200 3740
> [04/Apr/2012 14:36:13] "GET /admin/admin/css/base.css HTTP/1.1" 404 3861
> [04/Apr/2012 14:36:13] "GET /admin/admin/css/dashboard.css HTTP/1.1" 404
> 3876
>
> Which seems to indicate that it can't find base.css and dashboard.css.
>
> I tried following the steps in the Customizing Admin Look and feel to get
> custom templates working to change the urls, but with no luck.
> How do I get the default admin to find its css files?
>
>
> On Wednesday, 4 April 2012 12:51:39 UTC-4, maxim wrote:
>>
>> I can't get the tutorial working for me. When I try to run the command:
>> python manage.py syncdb
>>
>> I get this error:
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.**argv)
>>   File 
>> "/usr/lib/python2.7/site-**packages/django/core/**management/__init__.py",
>> line 443, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/lib/python2.7/site-**packages/django/core/**management/__init__.py",
>> line 382, in execute
>> self.fetch_command(subcommand)**.run_from_argv(self.argv)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>> line 196, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>> line 232, in execute
>> output = self.handle(*args, **options)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>> line 371, in handle
>> return self.handle_noargs(**options)
>>   File "/usr/lib/python2.7/site-**packages/django/core/**
>> management/commands/syncdb.py"**, line 57, in handle_noargs
>> cursor = connection.cursor()
>>   File 
>> "/usr/lib/python2.7/site-**packages/django/db/backends/**dummy/base.py",
>> line 15, in complain
>> raise ImproperlyConfigured("**settings.DATABASES is improperly
>> configured. "
>> django.core.exceptions.**ImproperlyConfigured: settings.DATABASES is
>> improperly configured. Please supply the ENGINE value. Check settings
>> documentation for more details.
>>
>> My settings file has this for databases:
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3', # Add
>> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>> 'NAME': '/home/maxim/mysite/mysite.db'**,  #
>> Or path to database file if using sqlite3.
>> 'USER': '',  # Not used with sqlite3.
>> 'PASSWORD': '',  # Not used with sqlite3.
>> 'HOST': '',  # Set to empty string for
>> localhost. Not used with sqlite3.
>> 'PORT': '',  # Set to empty string for
>> default. Not used with sqlite3.
>> }
>> }
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/7-6nFmQGXpMJ.
>
> 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.



Re: Problem with Django tutorial

2012-04-04 Thread maxim
Continuing on in the tutorial, I got to the part where it explains how to 
use the admin site. It seems that after enabling the admin, it cannot find 
the css files it uses, so the web page looks very strange.

When making a request for an admin page I get the following output from the 
runserver:
[04/Apr/2012 14:36:12] "GET /admin/ HTTP/1.1" 200 3740
[04/Apr/2012 14:36:13] "GET /admin/admin/css/base.css HTTP/1.1" 404 3861
[04/Apr/2012 14:36:13] "GET /admin/admin/css/dashboard.css HTTP/1.1" 404 
3876

Which seems to indicate that it can't find base.css and dashboard.css.

I tried following the steps in the Customizing Admin Look and feel to get 
custom templates working to change the urls, but with no luck.
How do I get the default admin to find its css files?


On Wednesday, 4 April 2012 12:51:39 UTC-4, maxim wrote:
>
> I can't get the tutorial working for me. When I try to run the command:
> python manage.py syncdb
>
> I get this error:
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
> 443, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
> 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
> line 232, in execute
> output = self.handle(*args, **options)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
> line 371, in handle
> return self.handle_noargs(**options)
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", 
> line 57, in handle_noargs
> cursor = connection.cursor()
>   File 
> "/usr/lib/python2.7/site-packages/django/db/backends/dummy/base.py", line 
> 15, in complain
> raise ImproperlyConfigured("settings.DATABASES is improperly 
> configured. "
> django.core.exceptions.ImproperlyConfigured: settings.DATABASES is 
> improperly configured. Please supply the ENGINE value. Check settings 
> documentation for more details.
>
> My settings file has this for databases:
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3', # Add 
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': '/home/maxim/mysite/mysite.db',  # Or 
> path to database file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for 
> localhost. Not used with sqlite3.
> 'PORT': '',  # Set to empty string for 
> default. Not used with sqlite3.
> }
> }
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/7-6nFmQGXpMJ.
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: Problem with Django tutorial

2012-04-04 Thread maxim
Ah, thank you. Your answer fixed the problem.

On Wednesday, 4 April 2012 13:25:19 UTC-4, JoeLinux wrote:
>
> The correct answer is that the default project layout has changed. See my 
> previous email. Let me know if that works!
> --
> Joey "JoeLinux" Espinosa*
> *
>  
> 
>
>
>
> On Wed, Apr 4, 2012 at 1:24 PM, maxim  wrote:
>
>> No, I tried removing the file, creating it with touch and I also used 
>> sqlite3 to create a table in there to make sure it actually has some 
>> database in there:
>> sqlite3 /home/maxim/mysite/mysite.db
>> SQLite version 3.6.23.1
>> Enter ".help" for instructions
>> Enter SQL statements terminated with a ";"
>> sqlite> .schema
>> CREATE TABLE my_table (id int);
>>
>> I still get that error in all cases.
>>
>> On Wednesday, 4 April 2012 13:19:13 UTC-4, creecode wrote:
>>>
>>> Hello maxim,
>>>
>>> On Wednesday, April 4, 2012 9:51:39 AM UTC-7, maxim wrote:
>>>
>>> I can't get the tutorial working for me. When I try to run the command:
 python manage.py syncdb

>>>  
>>>
 My settings file has this for databases:

>>>  
>>>
 'NAME': '/home/maxim/mysite/mysite.db'**, 
  # Or path to database file if using sqlite3.

>>>
>>> I'm not sure but could it be there is no file at 
>>> /home/maxim/mysite/mysite.db ?  If not you might try to touch that path and 
>>> then try your syncdb.  It looks like are are on some kind of unix/linux 
>>> variant so you probably have a touch command.
>>>
>>> Toodle-looo..
>>> creecode
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/R2FY3gjMxH0J.
>>
>> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/scumR4YKrlEJ.
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: Problem with Django tutorial

2012-04-04 Thread Joey Espinosa
The correct answer is that the default project layout has changed. See my
previous email. Let me know if that works!
--
Joey "JoeLinux" Espinosa*
*





On Wed, Apr 4, 2012 at 1:24 PM, maxim  wrote:

> No, I tried removing the file, creating it with touch and I also used
> sqlite3 to create a table in there to make sure it actually has some
> database in there:
> sqlite3 /home/maxim/mysite/mysite.db
> SQLite version 3.6.23.1
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> .schema
> CREATE TABLE my_table (id int);
>
> I still get that error in all cases.
>
> On Wednesday, 4 April 2012 13:19:13 UTC-4, creecode wrote:
>>
>> Hello maxim,
>>
>> On Wednesday, April 4, 2012 9:51:39 AM UTC-7, maxim wrote:
>>
>> I can't get the tutorial working for me. When I try to run the command:
>>> python manage.py syncdb
>>>
>>
>>
>>> My settings file has this for databases:
>>>
>>
>>
>>> 'NAME': '/home/maxim/mysite/mysite.db'**,
>>>  # Or path to database file if using sqlite3.
>>>
>>
>> I'm not sure but could it be there is no file at
>> /home/maxim/mysite/mysite.db ?  If not you might try to touch that path and
>> then try your syncdb.  It looks like are are on some kind of unix/linux
>> variant so you probably have a touch command.
>>
>> Toodle-looo..
>> creecode
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/R2FY3gjMxH0J.
>
> 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.



Re: Problem with Django tutorial

2012-04-04 Thread Joey Espinosa
Which settings.py file are you modifying? I had this problem at first too
when I didn't read about Django's changes from 1.3 to 1.4. Here's an
excerpt from
https://docs.djangoproject.com/en/1.4/releases/1.4/#updated-default-project-layout-and-manage-py
 :

Django 1.4 ships with an updated default project layout and manage.py file
> for the 
> startproject
>  management
> command. These fix some issues with the previous manage.py handling of
> Python import paths that caused double imports, trouble moving from
> development to deployment, and other difficult-to-debug path issues.



manage.py
mysite/
__init__.py
settings.py
urls.py
myapp/
__init__.py
models.py

So basically, now there's a directory inside the project directory with the
same name:

$ django-admin.py startproject example

$ ls
> example/__init__.pymanage.pysettings.pyurls.py
> $ ls example/
> __init__.py*settings.py*urls.pyviews.pywsgi.py


 The correct settings.py file you should use is NOT the one in the main
project directory, it's the one INSIDE the directory that's created inside
the project directory (the one I bolded). That's one major thing that's
changed with this version of Django. The outer "settings.py" and "urls.py"
shouldn't even exist, but for some reason they're being created anyway.


--
Joey "JoeLinux" Espinosa*
*





On Wed, Apr 4, 2012 at 1:15 PM, maxim  wrote:

> Yes
>
>
> On Wednesday, 4 April 2012 13:12:27 UTC-4, JoeLinux wrote:
>>
>> Are you using Django 1.4?
>> --
>> Joey "JoeLinux" Espinosa*
>> *
>>   
>> 
>>
>>
>>
>> On Wed, Apr 4, 2012 at 12:51 PM, maxim  wrote:
>>
>>> I can't get the tutorial working for me. When I try to run the command:
>>> python manage.py syncdb
>>>
>>> I get this error:
>>> Traceback (most recent call last):
>>>   File "manage.py", line 10, in 
>>> execute_from_command_line(sys.**argv)
>>>   File 
>>> "/usr/lib/python2.7/site-**packages/django/core/**management/__init__.py",
>>> line 443, in execute_from_command_line
>>> utility.execute()
>>>   File 
>>> "/usr/lib/python2.7/site-**packages/django/core/**management/__init__.py",
>>> line 382, in execute
>>> self.fetch_command(subcommand)**.run_from_argv(self.argv)
>>>   File 
>>> "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>>> line 196, in run_from_argv
>>> self.execute(*args, **options.__dict__)
>>>   File 
>>> "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>>> line 232, in execute
>>> output = self.handle(*args, **options)
>>>   File 
>>> "/usr/lib/python2.7/site-**packages/django/core/**management/base.py",
>>> line 371, in handle
>>> return self.handle_noargs(**options)
>>>File "/usr/lib/python2.7/site-**packages/django/core/**
>>> management/commands/syncdb.py"**, line 57, in handle_noargs
>>> cursor = connection.cursor()
>>>   File 
>>> "/usr/lib/python2.7/site-**packages/django/db/backends/**dummy/base.py",
>>> line 15, in complain
>>> raise ImproperlyConfigured("**settings.DATABASES is improperly
>>> configured. "
>>> django.core.exceptions.**ImproperlyConfigured: settings.DATABASES is
>>> improperly configured. Please supply the ENGINE value. Check settings
>>> documentation for more details.
>>>
>>> My settings file has this for databases:
>>> DATABASES = {
>>> 'default': {
>>> 'ENGINE': 'django.db.backends.sqlite3', # Add
>>> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>>> 'NAME': '/home/maxim/mysite/mysite.db'**,
>>>  # Or path to database file if using sqlite3.
>>> 'USER': '',  # Not used with sqlite3.
>>> 'PASSWORD': '',  # Not used with sqlite3.
>>> 'HOST': '',  # Set to empty string for
>>> localhost. Not used with sqlite3.
>>> 'PORT': '',  # Set to empty string for
>>> default. Not used with sqlite3.
>>> }
>>> }
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**PPPfCQEQOKEJ
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *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 view this

Re: Problem with Django tutorial

2012-04-04 Thread maxim
No, I tried removing the file, creating it with touch and I also used 
sqlite3 to create a table in there to make sure it actually has some 
database in there:
sqlite3 /home/maxim/mysite/mysite.db
SQLite version 3.6.23.1
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema
CREATE TABLE my_table (id int);

I still get that error in all cases.

On Wednesday, 4 April 2012 13:19:13 UTC-4, creecode wrote:
>
> Hello maxim,
>
> On Wednesday, April 4, 2012 9:51:39 AM UTC-7, maxim wrote:
>
> I can't get the tutorial working for me. When I try to run the command:
>> python manage.py syncdb
>>
>  
>
>> My settings file has this for databases:
>>
>  
>
>> 'NAME': '/home/maxim/mysite/mysite.db',  # Or 
>> path to database file if using sqlite3.
>>
>
> I'm not sure but could it be there is no file at 
> /home/maxim/mysite/mysite.db ?  If not you might try to touch that path and 
> then try your syncdb.  It looks like are are on some kind of unix/linux 
> variant so you probably have a touch command.
>
> Toodle-looo..
> creecode
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/R2FY3gjMxH0J.
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: Problem with Django tutorial

2012-04-04 Thread creecode
Opps...

On Wednesday, April 4, 2012 10:19:13 AM UTC-7, creecode wrote:
>
>
> It looks like are are on some kind of unix/linux variant so you probably 
> have a touch command.
>

That should have been "It looks like you are on..."  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/qadyM8eb-mkJ.
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: Problem with Django tutorial

2012-04-04 Thread creecode
Hello maxim,

On Wednesday, April 4, 2012 9:51:39 AM UTC-7, maxim wrote:

I can't get the tutorial working for me. When I try to run the command:
> python manage.py syncdb
>
 

> My settings file has this for databases:
>
 

> 'NAME': '/home/maxim/mysite/mysite.db',  # Or 
> path to database file if using sqlite3.
>

I'm not sure but could it be there is no file at 
/home/maxim/mysite/mysite.db ?  If not you might try to touch that path and 
then try your syncdb.  It looks like are are on some kind of unix/linux 
variant so you probably have a touch command.

Toodle-looo..
creecode

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/GNnW9phn3JMJ.
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: Problem with Django tutorial

2012-04-04 Thread maxim
Yes

On Wednesday, 4 April 2012 13:12:27 UTC-4, JoeLinux wrote:
>
> Are you using Django 1.4?
> --
> Joey "JoeLinux" Espinosa*
> *
>   
> 
>
>
>
> On Wed, Apr 4, 2012 at 12:51 PM, maxim  wrote:
>
>> I can't get the tutorial working for me. When I try to run the command:
>> python manage.py syncdb
>>
>> I get this error:
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
>> 443, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
>> 382, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
>> line 196, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
>> line 232, in execute
>> output = self.handle(*args, **options)
>>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py", 
>> line 371, in handle
>> return self.handle_noargs(**options)
>>   File 
>> "/usr/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
>>  
>> line 57, in handle_noargs
>> cursor = connection.cursor()
>>   File 
>> "/usr/lib/python2.7/site-packages/django/db/backends/dummy/base.py", line 
>> 15, in complain
>> raise ImproperlyConfigured("settings.DATABASES is improperly 
>> configured. "
>> django.core.exceptions.ImproperlyConfigured: settings.DATABASES is 
>> improperly configured. Please supply the ENGINE value. Check settings 
>> documentation for more details.
>>
>> My settings file has this for databases:
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3', # Add 
>> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>> 'NAME': '/home/maxim/mysite/mysite.db',  # Or 
>> path to database file if using sqlite3.
>> 'USER': '',  # Not used with sqlite3.
>> 'PASSWORD': '',  # Not used with sqlite3.
>> 'HOST': '',  # Set to empty string for 
>> localhost. Not used with sqlite3.
>> 'PORT': '',  # Set to empty string for 
>> default. Not used with sqlite3.
>> }
>> }
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/PPPfCQEQOKEJ.
>> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/3ZDAMJucaLIJ.
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: Problem with Django tutorial

2012-04-04 Thread Joey Espinosa
Are you using Django 1.4?
--
Joey "JoeLinux" Espinosa*
*
 




On Wed, Apr 4, 2012 at 12:51 PM, maxim  wrote:

> I can't get the tutorial working for me. When I try to run the command:
> python manage.py syncdb
>
> I get this error:
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line
> 443, in execute_from_command_line
> utility.execute()
>   File
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line
> 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py",
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File "/usr/lib/python2.7/site-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
>   File
> "/usr/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> line 57, in handle_noargs
> cursor = connection.cursor()
>   File
> "/usr/lib/python2.7/site-packages/django/db/backends/dummy/base.py", line
> 15, in complain
> raise ImproperlyConfigured("settings.DATABASES is improperly
> configured. "
> django.core.exceptions.ImproperlyConfigured: settings.DATABASES is
> improperly configured. Please supply the ENGINE value. Check settings
> documentation for more details.
>
> My settings file has this for databases:
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3', # Add
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': '/home/maxim/mysite/mysite.db',  # Or
> path to database file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for
> localhost. Not used with sqlite3.
> 'PORT': '',  # Set to empty string for
> default. Not used with sqlite3.
> }
> }
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/PPPfCQEQOKEJ.
> 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.



Re: Problem with Django starting up

2012-03-21 Thread Andre Terra
What I recommend is that you install pip and virtualenv, create a folder
(say, C:\virtual\) where you will place different python "environments" per
virtualenv, then create a folder (say, C:\projects) where you will create
different django projects.

This way you can always use virtualenv to "activate" different environments
and not need to install libraries system-wide.


Basically (blue commands are to be typed in the command prompt):
01. Go to http://pypi.python.org/pypi/pip#downloads
02. Download the archive, extract the contents to a given folder (you might
need 7-zip[1]).
03. Open the command prompt (Winkey+R, type in "cmd" with no quotes)
04. cd into the folder created by the extracted archive in step 02
05. python setup.py install
06. Make sure you have C:\Python27\Scripts in your PATH.
06.1. Do this by typing set PATH=C:\Python27\Scripts;%PATH% in the command
prompt
07. pip install virtualenv
08. mkdir c:\virtual && mkdir c:\projects
09. cd c:\virtual
10. virtualenv --no-site-packages myfirstenvironment (you can name this
after your project if you want to)
11. cd myfirstenvironment

*12. Activate your environment:
C:\virtual\myfirstenvironment\Scripts\activate.bat*

If you want the development version of Django:
13.A. pip install git+https://github.com/django/django.git#egg=django

If you want a stable release:
13.B. pip install django

14. Whenever you need to install a package, just do the same as in step #12
but type the package name instead of django. Don't forget to activate your
environment whenever you open a command prompt window and BEFORE you start
working on your project!


I think that about sums it up. Using this on linux is of course easier. I
hope I didn't miss any steps, but I'm sure others will correct me if I
forgot anything.


Cheers,
AT


[1] http://www.7-zip.org/download.html


On Wed, Mar 21, 2012 at 3:48 AM, Jani Tiainen  wrote:

> 21.3.2012 7:50, Samuel Muiruri kirjoitti:
>
>  I can't get the first part to work
>>
>>
> I assume that you have python installed to c:\python27\
>
> You need to add c:\python27\scripts to your path.
>
> Or alternatively:
>
> c:\python27\scripts\django-**admin.py startproject mysite
>
> --
>
> Jani Tiainen
>
>
> --
> 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+unsubscribe@**
> 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.



Re: Problem with Django starting up

2012-03-20 Thread Jani Tiainen

21.3.2012 7:50, Samuel Muiruri kirjoitti:

I can't get the first part to work



I assume that you have python installed to c:\python27\

You need to add c:\python27\scripts to your path.

Or alternatively:

c:\python27\scripts\django-admin.py startproject mysite

--

Jani Tiainen

--
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: Problem with Django! Please help

2012-01-27 Thread Tomas Neme
So, you need to create a "user registration" view.

Plus, I'd just use auth.models.User
https://docs.djangoproject.com/en/1.3/topics/auth/ because you're
saving the passwords as plain text, and that is A Bad Thing.

That, and because there's a bunch of stuff and apps you can use to
help you on all this if you use it (search for django-registration and
django-profiles, for example)

Cheers
Tomas

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
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: Problem with Django and AJAX: Empty responsetext

2011-11-21 Thread Furbee
Disclaimer: I don't know if this is at all related, but I had an issue with
an AJAX object I created outside a function. Can you try this and let me
know if it works?

Change this:
var searchReq = getXmlHttpRequestObject();
to this:
searchReq = getXmlHttpRequestObject();

and move it into searchSuggest(), like:
function searchSuggest() {
searchReq = getXmlHttpRequestObject();
.
.
.
}

I can't explain this, but it tripped me up, because creating the AJAX
object globally, outside a function, didn't seem to work. I read an
explanation that made some sense, although it seemed like a bug, but it has
been too long and I can't remember exactly what the problem was. Keep me
posted.

Furbee

On Mon, Nov 21, 2011 at 1:10 PM, Schmidtchen Schleicher <
spiolli...@googlemail.com> wrote:

> I'm trying to do a simple google-suggest like thing with django and ajax.
> I wrote a view for creating the response and try to use it via an
> XMLHttpRequest.
> Here's my view:
>
>
> def category_suggest(request):
>> if request.method == "GET":
>> return_categories = ''
>> received_str = request.GET['str']
>> found_categories =
>> Category.objects.filter(name__istartswith=received_str) #i stands for
>> incasesensitive
>> if found_categories:
>> for cat in found_categories:
>> return_categories = return_categories + cat.name + "\n"
>>
>> print "returned str:"
>> print return_categories
>> return HttpResponse(str(return_categories), mimetype='text/plain')
>> else:
>> return HttpResponse('')
>>
>
> This view appears to work, because if I open the corresponding url in a
> browser the data is displayed.
> But it doesn't work via ajax: this is the javascript code:
>
> //Gets the browser specific XmlHttpRequest Object
>> function getXmlHttpRequestObject() {
>> console.debug("GettingXMLHTTP");
>> if (window.XMLHttpRequest) {
>> return new XMLHttpRequest();
>> } else if(window.ActiveXObject) {
>> return new ActiveXObject("Microsoft.XMLHTTP");
>> } else {
>> alert("Your Browser Sucks!\nIt's about time to upgrade don't you
>> think?");
>> }
>> }
>>
>> //Our XmlHttpRequest object to get the auto suggest
>> var searchReq = getXmlHttpRequestObject();
>>
>> //Called from keyup on the search textbox.
>> //Starts the AJAX request.
>> function searchSuggest() {
>> if (searchReq.readyState == 4 || searchReq.readyState == 0) {
>> console.debug("start suggest...");
>> var str = escape(document.getElementById('txtSearch').value);
>> searchReq.onreadystatechange = handleSearchSuggest;
>> var myDate = new Date();
>> var myTime = myDate.getTime();
>> searchReq.open("GET", '
>> http://127.0.0.1:8000/kalender/ajax/category_suggest/?str=' + str +
>> "&time=" + myTime, true);
>> console.debug("sending");
>> searchReq.send(null);
>> }
>> }
>>
>> //Called when the AJAX response is returned.
>> function handleSearchSuggest() {
>> console.debug("Handling suggest");
>> if (searchReq.readyState == 4) {
>> console.debug("ReadyState is 4");
>> var ss = document.getElementById('search_suggest')
>> ss.innerHTML = '';
>> var rstr = searchReq.responseText.split("\n");
>> console.debug("Response:"+JSON.stringify(searchReq));
>> for(i=0; i < rstr.length - 1; i++) {
>> //Build our element string.  This is cleaner using the DOM,
>> but
>> //IE doesn't support dynamically added attributes.
>> var suggest = '> suggest += 'onclick="javascript:setSearch(this.innerHTML);" ';
>> suggest += 'class="suggest_link">' + rstr[i] + '';
>> ss.innerHTML += suggest;
>> }
>> }
>> }
>>
>> //Click function
>> function setSearch(value) {
>> document.getElementById('txtSearch').value = value;
>> document.getElementById('search_suggest').innerHTML = '';
>> }
>>
>
> Every function is getting entered and firebug shows there's is a request
> sendet to the django view but the responsetext is an empty string although
> the django-view prints (for debugging purposes) the strings it should send
> to the console.
> I've asked many people who are really fit in javascript and noone could
> find the error :( They told me it must be a django-related issue
>
> So is it because of django and do You find the error?
>
> Thanks
> Schmidtchen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/SmXwPWGtKnYJ.
> 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 s

Re: problem with django admin

2011-08-09 Thread damola oyeniyi
Hi all,

Anybody know a good documentation or book that can help me with integrating 
google maps with my app?

-- 
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: problem with django admin

2011-08-08 Thread damola oyeniyi
Thanks Chintan, Tom,

'twas easy.

Regards
Damola




From: Chintan Tank 
To: django-users@googlegroups.com
Sent: Monday, August 8, 2011 4:08:09 PM
Subject: Re: problem with django admin


I think you might want to define what text to display when you directly 
reference the model's instance.

see https://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddocs#unicode

In Java it is like overriding the toString() method.


On Mon, Aug 8, 2011 at 10:35 AM, Oyedamola Oyeniyi  wrote:

Hi all,
>
>I have a strange problem with the admin pages and I don't evenknow
>where to begin tolook at the FAQ. I'm a newbie to Django and Python(in
>fact, web applications in general) so forgive the dumbness of the
>question.
>
>I have just finished the models.py and admin.py files on an app I am
>working with. Navigations and the like on the admin interface seems to
>work fine. But I have issues with 3 tables: Operator,Address and
>Operator_Address. As is obvious, I created the Operator_Address table
>as a join table for the manytomany relationship between Operator, and
>Address!.
>
>I am trying to populate the Operator_Address table with data I have
>filled in Operator and Address tables respectively. I assumed that in
>the dropbox for the Operator_Address interface, I was supposed to be
>presented with string literals signifying the Operators and Addresses
>I filled in their respective interfaces, instead I get "Operator
>object" and "Address object" for as many objects I created.
>
>Am I missing something?
>
>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.
>
>


Thanks, 

Chintan
-- 
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.



Re: problem with django admin

2011-08-08 Thread Chintan Tank
I think you might want to define what text to display when you directly
reference the model's instance.

see
https://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddocs#unicode

In Java it is like overriding the toString() method.

On Mon, Aug 8, 2011 at 10:35 AM, Oyedamola Oyeniyi wrote:

> Hi all,
>
> I have a strange problem with the admin pages and I don't evenknow
> where to begin tolook at the FAQ. I'm a newbie to Django and Python(in
> fact, web applications in general) so forgive the dumbness of the
> question.
>
> I have just finished the models.py and admin.py files on an app I am
> working with. Navigations and the like on the admin interface seems to
> work fine. But I have issues with 3 tables: Operator,Address and
> Operator_Address. As is obvious, I created the Operator_Address table
> as a join table for the manytomany relationship between Operator, and
> Address!.
>
> I am trying to populate the Operator_Address table with data I have
> filled in Operator and Address tables respectively. I assumed that in
> the dropbox for the Operator_Address interface, I was supposed to be
> presented with string literals signifying the Operators and Addresses
> I filled in their respective interfaces, instead I get "Operator
> object" and "Address object" for as many objects I created.
>
> Am I missing something?
>
> 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.
>
>


Thanks,

Chintan

-- 
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: Problem with django book in Forms chapter 7

2011-08-07 Thread Gmail - neonmark

  
  
Check the comments on LHS of the Book page. In there is a simple
method that works and does not need to remove the middleware.
Specifically (as there are loads of comments)
Frank Kruchio's comment in the comment section next to this text

Try running this locally. Load the form, submit it with
  none of the fields
  filled out, submit it with an invalid e-mail address, then finally
  submit it
  with valid data. (Of course, depending on your mail-server
  configuration, you
  might get an error when send_mail() is called, but that’s
  another issue.)


On 8/8/2011 8:57 AM, Hayyan Rafiq wrote:

  
  
Here is how i did it
@csrf_exempt
def contact(request):
    if request.method == 'POST':
    form = ContactForm(request.POST)
    if form.is_valid():
    cd = form.cleaned_data
    send_mail(
    cd['subject'],
    cd['message'],
    cd.get('email', 'nore...@example.com'),
    ['siteow...@example.com'],
    )
    return HttpResponseRedirect('/contact/thanks/')
    else:
    form = ContactForm()
    return render_to_response('contact_form.html', {'form':
form})


      From: hayya...@hotmail.com
  To: django-users@googlegroups.com
  Subject: RE: Problem with django book in Forms chapter 7
  Date: Sun, 7 Aug 2011 20:11:51 +
  
  
  
  
  
Hi just started facing the same problem which you did in
chapter 7 . I tried using

def contact(request):
    if request.method == 'POST':
    form = ContactForm(request.POST)
    if form.is_valid():
    cd = form.cleaned_data
    send_mail(
    cd['subject'],
    cd['message'],
    cd.get('email', 'nore...@example.com'),
    ['siteow...@example.com'],
    )
    return HttpResponseRedirect('/contact/thanks/')
    else:
    form = ContactForm()
    return render_to_response('contact_form.html', {'form':
form},context_instance=RequestContext(request))

but still i get the following could you please tell me how
you resolved the issue...

  Forbidden (403)
  CSRF verification failed. Request aborted.


  Help
  Reason given for failure:
  CSRF token missing or incorrect.

  In general, this can occur when there is a genuine Cross
  Site Request Forgery, or when Django's CSRF mechanism has not been
  used correctly. For POST forms, you need to ensure:
  
The view function uses RequestContext for
  the template, instead of Context.
In the template, there is a {% csrf_token %}
  template tag inside each POST form that targets an
  internal URL.
If you are not using CsrfViewMiddleware,
  then you must use csrf_protect on any
  views that use the csrf_token template
  tag, as well as those that accept the POST data.
  
  You're seeing the help section of this page because you
  have DEBUG = True in your Django settings
  file. Change that to False, and only the
  initial error message will be displayed. 
  You can customize this page using the CSRF_FAILURE_VIEW
  setting.

    
    
    > Date: Sun, 7 Aug 2011 09:10:36 +0200
  > From: rafadurancastan...@gmail.com
  > To: django-users@googlegroups.com
  > Subject: Re: Problem with django book in Forms
  chapter 7
  > 
  > I had the same problem as you, since the book was
  written using an older 
  > django version and there was some changes on csrf for
  django version 
  > 1.2. Looking at django docs 
  >
  https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#how-to-use-it
  
  > you can read recommended way to use this
  > 
  > 
  > On 06/08/11 2

RE: Problem with django book in Forms chapter 7

2011-08-07 Thread Hayyan Rafiq

Here is how i did it
@csrf_exempt
def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
send_mail(
cd['subject'],
cd['message'],
cd.get('email', 'nore...@example.com'),
['siteow...@example.com'],
)
return HttpResponseRedirect('/contact/thanks/')
else:
form = ContactForm()
return render_to_response('contact_form.html', {'form': form})

From: hayya...@hotmail.com
To: django-users@googlegroups.com
Subject: RE: Problem with django book in Forms chapter 7
Date: Sun, 7 Aug 2011 20:11:51 +








Hi just started facing the same problem which you did in chapter 7 . I tried 
using

def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
send_mail(
cd['subject'],
cd['message'],
cd.get('email', 'nore...@example.com'),
['siteow...@example.com'],
)
return HttpResponseRedirect('/contact/thanks/')
else:
form = ContactForm()
return render_to_response('contact_form.html', {'form': 
form},context_instance=RequestContext(request))

but still i get the following could you please tell me how you resolved the 
issue...

  Forbidden (403)
  CSRF verification failed. Request aborted.





  Help

Reason given for failure:

CSRF token missing or incorrect.



  In general, this can occur when there is a genuine Cross Site Request 
Forgery, or when
  Django's
  CSRF mechanism has not been used correctly.  For POST forms, you need to
  ensure:


  The view function uses RequestContext
for the template, instead of Context.In the template, there is a {% 
csrf_token
%} template tag inside each POST form that
targets an internal URL.If you are not using CsrfViewMiddleware, then you 
must use
csrf_protect on any views that use the csrf_token
template tag, as well as those that accept the POST data.

  You're seeing the help section of this page because you have DEBUG =
  True in your Django settings file. Change that to False,
  and only the initial error message will be displayed.  


  You can customize this page using the CSRF_FAILURE_VIEW setting.



> Date: Sun, 7 Aug 2011 09:10:36 +0200
> From: rafadurancastan...@gmail.com
> To: django-users@googlegroups.com
> Subject: Re: Problem with django book in Forms chapter 7
> 
> I had the same problem as you, since the book was written using an older 
> django version and there was some changes on csrf for django version 
> 1.2. Looking at django docs 
> https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#how-to-use-it 
> you can read recommended way to use this
> 
> 
> On 06/08/11 23:05, bob gailer wrote:
> > I love the django book. Until I got to the section "Tying Your First
> > Form Class".
> >
> > Problem:-"This class can live anywhere you want — including directly
> > in your views.py file — but community convention is to keep Form
> > classes in a separate file called forms.py. Create this file in the
> > same directory as your views.py" The examples then use from
> > contact.forms import ContactForm. Where did contact come from? I had
> > to remove it to get the import to work!
> >
> > Then all is OK until "Tying Form Objects Into Views". Here is where I
> > run into the
> > CSRF verification failed. Request aborted.
> > Reason given for failure:CSRF token missing or incorrect."
> >
> > After much searching I found:
> >
> > from django.template import RequestContext
> > ...
> >  form = ContactForm()
> >  return render_to_response('contact_form.html', {'form': form},
> >
> > context_instance=RequestContext(request))
> > and now it works.
> >
> 
> -- 
> 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-user

RE: Problem with django book in Forms chapter 7

2011-08-07 Thread Hayyan Rafiq

Hi just started facing the same problem which you did in chapter 7 . I tried 
using

def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
send_mail(
cd['subject'],
cd['message'],
cd.get('email', 'nore...@example.com'),
['siteow...@example.com'],
)
return HttpResponseRedirect('/contact/thanks/')
else:
form = ContactForm()
return render_to_response('contact_form.html', {'form': 
form},context_instance=RequestContext(request))

but still i get the following could you please tell me how you resolved the 
issue...

  Forbidden (403)
  CSRF verification failed. Request aborted.




  Help

Reason given for failure:
CSRF token missing or incorrect.



  In general, this can occur when there is a genuine Cross Site Request 
Forgery, or when
  Django's
  CSRF mechanism has not been used correctly.  For POST forms, you need to
  ensure:

  The view function uses RequestContext
for the template, instead of Context.In the template, there is a {% 
csrf_token
%} template tag inside each POST form that
targets an internal URL.If you are not using CsrfViewMiddleware, then you 
must use
csrf_protect on any views that use the csrf_token
template tag, as well as those that accept the POST data.

  You're seeing the help section of this page because you have DEBUG =
  True in your Django settings file. Change that to False,
  and only the initial error message will be displayed.  

  You can customize this page using the CSRF_FAILURE_VIEW setting.


> Date: Sun, 7 Aug 2011 09:10:36 +0200
> From: rafadurancastan...@gmail.com
> To: django-users@googlegroups.com
> Subject: Re: Problem with django book in Forms chapter 7
> 
> I had the same problem as you, since the book was written using an older 
> django version and there was some changes on csrf for django version 
> 1.2. Looking at django docs 
> https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#how-to-use-it 
> you can read recommended way to use this
> 
> 
> On 06/08/11 23:05, bob gailer wrote:
> > I love the django book. Until I got to the section "Tying Your First
> > Form Class".
> >
> > Problem:-"This class can live anywhere you want — including directly
> > in your views.py file — but community convention is to keep Form
> > classes in a separate file called forms.py. Create this file in the
> > same directory as your views.py" The examples then use from
> > contact.forms import ContactForm. Where did contact come from? I had
> > to remove it to get the import to work!
> >
> > Then all is OK until "Tying Form Objects Into Views". Here is where I
> > run into the
> > CSRF verification failed. Request aborted.
> > Reason given for failure:CSRF token missing or incorrect."
> >
> > After much searching I found:
> >
> > from django.template import RequestContext
> > ...
> >  form = ContactForm()
> >  return render_to_response('contact_form.html', {'form': form},
> >
> > context_instance=RequestContext(request))
> > and now it works.
> >
> 
> -- 
> 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.



Re: Problem with django book in Forms chapter 7

2011-08-07 Thread Rafael Durán Castañeda
I had the same problem as you, since the book was written using an older 
django version and there was some changes on csrf for django version 
1.2. Looking at django docs 
https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#how-to-use-it 
you can read recommended way to use this



On 06/08/11 23:05, bob gailer wrote:

I love the django book. Until I got to the section "Tying Your First
Form Class".

Problem:-"This class can live anywhere you want — including directly
in your views.py file — but community convention is to keep Form
classes in a separate file called forms.py. Create this file in the
same directory as your views.py" The examples then use from
contact.forms import ContactForm. Where did contact come from? I had
to remove it to get the import to work!

Then all is OK until "Tying Form Objects Into Views". Here is where I
run into the
CSRF verification failed. Request aborted.
Reason given for failure:CSRF token missing or incorrect."

After much searching I found:

from django.template import RequestContext
...
 form = ContactForm()
 return render_to_response('contact_form.html', {'form': form},

context_instance=RequestContext(request))
and now it works.



--
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: Problem with django auth login_required and lighttpd

2011-01-11 Thread Eric Chamberlain
John,

We have a similar configuration, try adding:

FORCE_SCRIPT_NAME = ''

to settings.py


On Jan 11, 2011, at 2:44 PM, John Finlay wrote:

> I'm trying to serve django pages using mod_fastcgi from a lighttpd server. 
> Everything works well using the setup recommended in the documentation except 
> for the initial login. The porblem seems to be that when the user tries:
> 
> http://server/
> 
> the login page comes up with a url of:
> 
> http://server/accounts/login/?next=/mysite.fcgi/
> 
> After the user login lighttpd returns a 404 looking for 
> http://server/mysite.fcgi/mysite.fcgi
> 
> How do I fix this? A change in urls.py or a change in lighttpd.conf?
> 
> Thanks
> 
> john
> 

--
Eric Chamberlain, Founder
RF.com - http://RF.com/







-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Problem with Django webserver on HP

2010-01-28 Thread Kairam, Raj
Hi Karen,
 
Thanks for the quick reply.
It may be that my problems are due to some thing that happened at the
time of installing Django on my HP box.
After I issued the following command 
python setup.py install
Looked like it was going well but at the end I got these messages
running install_egg_info
error: invalid command 'install_egg_info'
Not knowing what to do, I continued on ..
 
Here is what I did and what I got ...
r...@m020cad2:/home/root/MyDjango/testproject> python manage.py
runserver 0.0
.0.0:8000
Validating models...
0 errors found
 
Django version 1.1.1, using settings 'testproject.settings'
Development server is running at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
I quit ... and saw the following..

Unhandled exception in thread started by 
Traceback (most recent call last):
  File
"/opt/ActivePython-2.6.4.8-hpux11.00-parisc/INSTALLDIR/lib/python2.6/sit
e-packages/django/core/management/commands/runserver.py", line 60, in
inner_run
run(addr, int(port), handler)
  File
"/opt/ActivePython-2.6.4.8-hpux11.00-parisc/INSTALLDIR/lib/python2.6/sit
e-packages/django/core/servers/basehttp.py", line 698, in run
httpd.serve_forever()
  File
"/opt/ActivePython-2.6.4.8-hpux11.00-parisc/INSTALLDIR/lib/python2.6/Soc
ketServer.py", line 224, in serve_forever
r, w, e = select.select([self], [], [], poll_interval)
select.error: (4, 'Interrupted system call')
 
It did not make any difference even when I used 127.0.0.1:8000
 
Please advise if the error while installing Django has anything to do
with me not being able to see the server not running properly.
 
Thanks
Raj   kair...@coned.com
 



From: django-users@googlegroups.com
[mailto:django-us...@googlegroups.com] On Behalf Of Karen Tracey
Sent: Thursday, January 28, 2010 1:34 PM
To: django-users@googlegroups.com
Subject: Re: Problem with Django webserver on HP


On Thu, Jan 28, 2010 at 1:12 PM, Kairam, Raj  wrote:


Core dump and nothing happening in the browser. 


Core dump is a Should Never Happen type of thing with Python, and likely
not due to any Django code, which is pure Python. 

An incompatible/broken C extension might cause it so my first thing to
check out would be whatever database adapter you are using -- what are
you using for a database? 

Karen

 


-- 
You received this message because you are subscribed to the Google
Groups "Django users" group.
To post to this group, send email to django-us...@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-us...@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: Problem with Django webserver on HP

2010-01-28 Thread Karen Tracey
On Thu, Jan 28, 2010 at 1:12 PM, Kairam, Raj  wrote:

> Core dump and nothing happening in the browser.


Core dump is a Should Never Happen type of thing with Python, and likely not
due to any Django code, which is pure Python.

An incompatible/broken C extension might cause it so my first thing to check
out would be whatever database adapter you are using -- what are you using
for a database?

Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Problem with Django webserver on HP

2010-01-28 Thread Jorge Bastida
Note that the default IP address, 127.0.0.1, is not accessible from other
machines on your network. To make your development server viewable to other
machines on the network, use its own IP address (e.g. 192.168.2.1) or
0.0.0.0.

>From any other computer in your network the url will be server/yours ip.
http://server-ip:8000/


-- 
Benito Jorge Bastida
jo...@thecodefarm.com

thecodefarm SL
Av. Gasteiz 21, 1º Derecha
01008 Vitoria-Gasteiz
http://thecodefarm.com
Tel: (+34) 945 06 55 09

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Problem with Django webserver on HP

2010-01-28 Thread Kairam, Raj
Hi Jorge,
Thanks for the quick reply.
I did what you suggested.

r...@myhost:/home/root/MyDjango/testproject> python manage.py runserver 
0.0.0.0:8000
Validating models...
0 errors found

Django bersion 1.1.1, using settings 'testproject.settings'
Development server is running at http://0.0.0.0:8000/ <http://0.0.0.0:8000/> 
Quit the server with CONTROL-C.

Now, open Mozilla browser and enter http://0.0.0.0:8000/ <http://0.0.0.0:8000/> 
Facing the same problem. Core dump and nothing happening in the browser.
 
I noticed the following in the testproject directory.
-rw-rw-r--   1  root   sys  0   Jan 21  16:46  _init_.py
 
Please advise.
Rajkair...@coned.com





From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On 
Behalf Of Jorge Bastida
Sent: Thursday, January 28, 2010 12:38 PM
To: django-users@googlegroups.com
Subject: Re: Problem with Django webserver on HP


http://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-ipaddr-port
 

Try with 
python manage.py runserver 0.0.0.0:8000


2010/1/28 rajk 



HP-UX B.11.00
Django-1.1.1

myhost:/home/root/MyPython> python
ActivePython 2.6.4.8 (ActiveState Software Inc.) based on
Python 2.6.4 (r264:75706, Nov 3 2009, 13:55:48) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 1, 1, 'final', 0)
>>> exit()

r...@myhost:/home/root/MyDjango> cd testproject
r...@myhost:/home/root/MyDjango/testproject>ls
_init_.py  _init_.pyc  manage.py  settings.py  settings.pyc   urls.py
r...@myhost:/home/root/MyDjango/testproject> python manage.py
runserver
Validating models...
0 errors found

Django bersion 1.1.1, using settings 'testproject.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Now, open Mozilla browser and enter http://127.0.0.1:8000/

Here is the PROBLEM which some one from the user group can resolve for
me ..
Nothing happens in the browser
A core file is in the  r...@myhost:/home/root/MyDjango/testproject
directory

Please advise and help - Thanks,  kair...@coned.com

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






-- 
Benito Jorge Bastida
jo...@thecodefarm.com

thecodefarm SL
Av. Gasteiz 21, 1º Derecha
01008 Vitoria-Gasteiz
http://thecodefarm.com
Tel: (+34) 945 06 55 09


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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-us...@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: Problem with Django webserver on HP

2010-01-28 Thread Jorge Bastida
http://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-ipaddr-port

Try with
python manage.py runserver 0.0.0.0:8000


2010/1/28 rajk 

>
> HP-UX B.11.00
> Django-1.1.1
>
> myhost:/home/root/MyPython> python
> ActivePython 2.6.4.8 (ActiveState Software Inc.) based on
> Python 2.6.4 (r264:75706, Nov 3 2009, 13:55:48) [C] on hp-ux11
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import django
> >>> django.VERSION
> (1, 1, 1, 'final', 0)
> >>> exit()
>
> r...@myhost:/home/root/MyDjango> cd testproject
> r...@myhost:/home/root/MyDjango/testproject>ls
> _init_.py  _init_.pyc  manage.py  settings.py  settings.pyc   urls.py
> r...@myhost:/home/root/MyDjango/testproject> python manage.py
> runserver
> Validating models...
> 0 errors found
>
> Django bersion 1.1.1, using settings 'testproject.settings'
> Development server is running at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
>
> Now, open Mozilla browser and enter http://127.0.0.1:8000/
>
> Here is the PROBLEM which some one from the user group can resolve for
> me ..
> Nothing happens in the browser
> A core file is in the  r...@myhost:/home/root/MyDjango/testproject
> directory
>
> Please advise and help - Thanks,  kair...@coned.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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.
>
>


-- 
Benito Jorge Bastida
jo...@thecodefarm.com

thecodefarm SL
Av. Gasteiz 21, 1º Derecha
01008 Vitoria-Gasteiz
http://thecodefarm.com
Tel: (+34) 945 06 55 09

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Problem with Django

2010-01-21 Thread esatterwh...@wi.rr.com
these error messages seem to rather explanatory. you are trying to
serialize data that the serializer you are using can not serialize.
you will have to  convert the data into a format that is serializeable
before hand and then send it.


On Jan 21, 3:16 am, Meenu  wrote:
> My form contains date of birth and total income field. I am getting
> following errors:
>
> datetime.date is not json serializable
> decimal is not json serializable.
>
> On Jan 21, 11:06 am, Prashanth  wrote:
>
> > Hi,
>
> > On Thu, Jan 21, 2010 at 10:53 AM, Meenu  wrote:
>
> > > I've noticed that my form submission seems to randomly fail on the
> > > line var response_obj = eval('(' + o.responseText + ')'); in my
> > > javascript. My form contains date and decimal fields.
>
> > Pretty hard to figure out just with the javascript line though eval
> > looks fine, print the response that you are getting from django and
> > try to debug or if you want people to point out do a pastebin of your
> > view and response that you are doing in the javascript.
>
> > --
> > regards,
> > Prashanth
> > twitter: munichlinux
> > blog: prashanthblog.appspot.com
> > irc: munichlinux, JSLint, munichpython.
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Problem with Django

2010-01-21 Thread Meenu
My form contains date of birth and total income field. I am getting
following errors:

datetime.date is not json serializable
decimal is not json serializable.



On Jan 21, 11:06 am, Prashanth  wrote:
> Hi,
>
> On Thu, Jan 21, 2010 at 10:53 AM, Meenu  wrote:
>
> > I've noticed that my form submission seems to randomly fail on the
> > line var response_obj = eval('(' + o.responseText + ')'); in my
> > javascript. My form contains date and decimal fields.
>
> Pretty hard to figure out just with the javascript line though eval
> looks fine, print the response that you are getting from django and
> try to debug or if you want people to point out do a pastebin of your
> view and response that you are doing in the javascript.
>
> --
> regards,
> Prashanth
> twitter: munichlinux
> blog: prashanthblog.appspot.com
> irc: munichlinux, JSLint, munichpython.
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Problem with Django

2010-01-20 Thread Prashanth
Hi,

On Thu, Jan 21, 2010 at 10:53 AM, Meenu  wrote:
>
> I've noticed that my form submission seems to randomly fail on the
> line var response_obj = eval('(' + o.responseText + ')'); in my
> javascript. My form contains date and decimal fields.
>

Pretty hard to figure out just with the javascript line though eval
looks fine, print the response that you are getting from django and
try to debug or if you want people to point out do a pastebin of your
view and response that you are doing in the javascript.

-- 
regards,
Prashanth
twitter: munichlinux
blog: prashanthblog.appspot.com
irc: munichlinux, JSLint, munichpython.
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Problem with Django/Jython and Postgres backend

2009-08-19 Thread fwierzbicki



On Aug 18, 10:54 am, Brandon Taylor  wrote:
> Hi everyone,
>
> I'm getting this exception with the latest Django-Jython and
> Jython2.5:
What version of Django are you using?  What where you doing at the
time that you get this error?

-Frank
--~--~-~--~~~---~--~~
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: Problem with Django/Jython and Postgres backend

2009-08-19 Thread Thomas Guettler

Hi Brandon,

I don't use Jython and not OSX, but if you look at the stacktrace
and at the source, you should see the error.


Brandon Taylor schrieb:
>   File "/Users/btaylor/jython2.5.0/Lib/site-packages/doj/backends/
> zxjdbc/postgresql/base.py", line 54, in __init__
> self.client = DatabaseClient()
> TypeError: __init__() takes exactly 2 arguments (1 given)

"1 given" is the implicit "self". This means your DatabaseClient wants
one argument, but in base.py none is given. Try to find the souce
of DatabaseClient.__init__(self, ...)

u...@host> find django/ -name '*.py'|xargs grep 'class DatabaseClient'
django/db/backends/postgresql/client.py:class 
DatabaseClient(BaseDatabaseClient):
... Mine just inherits from BaseDatabaseClient.



-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

--~--~-~--~~~---~--~~
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: problem with django-voting

2009-03-14 Thread Frank Wiles

On Fri, Mar 13, 2009 at 6:03 PM, Shantp  wrote:
>
> I'm getting this error:
>
> AttributeError: 'NoneType' object has no attribute 'append'
>
> It's coming from this line in my template:
>
> {% scores_for_objects share_list as score_dict %}
>
> If I remove this line everything is fine. I wasn't getting this error
> before but I had to wipe my server and create a new db. Anyone know
> why this is happening?

Just a guess, but it sounds like you're assuming there will be data in
the table somewhere in your code. Try adding some data in for that
model and I bet the error disappears.

-- 
Frank Wiles
Revolution Systems
http://www.revsys.com
(800) 647-6298

--~--~-~--~~~---~--~~
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: Problem with django tagging: how to add tags??

2008-12-09 Thread Andrew Davison

> I am using django tagging and have problems adding tags to an object.
>
> There are 2 methods that enable adding a tag:
> - add_tag()
> - update_tags()
>
> --
> for tag in parse_inputs(form.cleaned_data['tags']):
>   Tag.objects.add_tag(tag)
> ---
>
> This seems to work fine, but if I pass something like "Feature
> Recognition" (A tag containing 2 word) I get an AttributeError
> "multiple tags were given".
>
> In the docs under "Tag input" they say that | apple "ball cat" dog |
> results in these tags [apple], [ball cat], [dog].
>
> So I tried to workaround this problem by using the update_tags method,
> but this just clears all existing and inserts the passed ones.
> So could someone please tell what I am doi9ng wrong, or how to add
> tags

I have the same problem. I think it would be nice if update_tags()
were renamed to set_tags(), and update_tags() behaved analogously to
dict.update(), i.e., not touching existing entries.

In the meantime, you can workaround it by making a local function that
replicates Tags.object.update_tags() but without the deletion step:

--
from tagging.models import Tag, TaggedItem
from tagging.utils import parse_tag_input
from django.contrib.contenttypes.models import ContentType
from django.conf import settings

def update_tags(obj, tag_names):
"""Tags.object.update_tags() deletes any existing tags that aren't
in the
passed list, so this is basically a copy of that method, without
tag removal."""
ctype = ContentType.objects.get_for_model(obj)
current_tags = list(Tag.objects.filter
(items__content_type__pk=ctype.pk,
items__object_id=obj.pk))
updated_tag_names = parse_tag_input(tag_names)
if hasattr(settings, 'FORCE_LOWERCASE_TAGS') and
settings.FORCE_LOWERCASE_TAGS:
updated_tag_names = [t.lower() for t in updated_tag_names]
current_tag_names = [tag.name for tag in current_tags]
for tag_name in updated_tag_names:
if tag_name not in current_tag_names:
tag, created = Tag.objects.get_or_create(name=tag_name)
TaggedItem._default_manager.create(tag=tag, object=obj)
--

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-19 Thread Fedya

Everybody, thank you for feedback.

Karen, you were absolutely right! I've changed collation to
utf8_unicode_ci and Django is converting strings to unicode! This is
fine! Thanks a lot!

RTFM :-)

On Sep 18, 6:12 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> Since you say you are using UTF8_BIN collation on MySQL, be sure to read:
>
> http://docs.djangoproject.com/en/dev/ref/databases/#collation-settings
>
> When you specify a binary collation in MySQL, your application code has to
> take on the responsibility of transforming bytestrings returned by the
> database to unicode objects.  As noted in the docs, you can use
> django.utils.encoding.smart_unicode() to do this.  You should use this in
> your __unicode__ method to coerce the bytestrings coming from the database
> to unicode. Failure to do this results in many problems like what you have
> been reporting, as the admin app relies on the model's __unicode__ method to
> display/log information about objects.
>
> Karen
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Karen Tracey
Since you say you are using UTF8_BIN collation on MySQL, be sure to read:

http://docs.djangoproject.com/en/dev/ref/databases/#collation-settings

When you specify a binary collation in MySQL, your application code has to
take on the responsibility of transforming bytestrings returned by the
database to unicode objects.  As noted in the docs, you can use
django.utils.encoding.smart_unicode() to do this.  You should use this in
your __unicode__ method to coerce the bytestrings coming from the database
to unicode. Failure to do this results in many problems like what you have
been reporting, as the admin app relies on the model's __unicode__ method to
display/log information about objects.

Karen

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Grigory Fateyev

Hello Fedya!
On Thu, 18 Sep 2008 07:24:16 -0700 (PDT) you wrote:

> 
> Unfortunately I'm dummy in python... so it's twice harder to find the
> reason... But I'm still trying :)
 
Maybe this helps?

# grep -i utf8 /usr/lib/python2.4/site.py
encoding = "utf8" # Default value set by _PyUnicode_Init()

-- 
Всего наилучшего! Григорий
greg [at] anastasia [dot] ru
Письмо отправлено: 2008/09/18 19:04

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya

Unfortunately I'm dummy in python... so it's twice harder to find the
reason... But I'm still trying :)

I wrote very simple view:

def main_menu(request):
html = ''
menu = Item.root('main').children()
for s in menu[0].title:
html = '%s %s' % (html, ord(s))
html = '%s%s' % (menu[0].title, html)
return HttpResponse(html)

And http://test.legalsw.ru/menu/ outputs
АБВ
208 144 208 145 208 146
when my.cnf contains default-character-set = cp1251
and
���
192 193 194
when my.cnf contains default-character-set = utf8

208 144 is 0xd090 which is Cyrillic A code in UTF8
192 is Cyrillic A in CP1251...
"???" is АБВ if browser's character encoding is cp1251

But then if i use python's unicode string, so u'%s%s' instead of
'%s%s', I get :
UnicodeDecodeError at /menu/

'ascii' codec can't decode byte 0xc0 in position 0: ordinal not in
range(128)

Request Method: GET
Request URL:http://test.legalsw.ru/menu/
Exception Type: UnicodeDecodeError
Exception Value:

'ascii' codec can't decode byte 0xc0 in position 0: ordinal not in
range(128)

Exception Location: /home/l/legalswru/test/public_html/menu/views.py
in main_menu, line 11
Python Executable:  /usr/bin/python
Python Version: 2.4.4
Python Path:['/home/l/legalswru/test/public_html', '/home/l/
legalswru/test/public_html', '/usr/lib/python24.zip', '/usr/lib/
python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-
tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/portage/pym', '/usr/
lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/PIL']
Server time:Чет, 18 Сен 2008 09:17:58 -0500

As I understand python supposes that menu[0].title is ASCII string and
tries to convert it to unicode string... I guess the same happens with
admin templates... Do you have any ideas how to solve this? I've tried
to set use_unicode to True, but nothing changed.


On Sep 18, 3:25 pm, Fedya <[EMAIL PROTECTED]> wrote:
> Still something wrong with character set.
>
> When I use Russian characters inside value of a field in one table,
> Django admin interface can't show list of object corresponding to that
> table. Like I'm trying to accesshttp://test.legalsw.ru/admin/menu/item/
> and getting:
> TemplateSyntaxError at /admin/menu/item/
>
> Caught an exception while rendering: 'ascii' codec can't decode byte
> 0xd0 in position 0: ordinal not in range(128). You passed in
> 
> ()
>
> Original Traceback (most recent call last):
>   File "/home/l/legalswru/test/public_html/django/template/debug.py",
> line 71, in render_node
> result = node.render(context)
>   File "/home/l/legalswru/test/public_html/django/template/
> loader_tags.py", line 24, in render
> result = self.nodelist.render(context)
>   File "/home/l/legalswru/test/public_html/django/template/
> __init__.py", line 768, in render
> bits.append(self.render_node(node, context))
>   File "/home/l/legalswru/test/public_html/django/template/debug.py",
> line 78, in render_node
> wrapped = TemplateSyntaxError(u'Caught an exception while
> rendering: %s' % force_unicode(e, errors='replace'))
>   File "/home/l/legalswru/test/public_html/django/utils/encoding.py",
> line 70, in force_unicode
> raise DjangoUnicodeDecodeError(s, *e.args)
> DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in
> position 0: ordinal not in range(128). You passed in
> 
> ()
>
> Request Method: GET
> Request URL:http://test.legalsw.ru/admin/menu/item/
> Exception Type: TemplateSyntaxError
> Exception Value:
>
> Caught an exception while rendering: 'ascii' codec can't decode byte
> 0xd0 in position 0: ordinal not in range(128). You passed in
> 
> ()
>
> Original Traceback (most recent call last):
>   File "/home/l/legalswru/test/public_html/django/template/debug.py",
> line 71, in render_node
> result = node.render(context)
>   File "/home/l/legalswru/test/public_html/django/template/
> loader_tags.py", line 24, in render
> result = self.nodelist.render(context)
>   File "/home/l/legalswru/test/public_html/django/template/
> __init__.py", line 768, in render
> bits.append(self.render_node(node, context))
>   File "/home/l/legalswru/test/public_html/django/template/debug.py",
> line 78, in render_node
> wrapped = TemplateSyntaxError(u'Caught an exception while
> rendering: %s' % force_unicode(e, errors='replace'))
>   File "/home/l/legalswru/test/public_html/django/utils/encoding.py",
> line 70, in force_unicode
> raise DjangoUnicodeDecodeError(s, *e.args)
> DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in
> position 0: ordinal not in range(128). You passed in
> 
> ()
>
> Exception Location: /home/l/legalswru/test/public_html/django/
> template/debug.py in render_node, line 81
> Python Executable:  /usr/bin/python
> Python Version: 2.4.4
> Python Path:['/home/l/legalswru/test/public_html', '/home/l/
> legalswru/test/public_html', '/usr/lib/python24.zip', '/usr/lib/
> python2

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya

Still something wrong with character set.

When I use Russian characters inside value of a field in one table,
Django admin interface can't show list of object corresponding to that
table. Like I'm trying to access http://test.legalsw.ru/admin/menu/item/
and getting:
TemplateSyntaxError at /admin/menu/item/

Caught an exception while rendering: 'ascii' codec can't decode byte
0xd0 in position 0: ordinal not in range(128). You passed in

()

Original Traceback (most recent call last):
  File "/home/l/legalswru/test/public_html/django/template/debug.py",
line 71, in render_node
result = node.render(context)
  File "/home/l/legalswru/test/public_html/django/template/
loader_tags.py", line 24, in render
result = self.nodelist.render(context)
  File "/home/l/legalswru/test/public_html/django/template/
__init__.py", line 768, in render
bits.append(self.render_node(node, context))
  File "/home/l/legalswru/test/public_html/django/template/debug.py",
line 78, in render_node
wrapped = TemplateSyntaxError(u'Caught an exception while
rendering: %s' % force_unicode(e, errors='replace'))
  File "/home/l/legalswru/test/public_html/django/utils/encoding.py",
line 70, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in
position 0: ordinal not in range(128). You passed in

()

Request Method: GET
Request URL:http://test.legalsw.ru/admin/menu/item/
Exception Type: TemplateSyntaxError
Exception Value:

Caught an exception while rendering: 'ascii' codec can't decode byte
0xd0 in position 0: ordinal not in range(128). You passed in

()

Original Traceback (most recent call last):
  File "/home/l/legalswru/test/public_html/django/template/debug.py",
line 71, in render_node
result = node.render(context)
  File "/home/l/legalswru/test/public_html/django/template/
loader_tags.py", line 24, in render
result = self.nodelist.render(context)
  File "/home/l/legalswru/test/public_html/django/template/
__init__.py", line 768, in render
bits.append(self.render_node(node, context))
  File "/home/l/legalswru/test/public_html/django/template/debug.py",
line 78, in render_node
wrapped = TemplateSyntaxError(u'Caught an exception while
rendering: %s' % force_unicode(e, errors='replace'))
  File "/home/l/legalswru/test/public_html/django/utils/encoding.py",
line 70, in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in
position 0: ordinal not in range(128). You passed in

()

Exception Location: /home/l/legalswru/test/public_html/django/
template/debug.py in render_node, line 81
Python Executable:  /usr/bin/python
Python Version: 2.4.4
Python Path:['/home/l/legalswru/test/public_html', '/home/l/
legalswru/test/public_html', '/usr/lib/python24.zip', '/usr/lib/
python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-
tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/portage/pym', '/usr/
lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/PIL']
Server time:Чет, 18 Сен 2008 07:10:34 -0500

I understand that this is most probably misconfiguration of mysql, but
I've tried a lot of different configurations using init_command,
charset, use_unicode and read_default_file parameters... I've also
tried to reconfigure database to use cp1251 charset, because this is
default encoding for mysql server, but without positive effect... The
only difference I can see is a modification of the byte which is 0xd0
in above error report.

Sorry for my bad English, but I really need any fresh ideas!

On Sep 18, 12:29 pm, Fedya <[EMAIL PROTECTED]> wrote:
> hm... I've tried with very simple model from the scratch and I got the
> same problem without init_command...
>
> On Sep 18, 2:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Thu, 2008-09-18 at 01:57 +0300, Fedor Tyurin wrote:
> > > Another possible solution (and probably better one) is to use
> > > init_command option set to 'SET NAMES utf8'.
>
> > Django and MySQLdb already do this by default. Django passes the
> > "charset='utf-8'" parameter to the connection and MySQLdb turns this
> > into a "SET NAMES" call. So you're doing something unusual if this isn't
> > working by default.
>
> > Regards,
> > Malcolm
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya

hm... I've tried with very simple model from the scratch and I got the
same problem without init_command...

On Sep 18, 2:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2008-09-18 at 01:57 +0300, Fedor Tyurin wrote:
> > Another possible solution (and probably better one) is to use
> > init_command option set to 'SET NAMES utf8'.
>
> Django and MySQLdb already do this by default. Django passes the
> "charset='utf-8'" parameter to the connection and MySQLdb turns this
> into a "SET NAMES" call. So you're doing something unusual if this isn't
> working by default.
>
> Regards,
> Malcolm
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Malcolm Tredinnick


On Thu, 2008-09-18 at 01:57 +0300, Fedor Tyurin wrote:
> Another possible solution (and probably better one) is to use
> init_command option set to 'SET NAMES utf8'.

Django and MySQLdb already do this by default. Django passes the
"charset='utf-8'" parameter to the connection and MySQLdb turns this
into a "SET NAMES" call. So you're doing something unusual if this isn't
working by default.

Regards,
Malcolm

> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
Another possible solution (and probably better one) is to use init_command
option set to 'SET NAMES utf8'.

2008/9/18 Fedor Tyurin <[EMAIL PROTECTED]>

> I set default-character-set to cp1251 (default server encoding) and now
> admin seems to work correctly
>
> 2008/9/18 Fedor Tyurin <[EMAIL PROTECTED]>
>
> It seems to be related with database connection properties. I've tried with
>> sqlite3 and problem disappeared.
>>
>> If I run mysql console and request status (\s command) mysql response the
>> following information about character set:
>> Server characterset:cp1251
>> Db characterset:utf8
>> Client characterset:cp1251
>> Conn.  characterset:cp1251
>>
>> I've also tried to set DATABASE_OPTIONS, but I don't know how to change
>> connection and results character set from configuration file (only by using
>> SET NAMES 'utf8').
>>
>> Any help will be useful. Unfortunately I can't change mysqld settings,
>> because it is on the web hosting provider's side.
>>
>> 2008/9/17 Fedya <[EMAIL PROTECTED]>
>>
>> Hi everybody,
>>>
>>> I'm trying to port my site to Django 1.0... And it works fine if
>>> LANGUAGE_CODE is set to en-us, but if I set it to ru the following
>>> problem appears while I'm trying add new object using admin interface:
>>>
>>> Warning at /admin/storage/file/add/
>>>
>>> Data truncated for column 'message' at row 1
>>>
>>> Request Method: POST
>>> Request URL:http://test.legalsw.ru/admin/storage/file/add/
>>> Exception Type: Warning
>>> Exception Value:
>>>
>>> Data truncated for column 'message' at row 1
>>>
>>> Exception Location: /usr/lib/python2.4/warnings.py in warn_explicit,
>>> line 96
>>> Python Executable:  /usr/bin/python
>>> Python Version: 2.4.4
>>> Python Path:['/home/l/legalswru/test/public_html', '/home/l/
>>> legalswru/test/public_html', '/usr/lib/python24.zip', '/usr/lib/
>>> python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-
>>> tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/portage/pym', '/usr/
>>> lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/PIL']
>>> Server time:Ср, 17 Сен 2008 14:56:13 -0500
>>>
>>> I'm using MySQL database and it configured to use UTF8_BIN collation.
>>>
>>
>>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
I set default-character-set to cp1251 (default server encoding) and now
admin seems to work correctly

2008/9/18 Fedor Tyurin <[EMAIL PROTECTED]>

> It seems to be related with database connection properties. I've tried with
> sqlite3 and problem disappeared.
>
> If I run mysql console and request status (\s command) mysql response the
> following information about character set:
> Server characterset:cp1251
> Db characterset:utf8
> Client characterset:cp1251
> Conn.  characterset:cp1251
>
> I've also tried to set DATABASE_OPTIONS, but I don't know how to change
> connection and results character set from configuration file (only by using
> SET NAMES 'utf8').
>
> Any help will be useful. Unfortunately I can't change mysqld settings,
> because it is on the web hosting provider's side.
>
> 2008/9/17 Fedya <[EMAIL PROTECTED]>
>
> Hi everybody,
>>
>> I'm trying to port my site to Django 1.0... And it works fine if
>> LANGUAGE_CODE is set to en-us, but if I set it to ru the following
>> problem appears while I'm trying add new object using admin interface:
>>
>> Warning at /admin/storage/file/add/
>>
>> Data truncated for column 'message' at row 1
>>
>> Request Method: POST
>> Request URL:http://test.legalsw.ru/admin/storage/file/add/
>> Exception Type: Warning
>> Exception Value:
>>
>> Data truncated for column 'message' at row 1
>>
>> Exception Location: /usr/lib/python2.4/warnings.py in warn_explicit,
>> line 96
>> Python Executable:  /usr/bin/python
>> Python Version: 2.4.4
>> Python Path:['/home/l/legalswru/test/public_html', '/home/l/
>> legalswru/test/public_html', '/usr/lib/python24.zip', '/usr/lib/
>> python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-
>> tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/portage/pym', '/usr/
>> lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/PIL']
>> Server time:Ср, 17 Сен 2008 14:56:13 -0500
>>
>> I'm using MySQL database and it configured to use UTF8_BIN collation.
>>
>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
It seems to be related with database connection properties. I've tried with
sqlite3 and problem disappeared.

If I run mysql console and request status (\s command) mysql response the
following information about character set:
Server characterset:cp1251
Db characterset:utf8
Client characterset:cp1251
Conn.  characterset:cp1251

I've also tried to set DATABASE_OPTIONS, but I don't know how to change
connection and results character set from configuration file (only by using
SET NAMES 'utf8').

Any help will be useful. Unfortunately I can't change mysqld settings,
because it is on the web hosting provider's side.

2008/9/17 Fedya <[EMAIL PROTECTED]>

> Hi everybody,
>
> I'm trying to port my site to Django 1.0... And it works fine if
> LANGUAGE_CODE is set to en-us, but if I set it to ru the following
> problem appears while I'm trying add new object using admin interface:
>
> Warning at /admin/storage/file/add/
>
> Data truncated for column 'message' at row 1
>
> Request Method: POST
> Request URL:http://test.legalsw.ru/admin/storage/file/add/
> Exception Type: Warning
> Exception Value:
>
> Data truncated for column 'message' at row 1
>
> Exception Location: /usr/lib/python2.4/warnings.py in warn_explicit,
> line 96
> Python Executable:  /usr/bin/python
> Python Version: 2.4.4
> Python Path:['/home/l/legalswru/test/public_html', '/home/l/
> legalswru/test/public_html', '/usr/lib/python24.zip', '/usr/lib/
> python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-
> tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/portage/pym', '/usr/
> lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/PIL']
> Server time:Ср, 17 Сен 2008 14:56:13 -0500
>
> I'm using MySQL database and it configured to use UTF8_BIN collation.
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with django unit testing

2008-03-31 Thread [EMAIL PROTECTED]

Firstly, thanks for your suggestions!

I change the apps and class name then turn on the verbosity mode to
test, but I can't see nothing abnormal output.
Today I run the same unit test of this project on another computer and
they all passed, so I think there are some problem with my development
environment, I'll try to find them.

On Mar 30, 8:03 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On Sat, Mar 29, 2008 at 11:00 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > but when I run unit test to test the failed function use:
> >  $ ./manage.py test apps.test.test_template
> > there will be ok:
> > """
> > .
> > --
> > Ran 1 test in 1.336s
>
> I can't say I've seen this myself. One immediate cause for concern is
> your app and testcase naming - apps and test are names prone to
> clashing with other modules. Try renaming the app and test case to be
> "myapp" and "MyTest" and see if that makes a difference.
>
> Other than that, my only suggestion would be that the successes and
> failures that are being reported aren't actually for the same tests.
> Try turning up verbosity on the test run; this will tell you
> explicitly which tests are succeeding or failing. You may find that
> the test that is being executed isn't the same in each case.
>
> If neither of these suggestions help, I would suggest opening a ticket
> so that this issue isn't forgotten.
>
> Yours,
> Russ Magee %-)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with django unit testing

2008-03-30 Thread Russell Keith-Magee

On Sat, Mar 29, 2008 at 11:00 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> but when I run unit test to test the failed function use:
>  $ ./manage.py test apps.test.test_template
> there will be ok:
> """
> .
> --
> Ran 1 test in 1.336s

I can't say I've seen this myself. One immediate cause for concern is
your app and testcase naming - apps and test are names prone to
clashing with other modules. Try renaming the app and test case to be
"myapp" and "MyTest" and see if that makes a difference.

Other than that, my only suggestion would be that the successes and
failures that are being reported aren't actually for the same tests.
Try turning up verbosity on the test run; this will tell you
explicitly which tests are succeeding or failing. You may find that
the test that is being executed isn't the same in each case.

If neither of these suggestions help, I would suggest opening a ticket
so that this issue isn't forgotten.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with django unit testing

2008-03-30 Thread Kenneth Gonsalves


On 30-Mar-08, at 1:31 PM, [EMAIL PROTECTED] wrote:

> Any one who can help me? Thank you so much!

be patient - it is a weekend ;-)

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/code/




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with django unit testing

2008-03-30 Thread [EMAIL PROTECTED]

Any one who can help me? Thank you so much!

On Mar 29, 11:00 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi, all,
>
> I meet a strangely problem on django unittesting. I use django svn
> version, the test code like this:
>
> """
> from django.test import TestCase
> ...
>
> class test(TestCase):
>   ...
>   def setUp(self):
>     ...
>
>   def test_template(self):
>     # Test Templates for register
>     response = self.client.get('/accounts/register/')
>     self.assertTemplateUsed(response, "account/register.html")
>     ...
> """
>
> When I run unit test to test the class use:
>   $ ./manage.py test apps.test
>
> I'll get a failed info:
> """
> F
> ==
> FAIL:  test_template(apps.tests)
> --
> Traceback (most recent call last):
>   File ".../apps/tests.py", line 486, in test_template
>     self.assertTemplateUsed(response, "account/register.html")
>   File ".../django/test/testcases.py", line 185, in assertTemplateUsed
>     self.fail('No templates used to render the response')
> AssertionError: No templates used to render the response
> """
>
> but when I run unit test to test the failed function use:
>   $ ./manage.py test apps.test.test_template
> there will be ok:
> """
> .
> --
> Ran 1 test in 1.336s
>
> OK
> """
>
> and I use "print respone.context" to see the template context of
> response,
> when I test the class, it won't get nothing(the value of
> respone.context is "None"), while I test the funtion, it will get a
> correct value...
>
> Any one can tell me that's why? Thank you so much!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django tagging application

2008-02-21 Thread Malcolm Tredinnick


On Thu, 2008-02-21 at 01:55 -0800, cesco wrote:
> Hi
> 
> > So the SQL that is being constructed by the joined queryset isn't valid.
> > I'm almost certain the answer to this is "it's fixed in
> > queryset-refactor, so will one day be fixed in trunk."
> 
> Thanks for the work you are doing:-)
> 
> > Pull the results back into Python and merge them manually.
> 
> Could I ask you to be a bit more specific (not so experienced with
> python and django)?
> You mean I should take the two query sets separately and merge them
> based on the id of the objects in each of the querysets?

That's probably the right thing. It depends on what "&" is meant to be
doing here. I don't know what is in those two querysets, since I've
never used django-tagging, but I would guess you're trying to find
instances that are in both querysets when you "&" them together. If so,
then checking the id attribute will tell if you two instances are the
same.

Malcolm

-- 
Why can't you be a non-conformist like everyone else? 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django tagging application

2008-02-21 Thread Francesco Davide Calabrese
See the changes listed here:
http://code.google.com/p/django-tagging/wiki/BackwardsIncompatibleChanges
you may be able to give directly the queryset rather than the model

On Thu, Feb 21, 2008 at 1:25 AM, cesco <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm using the latest version of the django tagging application (rev.
> 132) and I'm having problems with the get_by_model method of the
> TaggedItem manager.
>
> Say I have a QuerySet1 generated as follow:
> QuerySet1 = TaggedItem.objects.get_by_model(MyModel, 'tag1')
> and a QuerySet2 generated as follow:
> QuerySet2 = TaggedItem.objects.get_by_model(MyModel, 'tag2')
>
> If at this point I try to '&' the two query sets as in:
> QuerySet3 = QuerySet1 & QuerySet2
> then I get the following error:
> "ambiguous column name: tagging_taggeditem.object_id"
>
> Do you have any idea of why I'm getting this error and how I could
> solve the problem?
> For completeness in dpaste is the complete traceback I get:
> http://dpaste.com/36177/
>
> Any help would be very appreciated.
>
> Thanks
> Francesco
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django tagging application

2008-02-21 Thread cesco

Hi,

> Any chance you were using django-tagging previously and recently
> updated to trunk?  There are backwards incompatible changes - the
> relation names have 
> changed:http://code.google.com/p/django-tagging/wiki/BackwardsIncompatibleCha...

I was actually getting the same error before and after the updates.

Thanks anyway
Francesco
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django tagging application

2008-02-21 Thread cesco

Hi

> So the SQL that is being constructed by the joined queryset isn't valid.
> I'm almost certain the answer to this is "it's fixed in
> queryset-refactor, so will one day be fixed in trunk."

Thanks for the work you are doing:-)

> Pull the results back into Python and merge them manually.

Could I ask you to be a bit more specific (not so experienced with
python and django)?
You mean I should take the two query sets separately and merge them
based on the id of the objects in each of the querysets?

Thanks again
Francesco
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django tagging application

2008-02-20 Thread Brian Luft

Any chance you were using django-tagging previously and recently
updated to trunk?  There are backwards incompatible changes - the
relation names have changed:
http://code.google.com/p/django-tagging/wiki/BackwardsIncompatibleChanges

-Brian

On Feb 20, 4:25 pm, cesco <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using the latest version of the django tagging application (rev.
> 132) and I'm having problems with the get_by_model method of the
> TaggedItem manager.
>
> Say I have a QuerySet1 generated as follow:
> QuerySet1 = TaggedItem.objects.get_by_model(MyModel, 'tag1')
> and a QuerySet2 generated as follow:
> QuerySet2 = TaggedItem.objects.get_by_model(MyModel, 'tag2')
>
> If at this point I try to '&' the two query sets as in:
> QuerySet3 = QuerySet1 & QuerySet2
> then I get the following error:
> "ambiguous column name: tagging_taggeditem.object_id"
>
> Do you have any idea of why I'm getting this error and how I could
> solve the problem?
> For completeness in dpaste is the complete traceback I 
> get:http://dpaste.com/36177/
>
> Any help would be very appreciated.
>
> Thanks
> Francesco
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django tagging application

2008-02-20 Thread Malcolm Tredinnick


On Wed, 2008-02-20 at 16:25 -0800, cesco wrote:
> Hi,
> 
> I'm using the latest version of the django tagging application (rev.
> 132) and I'm having problems with the get_by_model method of the
> TaggedItem manager.
> 
> Say I have a QuerySet1 generated as follow:
> QuerySet1 = TaggedItem.objects.get_by_model(MyModel, 'tag1')
> and a QuerySet2 generated as follow:
> QuerySet2 = TaggedItem.objects.get_by_model(MyModel, 'tag2')
> 
> If at this point I try to '&' the two query sets as in:
> QuerySet3 = QuerySet1 & QuerySet2
> then I get the following error:
> "ambiguous column name: tagging_taggeditem.object_id"

So the SQL that is being constructed by the joined queryset isn't valid.
I'm almost certain the answer to this is "it's fixed in
queryset-refactor, so will one day be fixed in trunk."

> Do you have any idea of why I'm getting this error and how I could
> solve the problem?

Pull the results back into Python and merge them manually.

Malcolm

-- 
If it walks out of your refrigerator, LET IT GO!! 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Rocco Pellegrini

this exactly solve the problem:
1) drop from the database the table django_content_type.
2) run python manage.py syncdb to recreate the table.

On Jan 14, 9:44 pm, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> Thanks to all.
> I dropped tha table django_content_type and all worked wery well.
>
> On Jan 14, 8:53 pm, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > no home1 in blog.urls
> > I searched in the net for the problem and I founded in this 
> > forumhttp://www.nabble.com/Error-message-when-viewing-admin--%28ViewDoesNo...
> > an answer:
> > """Did you have a view named "startsess" that you subsequently
> > deleted?
> > Admin is looking for it but not finding it.  You may need to remove it
> > from django_content_type.  Try dropping that table from your database
> > and running python manage.py syncdb. """
> > What do you think about?
>
> > On Jan 14, 8:30 pm, "David Grant" <[EMAIL PROTECTED]> wrote:
>
> > > Look in prog_innov.blog.urls too
>
> > > 2008/1/14 Rocco Pellegrini <[EMAIL PROTECTED]>:
>
> > > > urlpatterns = patterns('',
> > > ># Example:
> > > ># (r'^prog_innov/', include('prog_innov.apps.foo.urls.foo')),
>
> > > ># Uncomment this for admin:
> > > >(r'^admin/', include('django.contrib.admin.urls')),
> > > >(r'^blog/', include('prog_innov.blog.urls')),
> > > >(r'^editoriali/', include('prog_innov.editoriali.urls')),
> > > >(r'^comments/', include('django.contrib.comments.urls.comments')),
> > > >(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed',
> > > > {'feed_dict': feeds}),
>
> > > > On Jan 14, 4:23 pm, Grindizer <[EMAIL PROTECTED]> wrote:
> > > > > what do you have in your urls.py ?
>
> > > > > On 14 jan, 15:57, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > > > > I removed it but the response was the same.
> > > > > > ???
> > > > > > Request Method: GET
> > > > > > Request URL:http://innovatorieuropei.com/admin/
> > > > > > Exception Type: ViewDoesNotExist
> > > > > > Exception Value:Tried home1 in module prog_innov.views. 
> > > > > > Error
> > > > was:
> > > > > > 'module' object has no attribute 'home1'
> > > > > > I dont' undestand this expression
>
> > > > > > On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > > > > > > It is a solution.
>
> > > > > > > """
> > > > > > > Tried home1 in module prog_innov.views. Error was: 'module' object
> > > > has
> > > > > > > no attribute 'home1'
> > > > > > > """
>
> > > > > > > Uncomment it or remove this view from urls.py
>
> > > > > > > On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > yes
>
> > > > > > > > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > #def home1(request)
> > > > > > > > > > #   return HttpResponseRedirect('
> > > >http://www.innovatorieuropei.com/
>
> > > > > > > > > are this lines commented in you code ?
>
> > > --
> > > David Granthttp://www.davidgrant.ca
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Rocco Pellegrini

Thanks to all.
I dropped tha table django_content_type and all worked wery well.


On Jan 14, 8:53 pm, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> no home1 in blog.urls
> I searched in the net for the problem and I founded in this 
> forumhttp://www.nabble.com/Error-message-when-viewing-admin--%28ViewDoesNo...
> an answer:
> """Did you have a view named "startsess" that you subsequently
> deleted?
> Admin is looking for it but not finding it.  You may need to remove it
> from django_content_type.  Try dropping that table from your database
> and running python manage.py syncdb. """
> What do you think about?
>
> On Jan 14, 8:30 pm, "David Grant" <[EMAIL PROTECTED]> wrote:
>
> > Look in prog_innov.blog.urls too
>
> > 2008/1/14 Rocco Pellegrini <[EMAIL PROTECTED]>:
>
> > > urlpatterns = patterns('',
> > ># Example:
> > ># (r'^prog_innov/', include('prog_innov.apps.foo.urls.foo')),
>
> > ># Uncomment this for admin:
> > >(r'^admin/', include('django.contrib.admin.urls')),
> > >(r'^blog/', include('prog_innov.blog.urls')),
> > >(r'^editoriali/', include('prog_innov.editoriali.urls')),
> > >(r'^comments/', include('django.contrib.comments.urls.comments')),
> > >(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed',
> > > {'feed_dict': feeds}),
>
> > > On Jan 14, 4:23 pm, Grindizer <[EMAIL PROTECTED]> wrote:
> > > > what do you have in your urls.py ?
>
> > > > On 14 jan, 15:57, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > > > I removed it but the response was the same.
> > > > > ???
> > > > > Request Method: GET
> > > > > Request URL:http://innovatorieuropei.com/admin/
> > > > > Exception Type: ViewDoesNotExist
> > > > > Exception Value:Tried home1 in module prog_innov.views. Error
> > > was:
> > > > > 'module' object has no attribute 'home1'
> > > > > I dont' undestand this expression
>
> > > > > On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > > > > > It is a solution.
>
> > > > > > """
> > > > > > Tried home1 in module prog_innov.views. Error was: 'module' object
> > > has
> > > > > > no attribute 'home1'
> > > > > > """
>
> > > > > > Uncomment it or remove this view from urls.py
>
> > > > > > On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > > > > > yes
>
> > > > > > > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > #def home1(request)
> > > > > > > > > #   return HttpResponseRedirect('
> > >http://www.innovatorieuropei.com/
>
> > > > > > > > are this lines commented in you code ?
>
> > --
> > David Granthttp://www.davidgrant.ca
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Rocco Pellegrini

no home1 in blog.urls
I searched in the net for the problem and I founded in this forum
http://www.nabble.com/Error-message-when-viewing-admin--%28ViewDoesNotExist-at--admin-%29-to13022675.html
an answer:
"""Did you have a view named "startsess" that you subsequently
deleted?
Admin is looking for it but not finding it.  You may need to remove it
from django_content_type.  Try dropping that table from your database
and running python manage.py syncdb. """
What do you think about?

On Jan 14, 8:30 pm, "David Grant" <[EMAIL PROTECTED]> wrote:
> Look in prog_innov.blog.urls too
>
> 2008/1/14 Rocco Pellegrini <[EMAIL PROTECTED]>:
>
>
>
>
>
> > urlpatterns = patterns('',
> ># Example:
> ># (r'^prog_innov/', include('prog_innov.apps.foo.urls.foo')),
>
> ># Uncomment this for admin:
> >(r'^admin/', include('django.contrib.admin.urls')),
> >(r'^blog/', include('prog_innov.blog.urls')),
> >(r'^editoriali/', include('prog_innov.editoriali.urls')),
> >(r'^comments/', include('django.contrib.comments.urls.comments')),
> >(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed',
> > {'feed_dict': feeds}),
>
> > On Jan 14, 4:23 pm, Grindizer <[EMAIL PROTECTED]> wrote:
> > > what do you have in your urls.py ?
>
> > > On 14 jan, 15:57, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > > I removed it but the response was the same.
> > > > ???
> > > > Request Method: GET
> > > > Request URL:http://innovatorieuropei.com/admin/
> > > > Exception Type: ViewDoesNotExist
> > > > Exception Value:Tried home1 in module prog_innov.views. Error
> > was:
> > > > 'module' object has no attribute 'home1'
> > > > I dont' undestand this expression
>
> > > > On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > > > > It is a solution.
>
> > > > > """
> > > > > Tried home1 in module prog_innov.views. Error was: 'module' object
> > has
> > > > > no attribute 'home1'
> > > > > """
>
> > > > > Uncomment it or remove this view from urls.py
>
> > > > > On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > > > > yes
>
> > > > > > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > #def home1(request)
> > > > > > > > #   return HttpResponseRedirect('
> >http://www.innovatorieuropei.com/
>
> > > > > > > are this lines commented in you code ?
>
> --
> David Granthttp://www.davidgrant.ca
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread David Grant
Look in prog_innov.blog.urls too

2008/1/14 Rocco Pellegrini <[EMAIL PROTECTED]>:

>
> urlpatterns = patterns('',
># Example:
># (r'^prog_innov/', include('prog_innov.apps.foo.urls.foo')),
>
># Uncomment this for admin:
>(r'^admin/', include('django.contrib.admin.urls')),
>(r'^blog/', include('prog_innov.blog.urls')),
>(r'^editoriali/', include('prog_innov.editoriali.urls')),
>(r'^comments/', include('django.contrib.comments.urls.comments')),
>(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed',
> {'feed_dict': feeds}),
>
> On Jan 14, 4:23 pm, Grindizer <[EMAIL PROTECTED]> wrote:
> > what do you have in your urls.py ?
> >
> > On 14 jan, 15:57, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> >
> > > I removed it but the response was the same.
> > > ???
> > > Request Method: GET
> > > Request URL:http://innovatorieuropei.com/admin/
> > > Exception Type: ViewDoesNotExist
> > > Exception Value:Tried home1 in module prog_innov.views. Error
> was:
> > > 'module' object has no attribute 'home1'
> > > I dont' undestand this expression
> >
> > > On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> >
> > > > It is a solution.
> >
> > > > """
> > > > Tried home1 in module prog_innov.views. Error was: 'module' object
> has
> > > > no attribute 'home1'
> > > > """
> >
> > > > Uncomment it or remove this view from urls.py
> >
> > > > On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> >
> > > > > yes
> >
> > > > > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > #def home1(request)
> > > > > > > #   return HttpResponseRedirect('
> http://www.innovatorieuropei.com/
> >
> > > > > > are this lines commented in you code ?
> >
>


-- 
David Grant
http://www.davidgrant.ca

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Rocco Pellegrini

urlpatterns = patterns('',
# Example:
# (r'^prog_innov/', include('prog_innov.apps.foo.urls.foo')),

# Uncomment this for admin:
(r'^admin/', include('django.contrib.admin.urls')),
(r'^blog/', include('prog_innov.blog.urls')),
(r'^editoriali/', include('prog_innov.editoriali.urls')),
(r'^comments/', include('django.contrib.comments.urls.comments')),
(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed',
{'feed_dict': feeds}),

On Jan 14, 4:23 pm, Grindizer <[EMAIL PROTECTED]> wrote:
> what do you have in your urls.py ?
>
> On 14 jan, 15:57, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > I removed it but the response was the same.
> > ???
> > Request Method: GET
> > Request URL:http://innovatorieuropei.com/admin/
> > Exception Type: ViewDoesNotExist
> > Exception Value:Tried home1 in module prog_innov.views. Error was:
> > 'module' object has no attribute 'home1'
> > I dont' undestand this expression
>
> > On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > > It is a solution.
>
> > > """
> > > Tried home1 in module prog_innov.views. Error was: 'module' object has
> > > no attribute 'home1'
> > > """
>
> > > Uncomment it or remove this view from urls.py
>
> > > On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > > yes
>
> > > > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > > > > #def home1(request)
> > > > > > #   return HttpResponseRedirect('http://www.innovatorieuropei.com/
>
> > > > > are this lines commented in you code ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Grindizer

what do you have in your urls.py ?

On 14 jan, 15:57, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> I removed it but the response was the same.
> ???
> Request Method: GET
> Request URL:http://innovatorieuropei.com/admin/
> Exception Type: ViewDoesNotExist
> Exception Value:Tried home1 in module prog_innov.views. Error was:
> 'module' object has no attribute 'home1'
> I dont' undestand this expression
>
> On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > It is a solution.
>
> > """
> > Tried home1 in module prog_innov.views. Error was: 'module' object has
> > no attribute 'home1'
> > """
>
> > Uncomment it or remove this view from urls.py
>
> > On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > yes
>
> > > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > > > #def home1(request)
> > > > > #   return HttpResponseRedirect('http://www.innovatorieuropei.com/
>
> > > > are this lines commented in you code ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Alex Koshelev

It means that you haven't delete all references to this commented
view.

On 14 янв, 17:57, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> I removed it but the response was the same.
> ???
> Request Method: GET
> Request URL:http://innovatorieuropei.com/admin/
> Exception Type: ViewDoesNotExist
> Exception Value:Tried home1 in module prog_innov.views. Error was:
> 'module' object has no attribute 'home1'
> I dont' undestand this expression
>
> On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > It is a solution.
>
> > """
> > Tried home1 in module prog_innov.views. Error was: 'module' object has
> > no attribute 'home1'
> > """
>
> > Uncomment it or remove this view from urls.py
>
> > On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > yes
>
> > > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > > > #def home1(request)
> > > > > #   return HttpResponseRedirect('http://www.innovatorieuropei.com/
>
> > > > are this lines commented in you code ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Rocco Pellegrini

I removed it but the response was the same.
???
Request Method: GET
Request URL:http://innovatorieuropei.com/admin/
Exception Type: ViewDoesNotExist
Exception Value:Tried home1 in module prog_innov.views. Error was:
'module' object has no attribute 'home1'
I dont' undestand this expression


On Jan 14, 3:47 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> It is a solution.
>
> """
> Tried home1 in module prog_innov.views. Error was: 'module' object has
> no attribute 'home1'
> """
>
> Uncomment it or remove this view from urls.py
>
> On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > yes
>
> > On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > > #def home1(request)
> > > > #   return HttpResponseRedirect('http://www.innovatorieuropei.com/
>
> > > are this lines commented in you code ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Alex Koshelev

It is a solution.

"""
Tried home1 in module prog_innov.views. Error was: 'module' object has
no attribute 'home1'
"""

Uncomment it or remove this view from urls.py

On 14 янв, 17:29, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> yes
>
> On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
>
> > > #def home1(request)
> > > #   return HttpResponseRedirect('http://www.innovatorieuropei.com/
>
> > are this lines commented in you code ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Rocco Pellegrini

yes

On Jan 14, 3:22 pm, Grindizer <[EMAIL PROTECTED]> wrote:
> > #def home1(request)
> > #   return HttpResponseRedirect('http://www.innovatorieuropei.com/
>
> are this lines commented in you code ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Alex Koshelev

Error is still in you code. May be you(django when imports modules and
parses the urls.py files) try to import name that doesn't exists.
Check urls.py and models.py files.

On 14 янв, 16:35, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> Alex hi,
> no error in my code.
> I followed the instructions from documentation and home1 code is
> another thing.
> This is the code:
> #def home1(request)
> #   return HttpResponseRedirect('http://www.innovatorieuropei.com/
> editoriali/')
> in my views.py in the root site.
>
> In the documentation there is no code in views.py for activating the
> admin interface.
> There is 1 instruction in urls.py (r'^admin/',
> include('django.contrib.admin.urls')), and another in settings.py :
> adding 'django.contrib.admin', in INSTALLED_APPS.
> So, why this exception's message?
> I don't understand.
> Thanks for the attention
>
> On Jan 14, 2:16 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > Error is in your code. Read the exception's message.
>
> > On 14 янв, 16:06, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > > Before admin worked well. Now with development version this is the
> > > result:
> > > ViewDoesNotExist at /admin/
> > > Tried home1 in module prog_innov.views. Error was: 'module' object has
> > > no attribute 'home1'
> > > Why?
> > > Of course I have seen all post around the same problem but I don't
> > > understand.
> > > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Re: problem with django admin after update to development version

2008-01-14 Thread patrick . o

I am on a client site on the 11th Jan. I shall respond to your email on my 
return. 

Many thanks

Patrick O'Connor





--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Grindizer



> #def home1(request)
> #   return HttpResponseRedirect('http://www.innovatorieuropei.com/

are this lines commented in you code ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Rocco Pellegrini

Alex hi,
no error in my code.
I followed the instructions from documentation and home1 code is
another thing.
This is the code:
#def home1(request)
#   return HttpResponseRedirect('http://www.innovatorieuropei.com/
editoriali/')
in my views.py in the root site.

In the documentation there is no code in views.py for activating the
admin interface.
There is 1 instruction in urls.py (r'^admin/',
include('django.contrib.admin.urls')), and another in settings.py :
adding 'django.contrib.admin', in INSTALLED_APPS.
So, why this exception's message?
I don't understand.
Thanks for the attention


On Jan 14, 2:16 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> Error is in your code. Read the exception's message.
>
> On 14 янв, 16:06, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
>
> > Before admin worked well. Now with development version this is the
> > result:
> > ViewDoesNotExist at /admin/
> > Tried home1 in module prog_innov.views. Error was: 'module' object has
> > no attribute 'home1'
> > Why?
> > Of course I have seen all post around the same problem but I don't
> > understand.
> > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with django admin after update to development version

2008-01-14 Thread Alex Koshelev

Error is in your code. Read the exception's message.

On 14 янв, 16:06, Rocco Pellegrini <[EMAIL PROTECTED]> wrote:
> Before admin worked well. Now with development version this is the
> result:
> ViewDoesNotExist at /admin/
> Tried home1 in module prog_innov.views. Error was: 'module' object has
> no attribute 'home1'
> Why?
> Of course I have seen all post around the same problem but I don't
> understand.
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with Django

2007-11-08 Thread Graham Dumpleton

On Nov 8, 7:20 pm, stranger <[EMAIL PROTECTED]> wrote:
> God.. How stupid I am ? Everytime I encounter you I am safe. thanks a
> lot I am getting the page.
> So how to make apache server media files?
>
> In httpd.conf I added the Location directive to the project directory
> is it enough...

No it isn't. You need to map the media directory as well. Easiest
thing to do is:

  # Disable mod_python for /media and stuff below it.

  
  SetHandler None
  

  # Map /media to where media files are stored.

  Alias /media /usr/lib/python2.5/site-packages/django/contrib/admin/
media

  # Tell Apache it is allowed to serve files from where media files
are stored.

  
  Order allow,deny
  Allow form all
  

Check that ADMIN_MEDIA_PREFIX is set to '/media/' in settings.py file.

Restart Apache.

Graham

> On Nov 8, 12:16 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On Nov 8, 7:13 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > Ya mapper is an application in crimemap project. There is an empty
> > > __init.py__ file.
> > > Currenly this is the only url i am using..
>
> > > (r'^crime/([a-zA-Z]+)', crimemap.mapper.views.crime_by_type),
>
> > Put quotes around the second value in the tuple:
>
> > (r'^crime/([a-zA-Z]+)', 'crimemap.mapper.views.crime_by_type'),
>
> > >http://localhost:8000/crime/arson
>
> > > should yield me the resulting view but i am getting an error I
> > > mentioned above
>
> > > On. Nov 8, 12:08 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Are you saying the directory hierarchy is:
>
> > > >   /home/priya/projects/crimemap
> > > >   /home/priya/projects/crimemap/mapper
>
> > > > What is the full contents of urls.py?
>
> > > > If 'mapper' is a subdirectory of 'crimemap', does that directory
> > > > contain at least an empty __init__.py file?
>
> > > > Graham
>
> > > > On Nov 8, 7:02 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello Graham,
>
> > > > >  I tried the method u told me...But still the same result. Let
> > > > > me clear a few things. I created a new project "crimemap" in /home/
> > > > > priya/projects/
> > > > > and app "mapper" inside crimemap. Now I am getting an error when i run
> > > > > the server. python manage.py runserver
>
> > > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is not
> > > > > defined
> > > > > Request Method: GET
> > > > > Request URL:http://localhost:8000/
> > > > > Exception Type: ImproperlyConfigured
> > > > > Exception Value:Error while importing URLconf 
> > > > > 'crimemap.urls': name
> > > > > 'crimemap' is not defined
> > > > > Exception Location: /usr/lib/python2.5/site-packages/django/core/
> > > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > > Python Executable:  /usr/bin/python
> > > > > Python Version: 2.5.0
>
> > > > > On Nov 7, 11:38 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > > wrote:
>
> > > > > > Check the file and directory permissions like suggested when you 
> > > > > > were
> > > > > > first trying to setup your site, this time looking at any new files
> > > > > > and directories you have added within your site area. They should 
> > > > > > have
> > > > > > permissions so they are readable to Apache.
>
> > > > > > Graham
>
> > > > > > On Nov 8, 6:32 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hello,
> > > > > > >  I did the linking as you said:
> > > > > > > ln -s /home/priya/projects/crimemap 
> > > > > > > /usr/lib/python2.5/site-packages/
> > > > > > > crimemap
>
> > > > > > > Also I restarted Apache, but nno change
>
> > > > > > > ImproperlyConfigured at /crime/arson/
> > > > > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is 
> > > > > > > not
> > > > > > > defined
> > > > > > > Request Method: GET
> > > > > > > Request URL:http://localhost:8000/crime/arson/
> > > > > > > Exception Type: ImproperlyConfigured
> > > > > > > Exception Value:Error while importing URLconf 
> > > > > > > 'crimemap.urls': name
> > > > > > > 'crimemap' is not defined
> > > > > > > Exception Location: 
> > > > > > > /usr/lib/python2.5/site-packages/django/core/
> > > > > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > > > > Python Executable:  /usr/bin/python
> > > > > > > Python Version: 2.5.0
>
> > > > > > > On Nov 7, 11:16 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > On 08-Nov-07, at 12:34 PM, stranger wrote:
>
> > > > > > > > > Can you please tell me how to put crimemap on path. What is 
> > > > > > > > > sym-
> > > > > > > > > linking? Can you explain briefly?
>
> > > > > > > > as root, at the prompt type:
> > > > > > > > ln -s /pathtocrimemap/crimemap 
> > > > > > > > /usr/lib/python2.x/site-packages/crimemap
> > > > > > > > and press enter
>
> > > > > > > > for the 'x' for python2.x, put your python version (3,4 or 5)
> > > > > > > > for further information, do man ln
>
> > > > > > > > --
>
> > > > > > > > r

Re: problem with Django

2007-11-08 Thread stranger

How can I contact you when I am in need any email or messenger
please

On Nov 8, 12:20 am, stranger <[EMAIL PROTECTED]> wrote:
> God.. How stupid I am ? Everytime I encounter you I am safe. thanks a
> lot I am getting the page.
> So how to make apache server media files?
>
> In httpd.conf I added the Location directive to the project directory
> is it enough...
>
> On Nov 8, 12:16 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On Nov 8, 7:13 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > Ya mapper is an application in crimemap project. There is an empty
> > > __init.py__ file.
> > > Currenly this is the only url i am using..
>
> > > (r'^crime/([a-zA-Z]+)', crimemap.mapper.views.crime_by_type),
>
> > Put quotes around the second value in the tuple:
>
> > (r'^crime/([a-zA-Z]+)', 'crimemap.mapper.views.crime_by_type'),
>
> > >http://localhost:8000/crime/arson
>
> > > should yield me the resulting view but i am getting an error I
> > > mentioned above
>
> > > On. Nov 8, 12:08 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Are you saying the directory hierarchy is:
>
> > > >   /home/priya/projects/crimemap
> > > >   /home/priya/projects/crimemap/mapper
>
> > > > What is the full contents of urls.py?
>
> > > > If 'mapper' is a subdirectory of 'crimemap', does that directory
> > > > contain at least an empty __init__.py file?
>
> > > > Graham
>
> > > > On Nov 8, 7:02 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello Graham,
>
> > > > >  I tried the method u told me...But still the same result. Let
> > > > > me clear a few things. I created a new project "crimemap" in /home/
> > > > > priya/projects/
> > > > > and app "mapper" inside crimemap. Now I am getting an error when i run
> > > > > the server. python manage.py runserver
>
> > > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is not
> > > > > defined
> > > > > Request Method: GET
> > > > > Request URL:http://localhost:8000/
> > > > > Exception Type: ImproperlyConfigured
> > > > > Exception Value:Error while importing URLconf 
> > > > > 'crimemap.urls': name
> > > > > 'crimemap' is not defined
> > > > > Exception Location: /usr/lib/python2.5/site-packages/django/core/
> > > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > > Python Executable:  /usr/bin/python
> > > > > Python Version: 2.5.0
>
> > > > > On Nov 7, 11:38 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > > wrote:
>
> > > > > > Check the file and directory permissions like suggested when you 
> > > > > > were
> > > > > > first trying to setup your site, this time looking at any new files
> > > > > > and directories you have added within your site area. They should 
> > > > > > have
> > > > > > permissions so they are readable to Apache.
>
> > > > > > Graham
>
> > > > > > On Nov 8, 6:32 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hello,
> > > > > > >  I did the linking as you said:
> > > > > > > ln -s /home/priya/projects/crimemap 
> > > > > > > /usr/lib/python2.5/site-packages/
> > > > > > > crimemap
>
> > > > > > > Also I restarted Apache, but nno change
>
> > > > > > > ImproperlyConfigured at /crime/arson/
> > > > > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is 
> > > > > > > not
> > > > > > > defined
> > > > > > > Request Method: GET
> > > > > > > Request URL:http://localhost:8000/crime/arson/
> > > > > > > Exception Type: ImproperlyConfigured
> > > > > > > Exception Value:Error while importing URLconf 
> > > > > > > 'crimemap.urls': name
> > > > > > > 'crimemap' is not defined
> > > > > > > Exception Location: 
> > > > > > > /usr/lib/python2.5/site-packages/django/core/
> > > > > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > > > > Python Executable:  /usr/bin/python
> > > > > > > Python Version: 2.5.0
>
> > > > > > > On Nov 7, 11:16 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > On 08-Nov-07, at 12:34 PM, stranger wrote:
>
> > > > > > > > > Can you please tell me how to put crimemap on path. What is 
> > > > > > > > > sym-
> > > > > > > > > linking? Can you explain briefly?
>
> > > > > > > > as root, at the prompt type:
> > > > > > > > ln -s /pathtocrimemap/crimemap 
> > > > > > > > /usr/lib/python2.x/site-packages/crimemap
> > > > > > > > and press enter
>
> > > > > > > > for the 'x' for python2.x, put your python version (3,4 or 5)
> > > > > > > > for further information, do man ln
>
> > > > > > > > --
>
> > > > > > > > regards
> > > > > > > > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/

Re: problem with Django

2007-11-08 Thread stranger

God.. How stupid I am ? Everytime I encounter you I am safe. thanks a
lot I am getting the page.
So how to make apache server media files?

In httpd.conf I added the Location directive to the project directory
is it enough...


On Nov 8, 12:16 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 8, 7:13 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > Ya mapper is an application in crimemap project. There is an empty
> > __init.py__ file.
> > Currenly this is the only url i am using..
>
> > (r'^crime/([a-zA-Z]+)', crimemap.mapper.views.crime_by_type),
>
> Put quotes around the second value in the tuple:
>
> (r'^crime/([a-zA-Z]+)', 'crimemap.mapper.views.crime_by_type'),
>
> >http://localhost:8000/crime/arson
>
> > should yield me the resulting view but i am getting an error I
> > mentioned above
>
> > On. Nov 8, 12:08 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > Are you saying the directory hierarchy is:
>
> > >   /home/priya/projects/crimemap
> > >   /home/priya/projects/crimemap/mapper
>
> > > What is the full contents of urls.py?
>
> > > If 'mapper' is a subdirectory of 'crimemap', does that directory
> > > contain at least an empty __init__.py file?
>
> > > Graham
>
> > > On Nov 8, 7:02 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > Hello Graham,
>
> > > >  I tried the method u told me...But still the same result. Let
> > > > me clear a few things. I created a new project "crimemap" in /home/
> > > > priya/projects/
> > > > and app "mapper" inside crimemap. Now I am getting an error when i run
> > > > the server. python manage.py runserver
>
> > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is not
> > > > defined
> > > > Request Method: GET
> > > > Request URL:http://localhost:8000/
> > > > Exception Type: ImproperlyConfigured
> > > > Exception Value:Error while importing URLconf 'crimemap.urls': 
> > > > name
> > > > 'crimemap' is not defined
> > > > Exception Location: /usr/lib/python2.5/site-packages/django/core/
> > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > Python Executable:  /usr/bin/python
> > > > Python Version: 2.5.0
>
> > > > On Nov 7, 11:38 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > Check the file and directory permissions like suggested when you were
> > > > > first trying to setup your site, this time looking at any new files
> > > > > and directories you have added within your site area. They should have
> > > > > permissions so they are readable to Apache.
>
> > > > > Graham
>
> > > > > On Nov 8, 6:32 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello,
> > > > > >  I did the linking as you said:
> > > > > > ln -s /home/priya/projects/crimemap 
> > > > > > /usr/lib/python2.5/site-packages/
> > > > > > crimemap
>
> > > > > > Also I restarted Apache, but nno change
>
> > > > > > ImproperlyConfigured at /crime/arson/
> > > > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is 
> > > > > > not
> > > > > > defined
> > > > > > Request Method: GET
> > > > > > Request URL:http://localhost:8000/crime/arson/
> > > > > > Exception Type: ImproperlyConfigured
> > > > > > Exception Value:Error while importing URLconf 
> > > > > > 'crimemap.urls': name
> > > > > > 'crimemap' is not defined
> > > > > > Exception Location: 
> > > > > > /usr/lib/python2.5/site-packages/django/core/
> > > > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > > > Python Executable:  /usr/bin/python
> > > > > > Python Version: 2.5.0
>
> > > > > > On Nov 7, 11:16 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> > > > > > > On 08-Nov-07, at 12:34 PM, stranger wrote:
>
> > > > > > > > Can you please tell me how to put crimemap on path. What is sym-
> > > > > > > > linking? Can you explain briefly?
>
> > > > > > > as root, at the prompt type:
> > > > > > > ln -s /pathtocrimemap/crimemap 
> > > > > > > /usr/lib/python2.x/site-packages/crimemap
> > > > > > > and press enter
>
> > > > > > > for the 'x' for python2.x, put your python version (3,4 or 5)
> > > > > > > for further information, do man ln
>
> > > > > > > --
>
> > > > > > > regards
> > > > > > > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with Django

2007-11-08 Thread Graham Dumpleton



On Nov 8, 7:13 pm, stranger <[EMAIL PROTECTED]> wrote:
> Ya mapper is an application in crimemap project. There is an empty
> __init.py__ file.
> Currenly this is the only url i am using..
>
> (r'^crime/([a-zA-Z]+)', crimemap.mapper.views.crime_by_type),

Put quotes around the second value in the tuple:

(r'^crime/([a-zA-Z]+)', 'crimemap.mapper.views.crime_by_type'),

> http://localhost:8000/crime/arson
>
> should yield me the resulting view but i am getting an error I
> mentioned above
>
> On. Nov 8, 12:08 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > Are you saying the directory hierarchy is:
>
> >   /home/priya/projects/crimemap
> >   /home/priya/projects/crimemap/mapper
>
> > What is the full contents of urls.py?
>
> > If 'mapper' is a subdirectory of 'crimemap', does that directory
> > contain at least an empty __init__.py file?
>
> > Graham
>
> > On Nov 8, 7:02 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > Hello Graham,
>
> > >  I tried the method u told me...But still the same result. Let
> > > me clear a few things. I created a new project "crimemap" in /home/
> > > priya/projects/
> > > and app "mapper" inside crimemap. Now I am getting an error when i run
> > > the server. python manage.py runserver
>
> > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is not
> > > defined
> > > Request Method: GET
> > > Request URL:http://localhost:8000/
> > > Exception Type: ImproperlyConfigured
> > > Exception Value:Error while importing URLconf 'crimemap.urls': 
> > > name
> > > 'crimemap' is not defined
> > > Exception Location: /usr/lib/python2.5/site-packages/django/core/
> > > urlresolvers.py in _get_urlconf_module, line 255
> > > Python Executable:  /usr/bin/python
> > > Python Version: 2.5.0
>
> > > On Nov 7, 11:38 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Check the file and directory permissions like suggested when you were
> > > > first trying to setup your site, this time looking at any new files
> > > > and directories you have added within your site area. They should have
> > > > permissions so they are readable to Apache.
>
> > > > Graham
>
> > > > On Nov 8, 6:32 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello,
> > > > >  I did the linking as you said:
> > > > > ln -s /home/priya/projects/crimemap /usr/lib/python2.5/site-packages/
> > > > > crimemap
>
> > > > > Also I restarted Apache, but nno change
>
> > > > > ImproperlyConfigured at /crime/arson/
> > > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is not
> > > > > defined
> > > > > Request Method: GET
> > > > > Request URL:http://localhost:8000/crime/arson/
> > > > > Exception Type: ImproperlyConfigured
> > > > > Exception Value:Error while importing URLconf 
> > > > > 'crimemap.urls': name
> > > > > 'crimemap' is not defined
> > > > > Exception Location: /usr/lib/python2.5/site-packages/django/core/
> > > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > > Python Executable:  /usr/bin/python
> > > > > Python Version: 2.5.0
>
> > > > > On Nov 7, 11:16 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> > > > > > On 08-Nov-07, at 12:34 PM, stranger wrote:
>
> > > > > > > Can you please tell me how to put crimemap on path. What is sym-
> > > > > > > linking? Can you explain briefly?
>
> > > > > > as root, at the prompt type:
> > > > > > ln -s /pathtocrimemap/crimemap 
> > > > > > /usr/lib/python2.x/site-packages/crimemap
> > > > > > and press enter
>
> > > > > > for the 'x' for python2.x, put your python version (3,4 or 5)
> > > > > > for further information, do man ln
>
> > > > > > --
>
> > > > > > regards
> > > > > > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with Django

2007-11-08 Thread Graham Dumpleton

You only need to worry about a separate media server if your site is
going to get large volumes of traffic or you are serving large media
files. For the average user they need not worry about such things, so
don't concern yourself for now about it.

Graham

On Nov 8, 7:11 pm, stranger <[EMAIL PROTECTED]> wrote:
> Also can anyone suggest me how to setup a webserver to serve media
> files like css, images, javascripts. I heard that we should not use
> the same webserver django is using. I am using Apache httpd currently.
> So if i want to use lighttpd for media how to configure it. Also the
> lighttpd wont run anymore on 80 port as apache is running please
> suggest.
>
> On Nov 8, 12:02 am, stranger <[EMAIL PROTECTED]> wrote:
>
> > Hello Graham,
>
> >  I tried the method u told me...But still the same result. Let
> > me clear a few things. I created a new project "crimemap" in /home/
> > priya/projects/
> > and app "mapper" inside crimemap. Now I am getting an error when i run
> > the server. python manage.py runserver
>
> > Error while importing URLconf 'crimemap.urls': name 'crimemap' is not
> > defined
> > Request Method: GET
> > Request URL:http://localhost:8000/
> > Exception Type: ImproperlyConfigured
> > Exception Value:Error while importing URLconf 'crimemap.urls': name
> > 'crimemap' is not defined
> > Exception Location: /usr/lib/python2.5/site-packages/django/core/
> > urlresolvers.py in _get_urlconf_module, line 255
> > Python Executable:  /usr/bin/python
> > Python Version: 2.5.0
>
> > On Nov 7, 11:38 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > Check the file and directory permissions like suggested when you were
> > > first trying to setup your site, this time looking at any new files
> > > and directories you have added within your site area. They should have
> > > permissions so they are readable to Apache.
>
> > > Graham
>
> > > On Nov 8, 6:32 pm, stranger <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
> > > >  I did the linking as you said:
> > > > ln -s /home/priya/projects/crimemap /usr/lib/python2.5/site-packages/
> > > > crimemap
>
> > > > Also I restarted Apache, but nno change
>
> > > > ImproperlyConfigured at /crime/arson/
> > > > Error while importing URLconf 'crimemap.urls': name 'crimemap' is not
> > > > defined
> > > > Request Method: GET
> > > > Request URL:http://localhost:8000/crime/arson/
> > > > Exception Type: ImproperlyConfigured
> > > > Exception Value:Error while importing URLconf 'crimemap.urls': 
> > > > name
> > > > 'crimemap' is not defined
> > > > Exception Location: /usr/lib/python2.5/site-packages/django/core/
> > > > urlresolvers.py in _get_urlconf_module, line 255
> > > > Python Executable:  /usr/bin/python
> > > > Python Version: 2.5.0
>
> > > > On Nov 7, 11:16 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> > > > > On 08-Nov-07, at 12:34 PM, stranger wrote:
>
> > > > > > Can you please tell me how to put crimemap on path. What is sym-
> > > > > > linking? Can you explain briefly?
>
> > > > > as root, at the prompt type:
> > > > > ln -s /pathtocrimemap/crimemap 
> > > > > /usr/lib/python2.x/site-packages/crimemap
> > > > > and press enter
>
> > > > > for the 'x' for python2.x, put your python version (3,4 or 5)
> > > > > for further information, do man ln
>
> > > > > --
>
> > > > > regards
> > > > > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   >