getting error "Project matching query does not exist."

2017-04-11 Thread nitin
Hi,

I have setup existing django project at localsystem and its migrate 
successfully.
after migrate i have run following "python manage.py runserver" to run 
django project.

After that i am getting error message "Project matching query does not 
exist." on terminal and as well as browser.

Please let me know of what is problem.



Please help me to solve this issue.

Thanks,

-- 
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/218dfc6d-90e7-4b75-9d1a-ee603a8e044d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can you post/submit to the same view named in urls.conf?

2017-04-11 Thread miguel vfx


> url(r'^register/(?P[-\w]+)/$', rrs_views.rrs_register_student, 
> name="rrs_register_student"),
>

 


 def rrs_register_student(request, student_id='', section=''):


Good day, I suspect that I'm doing something wrong here. What I wanted to 
achieve is...

   - When the page is loaded, it will render a template with a form.
   - When the page is loaded while the form is submitted (if request.method 
   == 'POST'), then it will process the form.

So basically, the form action is pointing at the same view. There will be 
two different sets of commands: for get/url and for post.

Here's the error I'm getting:

NoReverseMatch 
>
> Reverse for 'rrs_register_student' with arguments '()' and keyword arguments 
> '{}' not found. 1 pattern(s) tried: ['rrs/register/(?P[-\\w]+)/$']
>
>  
Thank you 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/c50973bf-08f2-4d9b-8d94-c65008bb2628%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-11 Thread ludovic coues
You got lucky, you might have pasted just enough of the traceback to
receive some help.

Check the data you have in your database, look like there is no object
Project with an id=1.

2017-04-11 11:57 GMT+02:00 :

> Hi,
>
> I have setup existing django project at localsystem and its migrate
> successfully.
> after migrate i have run following "python manage.py runserver" to run
> django project.
>
> After that i am getting error message "Project matching query does not
> exist." on terminal and as well as browser.
>
> Please let me know of what is problem.
>
>
>
> Please help me to solve this issue.
>
> Thanks,
>
> --
> 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/218dfc6d-90e7-4b75-9d1a-ee603a8e044d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 42

-- 
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/CAEuG%2BTYAa0dv4Diphy_%3D3k2AuJn9_wotU7Utd0kPyMWTwTHp5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can you post/submit to the same view named in urls.conf?

2017-04-11 Thread ludovic coues
You failed to post the bare minimum information required to debug your problem.

Error of type NoReverseMatch have close to nothing to do with the function.
So the line `def rrs_register_student` is not useful.

The message with the error clearly state that no reverse where found
for rrs_register_student. The piece of html you posted try to reverse
rrs_register_search.
So this piece of html is not useful.

About your problem, the error message say an url matching the route
name was found. That url take an argument, student_id. But you didn't
specify any argument to your reverse function.

Good luck fixing your problem.
If you want more help, bring more information.

2017-04-11 13:09 GMT+02:00 miguel vfx :
>
>> url(r'^register/(?P[-\w]+)/$', rrs_views.rrs_register_student,
>> name="rrs_register_student"),
>
>
>>  
>
>
>>  def rrs_register_student(request, student_id='', section=''):
>
>
> Good day, I suspect that I'm doing something wrong here. What I wanted to
> achieve is...
>
> When the page is loaded, it will render a template with a form.
> When the page is loaded while the form is submitted (if request.method ==
> 'POST'), then it will process the form.
>
> So basically, the form action is pointing at the same view. There will be
> two different sets of commands: for get/url and for post.
>
> Here's the error I'm getting:
>
>> NoReverseMatch
>>
>> Reverse for 'rrs_register_student' with arguments '()' and keyword
>> arguments '{}' not found. 1 pattern(s) tried:
>> ['rrs/register/(?P[-\\w]+)/$']
>
>
> Thank you 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/c50973bf-08f2-4d9b-8d94-c65008bb2628%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 42

-- 
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/CAEuG%2BTbbZR%3DpRvEk%2Bygy2COLyeokf9hFMWY_QWaJ%3DLjvZ1fFpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-11 Thread nitin
Hi,

I am not getting your point can you please let me know of in which file i 
can change to solve this issue.



On Tuesday, April 11, 2017 at 4:56:01 PM UTC+5:30, ludovic coues wrote:
>
> You got lucky, you might have pasted just enough of the traceback to 
> receive some help.
>
> Check the data you have in your database, look like there is no object 
> Project with an id=1. 
>
> 2017-04-11 11:57 GMT+02:00 >:
>
>> Hi,
>>
>> I have setup existing django project at localsystem and its migrate 
>> successfully.
>> after migrate i have run following "python manage.py runserver" to run 
>> django project.
>>
>> After that i am getting error message "Project matching query does not 
>> exist." on terminal and as well as browser.
>>
>> Please let me know of what is problem.
>>
>>
>>
>> Please help me to solve this issue.
>>
>> Thanks,
>>
>> -- 
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/218dfc6d-90e7-4b75-9d1a-ee603a8e044d%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Cordialement, Ludovic Coues 
> +33 6 14 87 43 42
>

-- 
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/549ca5a5-7a6e-4ac4-8438-305d4cea0386%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-11 Thread Andréas Kühne
Hi,

I think his point is that no file change will resolve this. :-)

In the file "brickly/framework/middleware.py" you are searching for a
Project with the database ID 1 - and it doesn't exist. The middleware
apparantly needs a Project to function.

So you can either add a project to your database, or you can remove that
line in the middleware file - either would solve THIS issue - however
removing the line, will probably add other problems instead.

Regards,

Andréas

2017-04-11 14:01 GMT+02:00 :

> Hi,
>
> I am not getting your point can you please let me know of in which file i
> can change to solve this issue.
>
>
>
> On Tuesday, April 11, 2017 at 4:56:01 PM UTC+5:30, ludovic coues wrote:
>>
>> You got lucky, you might have pasted just enough of the traceback to
>> receive some help.
>>
>> Check the data you have in your database, look like there is no object
>> Project with an id=1.
>>
>> 2017-04-11 11:57 GMT+02:00 :
>>
>>> Hi,
>>>
>>> I have setup existing django project at localsystem and its migrate
>>> successfully.
>>> after migrate i have run following "python manage.py runserver" to run
>>> django project.
>>>
>>> After that i am getting error message "Project matching query does not
>>> exist." on terminal and as well as browser.
>>>
>>> Please let me know of what is problem.
>>>
>>>
>>>
>>> Please help me to solve this issue.
>>>
>>> Thanks,
>>>
>>> --
>>> 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 https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/218dfc6d-90e7-4b75-9d1a-ee603a8e044d%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Cordialement, Ludovic Coues
>> +33 6 14 87 43 42 <+33%206%2014%2087%2043%2042>
>>
> --
> 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/549ca5a5-7a6e-4ac4-8438-305d4cea0386%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/CAK4qSCdPHFF29Xvmy_MDmnyoxjq8Cj12AbkLX8H2bm22SrFJ3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


form wizard

2017-04-11 Thread Pranay Verma
Hi
Is there any way to use form wizard in Django 1.10 ao above

-- 
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/06039b16-b729-49c5-bd2d-1b66815d4d97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-11 Thread nitin
Hi,

Previous error solve and thanks for that.

now i am getting new error of ValidationError Please see below screen shot.
Please let me know of what is the problem now.




On Tuesday, April 11, 2017 at 4:38:30 PM UTC+5:30, ni...@linkites.com wrote:
>
> Hi,
>
> I have setup existing django project at localsystem and its migrate 
> successfully.
> after migrate i have run following "python manage.py runserver" to run 
> django project.
>
> After that i am getting error message "Project matching query does not 
> exist." on terminal and as well as browser.
>
> Please let me know of what is problem.
>
>
>
> Please help me to solve this issue.
>
> Thanks,
>
>

-- 
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/b3cf7081-6f8b-4e3a-924e-7a084da0780a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Let's Encrypt installation fails with WSGI on Ubuntu 14 LTS

2017-04-11 Thread Andreas Schosser
Hi Moreplavec

> AH00526: Syntax error on line 26 of /etc/apache2/sites-enabled/my-domain.
> cz_crm.conf:
> Name duplicates previous WSGI daemon definition.

I had a similar issue on one of our servers. Since we enforce https I
just commented out the following directives in the original conf and
enabled them afterwards in the le-ssl.conf:

WSGIScriptAlias
WSGIDaemonProcess
WSGIProcessGroup

Hope this helps,
Andreas

-- 
Kurs 10 IT-Consulting   www.kurs-10.de
Andreas Schosser  a...@kurs-10.de

Baldestraße. 14  Telefon +49 89 41615842-0
80469 MünchenTelefax +49 89 41615842-3

0x6EDECCF1 - 2AA0 939B 5585 819B FCE8 E43B 0B8E 0DF2 6EDE CCF1

-- 
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/1e21f7c8-0f5e-05d1-578e-6ca409123940%40kurs-10.de.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME Cryptographic Signature


Unicode decoding error

2017-04-11 Thread Christophe Pettus
I've run into the issue described in the code below, where (as far as I can 
tell) a natural use of __str__ in Python 2.7 results in a Unicode error.  I'm 
not quite sure how to write this code to work properly on both Python 2 and 
Python 3; what am I missing?

(Note this issue happens on Python 2.7 regardless of the presence of the 
@python_2_unicode_compatible decorator.)

Models:

from django.db import models
from django.utils.encoding import python_2_unicode_compatible

@python_2_unicode_compatible
class A(models.Model):
c = models.CharField(max_length=20)

def __str__(self):
return self.c

@python_2_unicode_compatible
class B(models.Model):
a = models.ForeignKey(A)

def __str__(self):
return str(self.a)


Failure example:

>>> from test.models import A, B
>>> a = A(c=u'répairer')
>>> a.save()
>>> a.id
1
>>> a1 = A.objects.get(id=1)
>>> a1

>>> b = B(a_id=1)
>>> b.save()
>>> b.id
1
>>> b1 = B.objects.get(id=1)
>>> b1

>>> print b1
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Users/xof/Documents/Dev/environments/peep/lib/python2.7/site-packages/django/utils/six.py",
 line 842, in 
klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal 
not in range(128)

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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/E6F66BA4-490C-4B7A-A6AB-07BB52B49C2E%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unicode decoding error

2017-04-11 Thread Tim Graham
As ​documented 

 
you must return *text* and not *bytes* from __str__() when using 
@python_2_unicode_compatible. That means six.text_type(self.a) rather than 
str(self.a) (which returns bytes on Python 2).

On Tuesday, April 11, 2017 at 11:18:02 AM UTC-4, Christophe Pettus wrote:
>
> I've run into the issue described in the code below, where (as far as I 
> can tell) a natural use of __str__ in Python 2.7 results in a Unicode 
> error.  I'm not quite sure how to write this code to work properly on both 
> Python 2 and Python 3; what am I missing? 
>
> (Note this issue happens on Python 2.7 regardless of the presence of the 
> @python_2_unicode_compatible decorator.) 
>
> Models: 
>
> from django.db import models 
> from django.utils.encoding import python_2_unicode_compatible 
>
> @python_2_unicode_compatible 
> class A(models.Model): 
> c = models.CharField(max_length=20) 
>
> def __str__(self): 
> return self.c 
>
> @python_2_unicode_compatible 
> class B(models.Model): 
> a = models.ForeignKey(A) 
>
> def __str__(self): 
> return str(self.a) 
>
>
> Failure example: 
>
> >>> from test.models import A, B 
> >>> a = A(c=u'répairer') 
> >>> a.save() 
> >>> a.id 
> 1 
> >>> a1 = A.objects.get(id=1) 
> >>> a1 
>  
> >>> b = B(a_id=1) 
> >>> b.save() 
> >>> b.id 
> 1 
> >>> b1 = B.objects.get(id=1) 
> >>> b1 
>  
> >>> print b1 
> Traceback (most recent call last): 
>   File "", line 1, in  
>   File 
> "/Users/xof/Documents/Dev/environments/peep/lib/python2.7/site-packages/django/utils/six.py",
>  
> line 842, in  
> klass.__str__ = lambda self: self.__unicode__().encode('utf-8') 
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: 
> ordinal not in range(128) 
>
> -- 
> -- Christophe Pettus 
>x...@thebuild.com  
>
>

-- 
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/96a2e023-bf4b-4584-ae36-30e9d48c8927%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unicode decoding error

2017-04-11 Thread Christophe Pettus
Thanks, and thanks for accepting my documentation change suggestion!

https://github.com/django/django/pull/8349

> On Apr 11, 2017, at 09:52, Tim Graham  wrote:
> 
> As ​documented you must return text and not bytes from __str__() when using 
> @python_2_unicode_compatible. That means six.text_type(self.a) rather than 
> str(self.a) (which returns bytes on Python 2).
> 
> On Tuesday, April 11, 2017 at 11:18:02 AM UTC-4, Christophe Pettus wrote:
> I've run into the issue described in the code below, where (as far as I can 
> tell) a natural use of __str__ in Python 2.7 results in a Unicode error.  I'm 
> not quite sure how to write this code to work properly on both Python 2 and 
> Python 3; what am I missing? 
> 
> (Note this issue happens on Python 2.7 regardless of the presence of the 
> @python_2_unicode_compatible decorator.) 
> 
> Models: 
> 
> from django.db import models 
> from django.utils.encoding import python_2_unicode_compatible 
> 
> @python_2_unicode_compatible 
> class A(models.Model): 
> c = models.CharField(max_length=20) 
> 
> def __str__(self): 
> return self.c 
> 
> @python_2_unicode_compatible 
> class B(models.Model): 
> a = models.ForeignKey(A) 
> 
> def __str__(self): 
> return str(self.a) 
> 
> 
> Failure example: 
> 
> >>> from test.models import A, B 
> >>> a = A(c=u'répairer') 
> >>> a.save() 
> >>> a.id 
> 1 
> >>> a1 = A.objects.get(id=1) 
> >>> a1 
>  
> >>> b = B(a_id=1) 
> >>> b.save() 
> >>> b.id 
> 1 
> >>> b1 = B.objects.get(id=1) 
> >>> b1 
>  
> >>> print b1 
> Traceback (most recent call last): 
>   File "", line 1, in  
>   File 
> "/Users/xof/Documents/Dev/environments/peep/lib/python2.7/site-packages/django/utils/six.py",
>  line 842, in  
> klass.__str__ = lambda self: self.__unicode__().encode('utf-8') 
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: 
> ordinal not in range(128) 
> 
> -- 
> -- Christophe Pettus 
>x...@thebuild.com 
> 
> 
> -- 
> 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/96a2e023-bf4b-4584-ae36-30e9d48c8927%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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/F2B222CC-D9E4-41D0-92D9-82528B8338A7%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.


Re: Abridged summary of django-users@googlegroups.com - 24 updates in 12 topics

2017-04-11 Thread Bhawesh Agarwal
Hello Friends,
I am looking for Django, Python opening. If anyone has a requirement please
contact me.



-- 
Bhawesh Agarwal
*Electronics and communication Engineering.*
*The LNM Institute of Information Technology,*
*Contact :- +917597867887*

-- 
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/CAMKokd7z48_RdfvJWZvZLV7_c75%3Df6VYKoH9w3CnSh1AcyQeXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Include pictures in content

2017-04-11 Thread Steve Watts
I also don't normally comment, but in your case, you might also try 
prefacing assets with media or static - i.e. 
http://yourwebsite.com/media/assets/... or 
http://yourwebsite.com/static/assets/... . That said, it's hard to know 
without seeing your settings.py file from your project. As it is, the 
question is more about how someone implemented the website, not about an 
implementation issue.

It may also be telling you to store the link somewhere else on the web for 
reference by your website.

Best of luck, though!

On Thursday, April 6, 2017 at 2:05:56 PM UTC-5, John Fabiani wrote:
>
> I normally don't jump into discussions - so I apologize in advance!
>
> Try reading this link:
>
> https://docs.djangoproject.com/en/1.10/howto/static-files/
>
> Johnf
>
> On 04/06/2017 11:50 AM, ard...@dunnsmail.co.uk  wrote:
>
> Thanks ludovic, 
> I haven't had any success yet, but your answer has led me deeper into the 
> django maze!
>
> On Thursday, April 6, 2017 at 11:59:29 AM UTC+1, ard...@dunnsmail.co.uk 
> wrote: 
>>
>> I am new to using django which has been used to create our church 
>> website. I want to incorporate pictures into content on a post. The 'insert 
>> image' icon on the content toolbar asks for an 'image web link'. The 
>> pictures I want to include (as pictures, not as links) are on the web site 
>> in the default home/assets/images folder. Can anyone tell me the format of 
>> the link to these images stored on the site? 
>> Thank You, Alan Dunn
>>
> -- 
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/d9b1a93a-3646-48cd-8f64-b8462259a239%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/bb143bdc-d795-4673-9938-c1cc96f333e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to django and ORM. So a basic question about data inserts

2017-04-11 Thread Camilo Torres
Hi,
Lets suppose we simplify your problem and we have these 2 django models:
from django.db import models


class Person(models.Model):
name = models.CharField(max_length=255, null=False, blank=False)

def __str__(self):
return self.name


class Residence(models.Model):
address = models.CharField(max_length=255, null=False, blank=False)
person = models.ForeignKey('Person', null=False, blank=False)

def __str__(self):
return '%s: %s' % (self.person.name, self.address)

Notice I simplified the data so save in each model.

This is how you create data for these models. I ran these command in the 
django shell (python manage.py shell):
In [1]: from residence.models import Person, Residence
In [3]: p = Person.objects.create(name='Abu UIfreoledo')
In [4]: p
Out[4]: 
In [6]: r1 = Residence.objects.create(address='yyy', person=p)
In [7]: r2 = Residence.objects.create(address='', person=p)

This is another way of creating and saving models:
In [8]: other_person = Person()
In [9]: other_person.name = 'Jekolaw Yhjosw'
In [10]: other_person.save()
In [11]: res1 = Residence()
In [12]: res1.address = 'keikdioekekdiekecnchdhwe'
In [13]: res1.person = other_person
In [14]: res1.save()

Notice this generates these 2 tables in Postgres:
temp2=# \d residence_person
 Table "public.residence_person"
 Column |  Type  |   
Modifiers   
++---
 id | integer| not null default 
nextval('residence_person_id_seq'::regclass)
 name   | character varying(255) | not null
Indexes:
"residence_person_pkey" PRIMARY KEY, btree (id)
Referenced by:
TABLE "residence_residence" CONSTRAINT 
"residence_residence_person_id_d4f422a8_fk_residence_person_id" FOREIGN KEY 
(person_id) REFERENCES residence_person(id) DEFERRABLE INITIALLY DEFERRED

temp2=# \d residence_residence
  Table "public.residence_residence"
  Column   |  Type  |
Modifiers 
---++--
 id| integer| not null default 
nextval('residence_residence_id_seq'::regclass)
 address   | character varying(255) | not null
 person_id | integer| not null
Indexes:
"residence_residence_pkey" PRIMARY KEY, btree (id)
"residence_residence_person_id_d4f422a8" btree (person_id)
Foreign-key constraints:
"residence_residence_person_id_d4f422a8_fk_residence_person_id" FOREIGN 
KEY (person_id) REFERENCES residence_person(id) DEFERRABLE INITIALLY 
DEFERRED

In this example the Residence instances are not reused or shared across 
Persons.


Now suppose one want to reuse the residences, meaning we will use 3 tables 
instead of 2, One for Persona, as before, one for Residence (without the 
foreign key to the Person) and a third relation to relate both and hold the 
dates.

from django.db import models


class Person(models.Model):
name = models.CharField(max_length=255, null=False, blank=False)
residences = models.ManyToManyField('Residence', 
through='ResidenceDates')

def __str__(self):
return self.name


class Residence(models.Model):
address = models.CharField(max_length=255, null=False, blank=False)

def __str__(self):
return self.address


class ResidenceDates(models.Model):
dates = models.CharField(max_length=255, null=False, blank=False)
person = models.ForeignKey('Person', null=False, blank=False)
residence = models.ForeignKey('Residence', null=False, blank=False)

Notice the join table ResidenceDates, it has foreign keys to both Person 
and Residence models. Also notices the many to many field. This generates 
the 3 tables you need (not shown here).

In [3]: p1 = Person.objects.create(name='p1')
In [4]: p2 = Person.objects.create(name='p2')
In [5]: p3 = Person.objects.create(name='p3')
In [6]: res1 = Residence.objects.create(address='a1')
In [7]: res2 = Residence.objects.create(address='a2')
In [8]: res3 = Residence.objects.create(address='a3')
In [9]: res4 = Residence.objects.create(address='a4')
In [10]: res5 = Residence.objects.create(address='a5')
In [11]: ResidenceDates.objects.create(person=p1, residence=res1, 
dates='2003-2005')
Out[11]: 
In [12]: ResidenceDates.objects.create(person=p1, residence=res2, 
dates='2005-2008')
Out[12]: 
In [13]: ResidenceDates.objects.create(person=p1, residence=res4, 
dates='2009-2017')
Out[13]: 
In [15]: ResidenceDates.objects.create(person=p2, residence=res4, 
dates='2000-2001')
Out[15]: 
In [16]: ResidenceDates.objects.create(person=p2, residence=res5, 
dates='2002-2010')
Out[16]: 
In [17]: ResidenceDates.objects.create(person=p2, residence=res4, 
dates='2011-2016')
Out[17]: 

Hope this help.
Please read the django tu

Re: Unicode decoding error

2017-04-11 Thread Mike Dewhirst

On 12/04/2017 2:52 AM, Tim Graham wrote:
As ​documented 
 
you must return /text/ and not /bytes/ from |__str__()| when using 
|@python_2_unicode_compatible|. That means |six.text_type(self.a)| 
rather than |str(self.a)| (which returns bytes on Python 2).

Tim

Does this mean I should globally replace "str(" with "|six.text_type(" 
in a 2/3 codebase?|


???

Cheers

Mike



On Tuesday, April 11, 2017 at 11:18:02 AM UTC-4, Christophe Pettus wrote:

I've run into the issue described in the code below, where (as far
as I can tell) a natural use of __str__ in Python 2.7 results in a
Unicode error.  I'm not quite sure how to write this code to work
properly on both Python 2 and Python 3; what am I missing?

(Note this issue happens on Python 2.7 regardless of the presence
of the @python_2_unicode_compatible decorator.)

Models:

from django.db import models
from django.utils.encoding import python_2_unicode_compatible

@python_2_unicode_compatible
class A(models.Model):
c = models.CharField(max_length=20)

def __str__(self):
return self.c

@python_2_unicode_compatible
class B(models.Model):
a = models.ForeignKey(A)

def __str__(self):
return str(self.a)


Failure example:

>>> from test.models import A, B
>>> a = A(c=u'répairer')
>>> a.save()
>>> a.id 
1
>>> a1 = A.objects.get(id=1)
>>> a1

>>> b = B(a_id=1)
>>> b.save()
>>> b.id 
1
>>> b1 = B.objects.get(id=1)
>>> b1

>>> print b1
Traceback (most recent call last):
  File "", line 1, in 
  File

"/Users/xof/Documents/Dev/environments/peep/lib/python2.7/site-packages/django/utils/six.py",
line 842, in 
klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 1: ordinal not in range(128)

-- 
-- Christophe Pettus

x...@thebuild.com 

--
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/96a2e023-bf4b-4584-ae36-30e9d48c8927%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/cb162b0a-6955-4d72-4185-7d4a5b84a078%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Django relationships and the admin page

2017-04-11 Thread Camilo Torres
Hi,
Seems you need here admin inlines, these allow you to insert/edit related 
objects inline when editing the main object. For example, when editing a 
Site, you will be able to also edit Images and Locations, though it only 
supports 1 level, so with default configuration you may probably not be 
able to also edit LocImages.
Start reading here:
http://localhost/Python/django-docs-1.10-en/ref/contrib/admin/index.html#django.contrib.admin.ModelAdmin.inlines

To support more levels, you can use django-nested-admin package:
https://pypi.python.org/pypi/django-nested-admin

On Monday, April 10, 2017 at 7:48:37 PM UTC-4, Liam H wrote:
>
> Hi,
>
> I'm new to Django, programming, web apps, the whole lot. I've been working 
> on an app for a while now, but I'm having trouble figuring out how to 
> organise my models in an effective way. Im using Django 1.10 and Python 2.7.
>
> Here's a rough example of the structure I'm trying:
>
> class Site(models.Model):
> #...
> def __unicode__(self):
> return self.name
>
> class Image(models.Model):
> #...
> site = models.ForeignKey(Site, ...)
> def __unicode__(self):
> return self.name
>
> class Location(models.Model):
> #...
> site = models.ForeignKey(Site, ...)
> def __unicode__(self):
> return self.name
>
> class LocImage(models.Model):
> #...
> location = models.ForeignKey(Location, ...)
> def __unicode__(self):
> return self.name
>
>
>
> The idea is to have a site (like a castle or other area the user might 
> want to visit), and then each site will have various Images like aerial 
> photographs associated with it. Each site will also have various locations 
> around it with multiple images associated with that location.
>
> So it works something like this:
>
> Site
>
> Images
>
> Location
>
> LocImages 
>
>
>
> I've tried doing it this way, but I don't know how to get the admin page 
> to show this, for one. I read a post that said that Django's admin page 
> can't have nested related items like this, but I'm not sure if that's 
> actually true. I was able to run migrations on this code when I removed the 
> references to it in the admin page, but I don't know how to access the 
> LocImages model in the API, like I can with the Location and Images models 
> using something like 
> "Site.objects.get(pk=2).location_set.get(id=2).locimage_set.all()".
>
> So, is this how I should be structuring the models? And if it works in the 
> database is there any way to get this to show on a single page in the 
> Django admin?
>
> The reason I decided to structure it this way is so each location can have 
> multiple attributes that are all fields of the same model, making it easier 
> to link them together in the templates.
>
> Any help would be appreciated, thanks.
>

-- 
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/1a6c9dff-e7e8-41a2-96b5-7f6d08c88f77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: form wizard

2017-04-11 Thread Camilo Torres
Hi,
What is "form wizard"?
Can you provide a link or an explanation, example?

On Tuesday, April 11, 2017 at 9:29:39 AM UTC-4, Pranay Verma wrote:
>
> Hi
> Is there any way to use form wizard in Django 1.10 ao above
>

-- 
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/3b2a1e3e-d7b0-40df-ba10-99a719d4d55f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-11 Thread Camilo Torres
Hi
1) How did you solved the first issue? You should be supposed to solve it 
by adding a row to a database table (the one related to your Project model) 
with id=1.
2) You have not pasted enough information for your ValidationError issue, 
please don't paste screen shots (at least, not only a screen shot). Please 
paste the entire stack trace you get in the terminal running the server. 
You may also consider pasting relevant code you think is related to the 
error, though someone can ask for the code or configuration after looking 
at the entire stack trace.

On Tuesday, April 11, 2017 at 9:52:27 AM UTC-4, ni...@linkites.com wrote:
>
> Hi,
>
> Previous error solve and thanks for that.
>
> now i am getting new error of ValidationError Please see below screen shot.
> Please let me know of what is the problem now.
>
>
> 
>
>
> On Tuesday, April 11, 2017 at 4:38:30 PM UTC+5:30, ni...@linkites.com 
> wrote:
>>
>> Hi,
>>
>> I have setup existing django project at localsystem and its migrate 
>> successfully.
>> after migrate i have run following "python manage.py runserver" to run 
>> django project.
>>
>> After that i am getting error message "Project matching query does not 
>> exist." on terminal and as well as browser.
>>
>> Please let me know of what is problem.
>>
>>
>>
>> Please help me to solve this issue.
>>
>> Thanks,
>>
>>

-- 
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/b4d4b39f-a223-44a5-b1b4-18b63f4ba3bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Form.changed_data no longer includes changes to related fields as of Django 1.10?

2017-04-11 Thread Robert Rollins
I've got code that expects Form.changed_data to include the Groups to which 
a User belongs when the User edit form I wrote changes them. It works in 
Django 1.9.13, but tests fails in Django 1.10. 

Is there a known change to Django that would cause this? I don't see any 
mention of Form.changed_data anywhere in the patch notes, so my best guess 
is that this is a bug... but I'm not sure.

-- 
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/1eaab7ae-fd28-47bf-9006-2e03ac6fec19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Does anyone in this group hire out to update code .

2017-04-11 Thread webchair93
 I am looking for a django programmer
I have a site that was written in python django code and I am not 
proficient enough to make page correction. 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/58de7b2a-bcc8-40d7-a26a-42b0d0491bc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Form.changed_data no longer includes changes to related fields as of Django 1.10?

2017-04-11 Thread Tim Graham
Hi Robert, nothing comes to mind immediately. I'd suggest to use git bisect 
to find the commit in Django that caused the change 
https://docs.djangoproject.com/en/dev/internals/contributing/triaging-tickets/#bisecting-a-regression
 
and we can go from there.

On Tuesday, April 11, 2017 at 8:03:18 PM UTC-4, Robert Rollins wrote:
>
> I've got code that expects Form.changed_data to include the Groups to 
> which a User belongs when the User edit form I wrote changes them. It works 
> in Django 1.9.13, but tests fails in Django 1.10. 
>
> Is there a known change to Django that would cause this? I don't see any 
> mention of Form.changed_data anywhere in the patch notes, so my best guess 
> is that this is a bug... but I'm not sure.
>

-- 
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/0b7a80f8-21d0-4598-87ac-e4530eddc8b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Revoke celery task

2017-04-11 Thread Mauro Sánchez
Hello, I am trying to revoke a Pending task in celery without success.
I have tried all this ways:
app.control.revoke(task_id)
revoke(campaign.state_task)
async_result.revoke()
AsyncResult(task_id).revoke()

None of them work. I am using:
celery==3.1.23
django-celery==3.1.17
Django==1.9.13
tenant-schemas-celery==0.1.5

Any idea why this is happening. I can't see any errors when I run those 
commands.
Thanks for the help.
Cheers

-- 
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/4a3e73f4-5148-464d-93a1-c3d88190725c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting error "Project matching query does not exist."

2017-04-11 Thread nitin
Hi,

here are following issues are getting.

I have filled tables "project_project" and "user_user". please let me know 
another tables name for  add row to solve ValidationsError Issue


Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 1.9.8
Python Version: 3.5.2
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'compressor',
 'bootstrap3',
 'captcha',
 'mptt',
 'corsheaders',
 'dbbackup',
 'django_extensions',
 'mathfilters',
 'rest_framework',
 'rest_framework.authtoken',
 'social.apps.django_app.default',
 'brickly.framework',
 'brickly.system.project',
 'brickly.account.user',
 'brickly.account.email',
 'brickly.account.social',
 'brickly.account.address',
 'brickly.account.contact',
 'brickly.account.group',
 'brickly.account.history',
 'brickly.cms.content',
 'brickly.commerce.driver',
 'brickly.commerce.delivery',
 'brickly.system.verification',
 'brickly.system.location',
 'brickly.system.db',
 'brickly.system.upload',
 'brickly.hr.goodhire',
 'raven.contrib.django.raven_compat',
 'baf',
 'haystack')
Installed Middleware:
('raven.contrib.django.middleware.SentryMiddleware',
 'threadlocals.middleware.ThreadLocalMiddleware',
 'brickly.framework.middleware.BricklyMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'brickly.account.user.middleware.LocaleMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'brickly.account.user.middleware.TimezoneMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'social.apps.django_app.middleware.SocialAuthExceptionMiddleware')



Traceback:

File "/usr/lib/python3.5/json/decoder.py" in raw_decode
  355. obj, end = self.scan_once(s, idx)

During handling of the above exception (0), another exception occurred:

File 
"/usr/local/lib/python3.5/dist-packages/social/apps/django_app/default/fields.py"
 
in to_python
  42. return json.loads(value)

File "/usr/lib/python3.5/json/__init__.py" in loads
  319. return _default_decoder.decode(s)

File "/usr/lib/python3.5/json/decoder.py" in decode
  339. obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/usr/lib/python3.5/json/decoder.py" in raw_decode
  357. raise JSONDecodeError("Expecting value", s, err.value) 
from None

During handling of the above exception (Expecting value: line 1 column 1 
(char 0)), another exception occurred:

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" 
in get_response
  123. response = middleware_method(request)

File "/home/user/django-project/brickly/framework/middleware.py" in 
process_request
  18. request.project = Project.objects.get(id=1)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/manager.py" 
in manager_method
  122. return getattr(self.get_queryset(), name)(*args, 
**kwargs)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in 
get
  381. num = len(clone)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in 
__len__
  240. self._fetch_all()

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in 
_fetch_all
  1074. self._result_cache = list(self.iterator())

File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py" in 
__iter__
  68. for row in compiler.results_iter(results):

File 
"/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" 
in results_iter
  808. row = self.apply_converters(row, converters)

File 
"/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py" 
in apply_converters
  792. value = converter(value, expression, 
self.connection, self.query.context)

File 
"/usr/local/lib/python3.5/dist-packages/social/apps/django_app/default/fields.py"
 
in from_db_value
  24. return self.to_python(value)

File 
"/usr/local/lib/python3.5/dist-packages/social/apps/django_app/default/fields.py"
 
in to_python
  44. raise ValidationError(str(err))

Exception Type: ValidationError at /
Exception Value: ['Expecting value: line 1 column 1 (char 0)']



On Wednesday, April 12, 2017 at 5:31:19 AM UTC+5:30, Camilo Torres wrote:
>
> Hi
> 1) How did you solved the first issue? You should be supposed to solve it 
> by adding a row to a database table (the one related to