Re: Error with Tutorial - Writing your first Django app, part 1

2017-04-12 Thread Vijay Khemlani
In the first case he mispelled "urlpatters", it should be "urlpatterns"
(notice the n)

On Wed, Apr 12, 2017 at 3:47 PM, Lynn Capps  wrote:

> Shah,
>
> Did you get this figured out? I am having the same issue as you did.
>
>
>
> On Friday, December 9, 2016 at 1:50:22 PM UTC-6, shah wrote:
>>
>> Hi, I am facing the same issue with the tutorial.
>>
>> I have got my program correct. But after running the sever. It shows an
>> error on chrome.
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://localhost:8000/polls/
>>
>> Using the URLconf defined in mysite.urls, Django tried these URL
>> patterns, in this order:
>>
>>1. ^admin/
>>
>> The current URL, polls/, didn't match any of these.
>>
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard
>> 404 page.
>>
>> Since this is first ste of tutorial. I am not able to move forward. Thanx
>> for rely in advance.
>>
>> On Tuesday, 11 October 2016 02:12:30 UTC+5:30, Johnny McClung wrote:
>>>
>>> I am getting an error when I try to run the Django server.
>>>
>>> >> mysite >> polls >> urls.py
>>> from django.conf.urls import url
>>>
>>>
>>> from . import views
>>>
>>> urlpatters = [
>>> url(r'^$', views.index, name='index'),
>>> ]
>>>
>>>
>>>
>>>
>>> >> mysite >> mysite >> urls.py
>>> from django.conf.urls import include, url
>>> from django.contrib import admin
>>>
>>> urlpatterns = [
>>> url(r'^polls/', include('polls.urls'))
>>> url(r'^admin/', admin.site.urls),
>>> ]
>>>
>>>
>>>
>>> Error:
>>>
>>> E:\Dropbox\Python Scripts\mysite>python manage.py runserver
>>> Performing system checks...
>>>
>>> Unhandled exception in thread started by >> check_errors..wrapper at 0x03F616A8>
>>> Traceback (most recent call last):
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\utils\autoreload.py", line 226, in wrapper
>>> fn(*args, **kwargs)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\core\management\commands\runserver.py", line 121,
>>> in inner_run
>>> self.check(display_num_errors=True)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\core\management\base.py", line 374, in check
>>> include_deployment_checks=include_deployment_checks,
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\core\management\base.py", line 361, in _run_checks
>>> return checks.run_checks(**kwargs)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\core\checks\registry.py", line 81, in run_checks
>>> new_errors = check(app_configs=app_configs)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\core\checks\urls.py", line 14, in check_url_config
>>> return check_resolver(resolver)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\core\checks\urls.py", line 24, in check_resolver
>>> for pattern in resolver.url_patterns:
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\utils\functional.py", line 35, in __get__
>>> res = instance.__dict__[self.name] = self.func(instance)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\urls\resolvers.py", line 313, in url_patterns
>>> patterns = getattr(self.urlconf_module, "urlpatterns",
>>> self.urlconf_module)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\utils\functional.py", line 35, in __get__
>>> res = instance.__dict__[self.name] = self.func(instance)
>>>   File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib
>>> \site-packages\django\urls\resolvers.py", line 306, in urlconf_module
>>> return import_module(self.urlconf_name)
>>>   File 
>>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
>>> line 126, in import_module
>>> return _bootstrap._gcd_import(name[level:], package, level)
>>>   File "", line 986, in _gcd_import
>>>   File "", line 969, in _find_and_load
>>>   File "", line 958, in
>>> _find_and_load_unlocked
>>>   File "", line 673, in _load_unlocked
>>>   File "", line 661, in
>>> exec_module
>>>   File "", line 767, in get_code
>>>   File "", line 727, in
>>> source_to_code
>>>   File "", line 222, in
>>> _call_with_frames_removed
>>>   File "E:\Dropbox\Python Scripts\mysite\mysite\urls.py", line 21
>>> url(r'^admin/', admin.site.urls),
>>>   ^
>>> SyntaxError: invalid syntax
>>>
>>>
>>> Any help would be appreciated. Thank you.
>>>
>>> --
> 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+u

Re: Manage.py runserver is showing somthing else

2017-04-12 Thread Vijay Khemlani
Please copy and paste the whole stack trace (the messages on the command
prompt)

On Wed, Apr 12, 2017 at 3:01 PM, Divya Rajpurohit 
wrote:

> I started learning django a few days ago & i am trying to run a example
> project for a demo but when i put this command "manage.py runserver" it
> show so many lines on cmd promt & at end line showing 'invalid character'
> it's not showing those result which showed in documentation of django & for
> this i check my environment path but it having that /python36 i am using
> python in windows os if anyone knows what's going wrong tell me waiting for
> reply
>
> --
> 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/d4427871-2ff4-4e30-8d82-1607ad06eb1e%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/CALn3ei2hTuj1eMeEguTeW7m3vSUSLp-kUimY7ch5ofqajZ0F_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error with Tutorial - Writing your first Django app, part 1

2017-04-12 Thread Lynn Capps
Shah,

Did you get this figured out? I am having the same issue as you did.



On Friday, December 9, 2016 at 1:50:22 PM UTC-6, shah wrote:
>
> Hi, I am facing the same issue with the tutorial.
>
> I have got my program correct. But after running the sever. It shows an 
> error on chrome.
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL 
> patterns, in this order:
>
>1. ^admin/
>
> The current URL, polls/, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django 
> settings file. Change that to False, and Django will display a standard 
> 404 page.
>
> Since this is first ste of tutorial. I am not able to move forward. Thanx 
> for rely in advance.
>
> On Tuesday, 11 October 2016 02:12:30 UTC+5:30, Johnny McClung wrote:
>>
>> I am getting an error when I try to run the Django server. 
>>
>> >> mysite >> polls >> urls.py
>> from django.conf.urls import url
>>
>>
>> from . import views
>>
>> urlpatters = [
>> url(r'^$', views.index, name='index'),
>> ]
>>
>>
>>
>>
>> >> mysite >> mysite >> urls.py
>> from django.conf.urls import include, url
>> from django.contrib import admin
>>
>> urlpatterns = [
>> url(r'^polls/', include('polls.urls'))
>> url(r'^admin/', admin.site.urls),
>> ]
>>
>>
>>
>> Error:
>>
>> E:\Dropbox\Python Scripts\mysite>python manage.py runserver
>> Performing system checks...
>>
>> Unhandled exception in thread started by > check_errors..wrapper at 0x03F616A8>
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\autoreload.py",
>>  
>> line 226, in wrapper
>> fn(*args, **kwargs)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\commands\runserver.py",
>>  
>> line 121, in inner_run
>> self.check(display_num_errors=True)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\base.py",
>>  
>> line 374, in check
>> include_deployment_checks=include_deployment_checks,
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\base.py",
>>  
>> line 361, in _run_checks
>> return checks.run_checks(**kwargs)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\registry.py",
>>  
>> line 81, in run_checks
>> new_errors = check(app_configs=app_configs)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\urls.py",
>>  
>> line 14, in check_url_config
>> return check_resolver(resolver)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\urls.py",
>>  
>> line 24, in check_resolver
>> for pattern in resolver.url_patterns:
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\functional.py",
>>  
>> line 35, in __get__
>> res = instance.__dict__[self.name] = self.func(instance)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 313, in url_patterns
>> patterns = getattr(self.urlconf_module, "urlpatterns", 
>> self.urlconf_module)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\functional.py",
>>  
>> line 35, in __get__
>> res = instance.__dict__[self.name] = self.func(instance)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\urls\resolvers.py",
>>  
>> line 306, in urlconf_module
>> return import_module(self.urlconf_name)
>>   File 
>> "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
>>  
>> line 126, in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 986, in _gcd_import
>>   File "", line 969, in _find_and_load
>>   File "", line 958, in 
>> _find_and_load_unlocked
>>   File "", line 673, in _load_unlocked
>>   File "", line 661, in exec_module
>>   File "", line 767, in get_code
>>   File "", line 727, in 
>> source_to_code
>>   File "", line 222, in 
>> _call_with_frames_removed
>>   File "E:\Dropbox\Python Scripts\mysite\mysite\urls.py", line 21
>> url(r'^admin/', admin.site.urls),
>>   ^
>> SyntaxError: invalid syntax
>>
>>
>> Any help would be appreciated. Thank you. 
>>
>>

-- 
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 d

Re: Revoke celery task

2017-04-12 Thread Mauro Sánchez
Hello, I've found out my problem. It is that I am using Heroku, so when the 
worker is restarted, the revoked tasks list is lost.
How can I persist this list in Heroku? Since I cannot write a file in the 
filesystem.
Thanks a lot.

El miércoles, 12 de abril de 2017, 1:09:08 (UTC-3), Mauro Sánchez escribió:
>
> 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/1aa6e56f-667d-456d-bea5-d9818c4df3a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django - Updating multiple models from a form - Data does not saved

2017-04-12 Thread Bernardo Garcia


I have a custom User model to manage some profiles user: is_student, 
is_professor and is_executive


In this model, in addition, I have the get_student_profile(),
get_professor_profile() andget_executive_profile() methods to get the user 
profiles data of each user from my different views.


class User(AbstractBaseUser, PermissionsMixin):

email = models.EmailField(unique=True)
username = models.CharField(max_length=40, unique=True)
slug = models.SlugField(max_length=100, blank=True)
is_student = models.BooleanField(default=False)
is_professor = models.BooleanField(default=False)
is_executive = models.BooleanField(default=False)

def get_student_profile(self):
student_profile = None
if hasattr(self, 'studentprofile'):
student_profile = self.studentprofile
return student_profile

def get_professor_profile(self):
professor_profile = None
if hasattr(self, 'professorprofile'):
professor_profile = self.professorprofile
return professor_profile

def get_executive_profile(self):
executive_profile = None
if hasattr(self, 'executiveprofile'):
executive_profile = self.executiveprofile
return executive_profile


In addition each profile user is_student, is_professor and is_executive have 
their own model in where I manage their own data:



class StudentProfile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, 
on_delete=models.CASCADE)

slug = models.SlugField(max_length=100,blank=True)
origin_education_school = models.CharField(max_length=128)
current_education_school = models.CharField(max_length=128)
extra_occupation = models.CharField(max_length=128)
class ProfessorProfile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, 
on_delete=models.CASCADE)
slug = models.SlugField(max_length=100,blank=True)

class ExecutiveProfile(models.Model):
user = 
models.OneToOneField(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)
slug = models.SlugField(max_length=100,blank=True)


Is of this way that in my User model I override the save() method to denote 
that the usernamefield of an user which is created, to be equal in their 
value to the slug belonging to the profile user which will take that user (
StudentProfile, ProfessorProfile, ExecutiveProfile):



def save(self, *args, **kwargs):
user = super(User,self).save(*args,**kwargs)

# Creating an user with student, professor and executive profiles
if self.is_student and not 
StudentProfile.objects.filter(user=self).exists() \
and self.is_professor and not 
ProfessorProfile.objects.filter(user=self).exists() \
and self.is_executive and not 
ExecutiveProfile.objects.filter(user=self).exists():
student_profile = StudentProfile(user=self)
student_slug = self.username
student_profile.slug = student_slug

professor_profile = ProfessorProfile(user=self)
professor_slug = self.username
professor_profile.slug = professor_slug

executive_profile = ExecutiveProfile(user=self)
executive_slug = self.username
executive_profile.slug = executive_slug

student_profile.save()
professor_profile.save()
executive_profile.save()
# And so for all possibles profile combinations


To these three profiles which I have three forms in where their own fields 
are generated


class StudentProfileForm(forms.ModelForm):
class Meta:
model = StudentProfile
fields = ('origin_education_school', 'current_education_school',
'extra_occupation')
class ProfessorProfileForm(forms.ModelForm):
class Meta:
model = ProfessorProfile
fields = ('occupation',)
class ExecutiveProfileForm(forms.ModelForm):
class Meta:
model = ExecutiveProfile
fields = ('occupation', 'enterprise_name', 
'culturals_arthistic','ecological')



I access to view profile to user through of this URL:


url(r"^profile/(?P[\w\-]+)/$",
views.account_profiles__update_view,
name='profile'
),


In my function based view account_profiles__update_view() I am managing the 
request of the user, and creating the form instances (StudentProfileForm, 
ProfessorProfileForm, ExecutiveProfileForm) according to the profile to 
user (is_student, is_professor and is_executive)



@login_requireddef account_profiles__update_view(request, slug):
user = request.user
# user = get_object_or_404(User, username = slug)

# empty list
_forms = []
if user.is_student:
profile = user.get_student_profile()
_forms.append(forms.StudentProfileForm)
if user.is_professor:
profile = user.get_professor_profile()
_forms.append(forms.ProfessorProfileForm)
if user.is_executive:
profile = user.get_executive_profile()

Manage.py runserver is showing somthing else

2017-04-12 Thread Divya Rajpurohit
I started learning django a few days ago & i am trying to run a example project 
for a demo but when i put this command "manage.py runserver" it show so many 
lines on cmd promt & at end line showing 'invalid character' it's not showing 
those result which showed in documentation of django & for this i check my 
environment path but it having that /python36 i am using python in windows os 
if anyone knows what's going wrong tell me waiting for reply 

-- 
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/d4427871-2ff4-4e30-8d82-1607ad06eb1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django relationships and the admin page

2017-04-12 Thread Liam H
Yeah I was using the inlines. I actually came up with something of a 
workaround today. I put Location inlines in the Site page and then 
registered Locations on the admin page. Locations then have Image inlines. 
It's not as user friendly, but it will do as long as it works. I'll look 
into the nested admin package. Thanks for the help!

On Wednesday, 12 April 2017 00:43:00 UTC+1, Camilo Torres wrote:
>
> 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/508f692a-c094-4436-84f3-a4bd03d6d953%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unicode decoding error

2017-04-12 Thread Christophe Pettus

> On Apr 12, 2017, at 02:26, Antonis Christofides 
>  wrote:
> 
>> Does this mean I should globally replace "str(" with "|six.text_type(" in a
>> 2/3 codebase?|
> I don't think so; afaiu this must be done for the return value of __str__(), 
> not
> everywhere.

The rules as I understand them are:

1. Define __str__(), not __unicode__() on classes.
2. Decorate your class with @python_2_unicode_compatible.
3. Always return six.text_type from your __str__() function.
4. When casting a class instance to text, use six.text_type(), and not str() 
(unicode() still works, but it's not Python 3).

In Python 3, this is all a no-op: The __str__() method returns Python 3's 
string class, which is Unicode.
In Python 2, the decorator uses your __str__() method for the class' 
__unicode__() method, and creates a new __str__() method that returns a Python 
2 string (not unicode) object, UTF-8 encoded.

Personally, I would prefer to use the Python 2 'unicode' type everywhere I can 
in Python 2, so casting everything to six.text_type (and use from __future__ 
import unicode_literals etc.) would do that.

--
-- 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/8519F123-1AF9-47A1-A9DC-97C8046AE373%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does anyone in this group hire out to update code .

2017-04-12 Thread Bob Gailer
I'd be glad to take a look at the Django code. That way I could tell if I
have the expertise to help you , and yes, I am available for hire.

If you would give me access in some form to the Django modules and your
requirements I will let you know what I can do, and my cost estimate.

On Apr 11, 2017 8:26 PM,  wrote:

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

-- 
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/CAP1rxO4zN4DhML8HsN3KBDR8rRXRLLujcgf%2Bg-SPbmfgmqn56A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-04-12 Thread ludovic coues
I would search the function doing the redirection and look at what
information it use to make that redirection.

Either it is redirecting to a wrong url or something have gone wrong when
installing the brickly application.

2017-04-12 12:46 GMT+02:00 :

> Hi,
>
> I have solved validationError on django and now project redirecting on url
> "http://127.0.0.1:8000/brickly/home"; and its not found. so please let me
> know how to create it on django.
>
> here are page not found error coming. please let me know of what is the
> problem.
>
>
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/brickly/home
>
>
> 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/7f1af12d-50ba-48fb-8774-4c4f6c47be58%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%2BTZT3M8FMXb%2BmNiNgxvFSRKX3bmteDO1FmOvecL9BefHLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Yet Another Can't get static files to show up in shared linux website on Godaddy

2017-04-12 Thread René Fleschenberg
Hi,

Do *not* put your project into the webserver's document root. Doing so
will likely expose secret data (your source code including the database
password and SECRET_KEY).

Your STATIC_ROOT must be a location that your webserver serves under
STATIC_URL. If you cannot configure your webserver to do this, you can
use http://whitenoise.evans.io/en/stable/.

However, you will probably run into the same limitation when you want to
serve user-uploaded files ("media"), and whitenoise cannot help you
there. You will have to serve your media files from an external server,
such as Amazon S3.

I recommend deploying to an environment with WSGI support, btw. FCGI is
not supported anymore:
https://docs.djangoproject.com/en/1.8/howto/deployment/fastcgi/. If you
do not want to setup your own server, PythonAnywhere and Heroku are
popular choices.

Regards,
René


On 04/10/2017 07:47 AM, Anthony Percy wrote:
> Hi all,
> Sorry to ask this question but I cant get my static files in Mezzanine
> to show up on a Godaddy hosted site e.g http://www.murraybridge.co
> 
> I have had to use "pip install flup" and "pip
> install django-fastcgi-server" as Godaddy seems to have the fcgi module
> active on the apache webserver which I understand is now deprecated.
> The .htaccess file is in ~/public_html is ;
> 
> AddHandler fcgid-script .fcgi
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ mezproject.fcgi/$1 [QSA,L]
> 
> My "mezproject.fcgi" file in ~/public_html is;
> 
> /#!/home/vk2acp/code/mez/bin/python/
> /import sys, os/
> /# Add a custom Python path./
> /sys.path.insert(0, "/home/vk2acp/code/mezproject")/
> /# Switch to the directory of your project. (Optional.)/
> /os.chdir("/home/vk2acp/code/mezproject")/
> /# Set the DJANGO_SETTINGS_MODULE environment variable./
> /os.environ['DJANGO_SETTINGS_MODULE'] = "mezproject.settings"/
> /from django_fastcgi.servers.fastcgi import runfastcgi/
> /from django.core.servers.basehttp import get_internal_wsgi_application/
> /wsgi_application = get_internal_wsgi_application()/
> /runfastcgi(wsgi_application, method="prefork", daemonize="false",
> minspare=1, maxsp/
> /are=1, maxchildren=1)/
> 
> The "static" dir exists in the mezproject dir after I did "python
> manage.py collectstatic"
> I have tried copying  static dir to the public_html dir with no effect.
> Obviously I cant add the "Alias" directive as I have no control over the
> http.conf file.
> It seems a pity to get this far and run into this brick wall!!!
> Do I have to run the whole mez project from the public_html dir???
> Any suggestions?
> 
> Best Regards
> 
> Anthony
> 
> -- 
> 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/a38ab714-1903-4c92-a5d0-0b1455c29a75%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
René Fleschenberg

Am Stadtgarten 28, 45276 Essen, Germany
Phone: +49 1577 170 7363
E-Mail: r...@fleschenberg.net

-- 
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/ea4d419a-513c-4e03-571b-05311e51b4bd%40fleschenberg.net.
For more options, visit https://groups.google.com/d/optout.


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

2017-04-12 Thread nitin


I have solved validationError on django and now project redirecting on url "
http://127.0.0.1:8000/brickly/home"; and its not found. so please let me 
know how to create it on django.

here are page not found error coming. please let me know of what is the 
problem.







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/d2ccb5db-f64a-480f-aaf6-93ae8de04610%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-04-12 Thread nitin
Hi,

I have solved validationError on django and now project redirecting on url 
"http://127.0.0.1:8000/brickly/home"; and its not found. so please let me 
know how to create it on django.

here are page not found error coming. please let me know of what is the 
problem.


Page not found (404) 
Request Method: GET 
Request URL: http://127.0.0.1:8000/brickly/home


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/7f1af12d-50ba-48fb-8774-4c4f6c47be58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Nouveau site web

2017-04-12 Thread sfornengo
Hello tout le monde,

Ceci est un mail à tout mon carnet d'adresse, sans tri particulier, il se peut
donc que vous ne soyez pas directement concerné, mais c'était plus simple pour
moi !

Je suis fier de vous présenter mon dernier site web
[Mask.guru](https://mask.guru/) !  
C'est une évolution de mon vieux site paper-kit.com (pour ceux qui ont connu)
qui s'adresse à un public plus large avec une interface utilisateur simplifiée
et de nouvelles fonctionnalités, notamment un modeleur 3D **automatique** à
partir d'une simple photo (basé sur des réseaux de neurones) sur lequel j'ai
beaucoup travaillé et que je vous invite à tester
[ici](https://mask.guru/auto/), ne serait-ce que par curiosité !

Je serais heureux que vous diffusiez à vos contacts et sur vos réseaux sociaux
ainsi que d'avoir des retours constructifs (les plus simples comme les plus
techniques) si vous avez un petit peu de temps à perdre ;)  
L'objectif est de dénicher les derniers bugs avant un lancement officiel plus
large sur le web.

Merci d'avance,  
stf

-- 
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/58edf2e0.8985df0a.cea0f.d609%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unicode decoding error

2017-04-12 Thread Antonis Christofides
> Does this mean I should globally replace "str(" with "|six.text_type(" in a
> 2/3 codebase?|
I don't think so; afaiu this must be done for the return value of __str__(), not
everywhere.

Antonis Christofides
http://djangodeployment.com

On 2017-04-12 02:33, Mike Dewhirst wrote:
> 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/0b5fdb54-a011-d71c-3b22-ef542a419cdd%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-04-12 Thread ludovic coues
At this point, I usually start putting a lot of print statement, both in my
code and in library. That's one of the advantages of working in a
virtualenv.

My gut feeling is that on of the fields of Project is causing the
validation error. If I could read the code of the Project model, maybe I
could make a better guess. Maybe not.

You should try to find what value of what object/attribute is causing the
error. I use print for that job. A good debugger could do the trick too.

2017-04-12 8:19 GMT+02:00 :

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

Permissions in views

2017-04-12 Thread Meiyer
Just yesterday I bumped into an issue that left me puzzled for a while, and 
I want to verify if this is indeed the case before opening a bug ticket.

The documentation 
 
states the we can use either the {{ perms.my_app.update_obj }} tag  to 
display the result of a check for a specific permission "update_obj" within 
the my_app module/app, or the {{ perms.my_app }} tag to display the result 
of a check if the user has any permissions in the my_app module/app. Yet, 
when using the second variant, I suddenly had the whole permission set of 
the user dumped to the page. This is quite obvious when looking at 
the contrib\auth\context_processors.py code: when doing a {% if "my_app" in 
perms %} check it will land into the __contains__ method of PermWrapper 
while for an output such as {{ perms.my_app }}, it will land into the 
__getitem__ method that returns a PermLookupDict, in turn triggering the 
__repr__ method when displayed:

def __repr__(self):
return str(self.user.get_all_permissions()) 

This is clearly in odds with the documentation. So what is the expected 
result? Should {{ perms.my_app }} display a True or (at least, no more 
than) the permissions the user has in the my_app module/app?

-- 
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/d049489c-1200-46d6-b090-b02879caaf8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: what do i have to do first

2017-04-12 Thread Derek
If you're new to Python as well, you may need to look here first:

https://www.python.org/about/gettingstarted/

(Django assumes some familiarity with the basics of Python)

On Monday, 10 April 2017 16:17:19 UTC+2, Cyprus Carolyne wrote:
>
>  I am new to this platform, anyone help me find out how to start the 
> journey,
>
> I have windows ten, what do i have to install on my pc to get started?
>
> thank you
>

-- 
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/ed0ec048-857f-4941-84c2-bf4b849e0e7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.