Re: Model proxy in admin fails with 404 when updating

2014-08-09 Thread Eric Tanter
Thanks Collin for sharing your "hacky" solution. It does indeed work. It's 
not as neat as a proper redirect to the parent category, but I don't have 
the django skills to come up with something better. Hopefully someone will 
chime in with a better solution. Meanwhile, I'm adopting your trick. Thanks 
again!

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


Re: Error in shell when following Django tutorial

2014-08-09 Thread Collin Anderson

>
> >>> from polls.model import Poll, Choice

>>> from polls.model*s* import Poll, Choice

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


Re: Model proxy in admin fails with 404 when updating

2014-08-09 Thread Collin Anderson
Ahh yes, I have this exact same problem. Here's my current, hacky solution:

class ActivePersonAdmin(PersonAdmin):
def get_queryset(self, request):
if request.path == '/admin/app/activeperson/':  # HACK
return Person.objects.filter(active=True)  # filtered 
changelist page qs
else:
return Person.objects.all()  # unfiltered qs for change page

I'm curious what you end up doing because I'm not happy with my solution.

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


Model proxy in admin fails with 404 when updating

2014-08-09 Thread Eric Tanter
Hi there,

I am using a model proxy to separate model entities into two categories in 
the admin (more precisely, to separate "active persons" from all persons). 
The separation of whether a person model belongs to the "active" category 
is based on a status field in the model.

The problem I am facing is that if I am editing an active person through 
its change form (url .../activeperson/12/) and change its status so that it 
is no longer active, the admin interface fails with a 404 error (logical, 
because person #12 is no longer active). 

The appropriate behavior in this case would be to redirect to the 
non-active category (url .../person/12/). 
Is this possible? How would you advise me to implement such a redirection?

(in general: could this make sense as a default behavior for proxy models 
in the admin? -- try to lookup in the super (non-proxy) model before 
failing with a 404?)

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ea5bb1e9-b91d-4823-a671-131be6471cc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error in shell when following Django tutorial

2014-08-09 Thread Ramiro Morales
Ramiro Morales
@ramiromorales
On Aug 9, 2014 7:13 PM, "Daniel Grace"  wrote:
>
> I get an error in the shell when following the tutorial
> https://docs.djangoproject.com/en/1.6/intro/tutorial01/
>
> C:\Users\Daniel\My Documents\Python\DjangoTest\mysite>python manage.py
shell
> Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64
bit (AM
> D64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from polls.model import Poll, Choice
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named 'polls.model'
> >>> from polls.model import Poll, Choice
>

The name the Python module you've created/modified in a prior step and need
to import now is 'models'. Note how it's in plural while you are trying to
import 'model'.

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


Error in shell when following Django tutorial

2014-08-09 Thread Daniel Grace
I get an error in the shell when following the tutorial
https://docs.djangoproject.com/en/1.6/intro/tutorial01/

C:\Users\Daniel\My Documents\Python\DjangoTest\mysite>python manage.py shell
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 
bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from polls.model import Poll, Choice
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'polls.model'

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


Error in shell when following Django tutorial

2014-08-09 Thread Daniel Grace
I get an error in the shell when following the tutorial
https://docs.djangoproject.com/en/1.6/intro/tutorial01/

C:\Users\Daniel\My Documents\Python\DjangoTest\mysite>python manage.py shell
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 
bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from polls.model import Poll, Choice
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'polls.model'
>>> from polls.model import Poll, Choice

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


Not getting create table statements as described in the tutorial

2014-08-09 Thread Daniel Grace
I am following the tutorial 
at https://docs.djangoproject.com/en/1.6/intro/tutorial01/
I typed in the command: python manage.py sql polls
but there were no messages, and I did not get the create statements that 
are mentioned in the tutorial.
I'm not sure what is going on.

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


Re: DJANGO SERVER objects lifecycle

2014-08-09 Thread Collin Anderson
Imports are cached, so only the first "import x" or import_module("x")
will run the code and generate a "module" object that gets cached in
sys.modules(?). Using "import" again will just return the same module
object from sys.modules. You can verify with a print statement in a
module that code only gets run once.

The interpreter isn't re-launched every time and we don't guarantee
any startup performance.

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


DJANGO SERVER objects lifecycle

2014-08-09 Thread alexandre...@gmail.com
Hi 

getting into web development from a C, C++ (non web).
I read and understand quite well the django framework code... but I cannot 
grasp yet the object life cycle.
I follow the WSGIHandler and BaseHandler, and seemed to me that at every 
single reuqest, the urls is imported, and in that the admin autodiscover, 
all models admins etc
Does everything is created for a request?
Is the python interpreter in NGINX + uwsgi + django launched everytime?

Can anyone give me somelight or direct me some reading on this, I really 
want to have a good grasp on everything that is happening on the execution 
model and objects lifetime.

Regards
Alexandre Rua

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


Re: creating project in Django

2014-08-09 Thread Mariusz Wilk
the first one returns: *No such file or directory*
the second one: *Not recognised as a command* (my translation from Polish)


This worked before (a week ago):

django-admin.py startproject mysite

But then I deleted the whole mysite folder (cause of some problems) and 
started all over again. Now I can't even start a new project.  

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


Re: creating project in Django

2014-08-09 Thread Collin Anderson
This might also work, without the .py:

django-admin startproject mysite

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


Re: creating project in Django

2014-08-09 Thread Collin Anderson
Try this:

python django-admin.py startproject mysite


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


Re: 3 weeks of images proproblems

2014-08-09 Thread Collin Anderson

>
> templates
>
>1.  
>
> should be : 

 

> settings.py
>
>
>1. MEDIA_ROOT = '/home/yems/var/www/bluepearlhotel/media/'
>2. MEDIA_URL = 'http://www.127.0.0.1:8000/media/'
>
> You may have better luck with this simpler MEDIA_URL:
MEDIA_ROOT = '/home/yems/var/www/bluepearlhotel/media/'
MEDIA_URL = '/media/'


> models.py
>
>
>- image = models.ImageField(upload_to='images/', blank=True)
>
> That's perfect. What does the rest of your model look like? How is it 
connected to your Post model?
 

>
> views .py
>
> def detail_post(request, blogs_id):
> try:
> blogs = Post.objects.get(pk=blogs_id)
> except Post.DoesNotExist:
> raise 404
> return render_to_response('detailp.html', {'blogs': blogs})


Looks ok to me, but how does your image get into the template?

>
> urls 
> from django.conf.urls import patterns, include, url
>
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> #new urls
> url(r'^blog/$', 'blog.views.list_post'),
> url(r'^blog/(?P\d+)/$', 'blog.views.detail_post'),
>  #events urls
> url(r'^event/$', "event.views.list_event"),
> url(r'^event/(?P\d+)/$', "event.views.detail_event"),
>
> #image urls
> url(r'^gallery/$', "gallery.views.list_gallery"),
> url(r'^gallery/(?P\d+)/$', "gallery.views.detail_gallery"),
> 
> #url(r'^gallery/(?P\d+)/album/$',"gallery.views.detail_album"),
>
>  #HOME URL
> url(r'^home/$', "home.views.list_home"),
> url(r'^home/(?P\d+)/$', "home.views.detail_home"),
>
>
>
> url(r'^admin/', include(admin.site.urls)),
>
> )

add a static() line for you MEDIA_ROOT at the very bottom:

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = patterns('',
# ... the rest of your URLconf goes here ...
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


https://docs.djangoproject.com/en/1.7/howto/static-files/#serving-files-uploaded-by-a-user-during-development
 

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


creating project in Django

2014-08-09 Thread Mariusz Wilk
according to the official tutorial I need to type the following to the cmd 
in the directory where I want to create my project.:

django-admin.py startproject mysite

I created a folder named "site" on my desktop, cd into it and typed the 
obove command. Nothing appeared in "site". Instead, Python authomatically 
opened with the following:


#!C:\Python27\python.exe
from django.core import management

if __name__ == "__main__":
management.execute_from_command_line()


Do you know what's going on?

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


Re: deploying djnago on apache

2014-08-09 Thread teagom
Hello!

Maybe this "how to" help you!
http://teago.futuria.com.br/tip/instalando-modulo-wsgi-no-apache-2-com-django-14/

Tiago

On Thursday, August 7, 2014 3:01:47 PM UTC-3, ngangsia akumbo wrote:
>
> nano bluepearlhotel.wsgi
>
>
> import os
> import sys
> sys.path = ['/var/www/bluepearlhotel'] + sys.path
> os.environ['DJANGO_SETTINGS_MODULE'] = 'bluepearlhotel.settings'
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
>
>
> yems@yems /etc/apache2/sites-available $ 
>
>
>
> 
> WSGIScriptAlias / /home/yems/bluepearlhotel.wsgi
>
> ServerName  bluepearlhotel.com
>
> Alias /static /var/www/bluepearlhotel/static/
>
> 
> Order allow,deny
> Allow from all
> 
> 
>
> i created the project 
>
>
> so when i type bluepearlhotel.com
>
> it gives me this error
>
> Forbidden
>
> You don't have permission to access / on this server.
> Apache/2.4.7 (Ubuntu) Server at bluepearlhotel.com Port 80
>
>
>
>
>
>

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


Re: Python Brasil [10] - Call for papers

2014-08-09 Thread Helton Alves
This year the PYBR will be "FODA". \o


2014-08-09 15:30 GMT+01:00 Renato Oliveira :

> Hi all,
>
> You have until tomorrow to submit your talk to Python Brasil [10].
>
> http://2014.pythonbrasil.org.br/dashboard/proposals/
>
> The conference will be amazing! See why:
>
> Our Keynotes -> http://2014.pythonbrasil.org.br/speakers/
>
> Our Venue -> http://2014.pythonbrasil.org.br/news/the-conference-venue/
>
> And on November 9th were going to have some activities (TBA) like scuba
> diving, standup paddle
> 
>  and
> others!
>
> Thanks and see you in Porto de Galinhas!
>
> Renato Oliveira
> @_renatooliveira 
> Labcodes - www.labcodes.com.br
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGPLouU_jBpejAhbwSZ3d_6FYWSJ5jFj5u8xW%3DgRjZXSEfz9jw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Helton Alves 
Desenvolvedor web
Graduado em Sistemas de Informação - FACIMP
Cursando Metodologia do Ensino Superior - INESPO

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


Python Brasil [10] - Call for papers

2014-08-09 Thread Renato Oliveira
Hi all,

You have until tomorrow to submit your talk to Python Brasil [10].

http://2014.pythonbrasil.org.br/dashboard/proposals/

The conference will be amazing! See why:

Our Keynotes -> http://2014.pythonbrasil.org.br/speakers/

Our Venue -> http://2014.pythonbrasil.org.br/news/the-conference-venue/

And on November 9th were going to have some activities (TBA) like scuba
diving, standup paddle

and
others!

Thanks and see you in Porto de Galinhas!

Renato Oliveira
@_renatooliveira 
Labcodes - www.labcodes.com.br

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


Re: Starting with Python 3 and Django 1.x?

2014-08-09 Thread François Schiettecatte
I would go with Python 3, string handling is much better and the library layout 
is a little more rational. I am stuck with 2.7 for the websites I develop but I 
have been using 3 for the attending scripts with no issues. If you do decide to 
go with 2.7 I would add the following to each file to make sure that a future 
migration to 3 is as painless as possible.

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division


François

On Aug 9, 2014, at 8:33 AM, Ari Davidow  wrote:

> If I stick to Python 2.7, I start off with a host of Unicode issues--not a 
> promising way to start a site that relies on Unicode, Middle Eastern 
> character sets, and bidi functionality. I hate the last-century, Python 2 
> ways of dealing with those. That makes no sense, barring something more 
> compelling than the statement, "stick to python 2.7".
> 
> ari
> 
> 
> On Sat, Aug 9, 2014 at 4:09 AM, ngangsia akumbo  wrote:
> stick to python 2.7
> 
> collins anderson can i meet u on skype? mine is 
> 
> skype:  ngangsi.richard
> 
> 
> 
> 
> On Friday, August 8, 2014 11:53:30 PM UTC+1, Collin Anderson wrote:
> I'd start with 1.7 as it should be more friendly to newcomers. There will be 
> another release candidate soon and the final version should be out in about a 
> month.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/d2864620-4d13-4d41-9d6d-cad5b31dc589%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAF%2BxBDVVTBSo39oVJ9eAPC9h_VwOdwo9JsSq1Y%2BTK2Jenu7Ecw%40mail.gmail.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E570EE98-0691-404B-A1D8-DBA7112AF42B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


3 weeks of images proproblems

2014-08-09 Thread ngangsia akumbo
I have been having problem uploading image from admin and for it to deplay 
on the page

Here is my config

   
templates

   1.  


settings.py


   1. MEDIA_ROOT = '/home/yems/var/www/bluepearlhotel/media/'
   2. MEDIA_URL = 'http://www.127.0.0.1:8000/media/'


models.py


   - image = models.ImageField(upload_to='images/', blank=True)


views .py

def detail_post(request, blogs_id):
try:
blogs = Post.objects.get(pk=blogs_id)
except Post.DoesNotExist:
raise 404
return render_to_response('detailp.html', {'blogs': blogs})


urls 
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
#new urls
url(r'^blog/$', 'blog.views.list_post'),
url(r'^blog/(?P\d+)/$', 'blog.views.detail_post'),
 #events urls
url(r'^event/$', "event.views.list_event"),
url(r'^event/(?P\d+)/$', "event.views.detail_event"),

#image urls
url(r'^gallery/$', "gallery.views.list_gallery"),
url(r'^gallery/(?P\d+)/$', "gallery.views.detail_gallery"),

#url(r'^gallery/(?P\d+)/album/$',"gallery.views.detail_album"),

 #HOME URL
url(r'^home/$', "home.views.list_home"),
url(r'^home/(?P\d+)/$', "home.views.detail_home"),



url(r'^admin/', include(admin.site.urls)),

)

When i upload an image it actually upload to the right position, but when i 
open the page i shows image break

when i do inspeck element i see this


   1. 

Please i need 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c9aee775-fbe8-4078-9265-1658edeaae32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Starting with Python 3 and Django 1.x?

2014-08-09 Thread Ari Davidow
If I stick to Python 2.7, I start off with a host of Unicode issues--not a
promising way to start a site that relies on Unicode, Middle Eastern
character sets, and bidi functionality. I hate the last-century, Python 2
ways of dealing with those. That makes no sense, barring something more
compelling than the statement, "stick to python 2.7".

ari


On Sat, Aug 9, 2014 at 4:09 AM, ngangsia akumbo  wrote:

> stick to python 2.7
>
> collins anderson can i meet u on skype? mine is
>
> skype:  ngangsi.richard
>
>
>
>
> On Friday, August 8, 2014 11:53:30 PM UTC+1, Collin Anderson wrote:
>>
>> I'd start with 1.7 as it should be more friendly to newcomers. There will
>> be another release candidate soon and the final version should be out in
>> about a month.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d2864620-4d13-4d41-9d6d-cad5b31dc589%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF%2BxBDVVTBSo39oVJ9eAPC9h_VwOdwo9JsSq1Y%2BTK2Jenu7Ecw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: deploying django

2014-08-09 Thread ngangsia akumbo

i have two probe so far uploading images and hosting on apache

those are the probes i face now, my images dont show up on the templates 
i am suing django 1.4
On Friday, August 8, 2014 4:29:45 PM UTC+1, ngangsia akumbo wrote:
>
> is there an easier way to host your django website for testing
>
> i am really getting frustrated, is flask more easier than django?
>
> i really want to use django but am getting frustrated
>

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


Re: Starting with Python 3 and Django 1.x?

2014-08-09 Thread ngangsia akumbo
stick to python 2.7

collins anderson can i meet u on skype? mine is 

skype:  ngangsi.richard



On Friday, August 8, 2014 11:53:30 PM UTC+1, Collin Anderson wrote:
>
> I'd start with 1.7 as it should be more friendly to newcomers. There will 
> be another release candidate soon and the final version should be out in 
> about a month.
>

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


uploading images

2014-08-09 Thread ngangsia akumbo
can some one refee to me a good guide that can properly explain a step by 
step guide on how to upload images in module and view them on the template.

The django documentation does not explicitly explain that section well

i am using django 1.4 

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