Re: ImportError at/ No module name

2012-12-20 Thread djangobie
I appreciate your response, but it cannot be the case, as my app is present 
in top level dir along with manage.py and project file container i.e. 
'djangopratice': 

*my dir structure is:*
--
djangopractice-
 --djangopractice-
   - __init__.py
   - settings.py
   - urls.py
   - wsgi.py

 --blog-
   - models.py
   - views.py
   - admin.py
   - __init__.py
   - test.py

 --Templates-
  - base.html
  - index.html
  - view_category.html
  - view_posts.html
-


P.S I tried it before posting the question.
Thanks

On Thursday, December 20, 2012 7:22:05 PM UTC+5, sandy wrote:
>
> Make installed apps as : 
>
> INSTALLED_APPS = ( 
>  'django.contrib.auth', 
>  'django.contrib.contenttypes', 
>  'django.contrib.sessions', 
>  'django.contrib.sites', 
>  'django.contrib.messages', 
>  'django.contrib.staticfiles', 
>  'django.contrib.admin', 
>  'django.contrib.admindocs', 
>  'djangopractice.blog', 
> ) 
>
> Hope this helps. 
>
> -- 
> Sandeep Kaur 
> E-Mail: mkaur...@gmail.com  
> Blog: sandymadaan.wordpress.com 
>

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



Re: ImportError at/ No module name

2012-12-20 Thread djangobie
Can someone kindly look into this.

On Thursday, December 20, 2012 6:27:42 PM UTC+5, djangobie wrote:
>
> Hi, I have just started practicing a tutorial for buidling a  basic blog ( 
> http://www.djangorocks.com/tutorials/how-to-create-a-basic-blog-in-django/starting-your-application.html
>  )
>
> Did exactly the same (except, using 'djangopractice' as project name 
> instead of 'djangorocks')
> Actually It also did run twice, but than started showing ImportError.
>
> My files:
> 
> ***settings.py***
> 
> # Django settings for djangopractice project.
> #import os, django
> #DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
> #SITE_ROOT = os.path.dirname(os.path.realpath('__file__'))
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 
> 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'djangopractice',  # Or path to 
> database file if using sqlite3.
> 'USER': 'root',  # Not used with sqlite3.
> 'PASSWORD': '1290',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for 
> localhost. Not used with sqlite3.
> 'PORT': '',  # Set to empty string for 
> default. Not used with sqlite3.
> }
> }
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> TIME_ZONE = 'Asia/Karachi'
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded 
> files.
> # Example: "/home/media/media.lawrence.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://media.lawrence.com/media/";, "http://example.com/media/
> "
> MEDIA_URL = ''
>
> # Absolute path to the directory static files should be collected to.
> # Don't put anything in this directory yourself; store your static files
> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> # Example: "/home/media/media.lawrence.com/static/"
> STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://media.lawrence.com/static/";
> STATIC_URL = '/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> # List of finder classes that know how to find static files in
> # various locations.
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> #'django.contrib.staticfiles.finders.DefaultStorageFinder',
> )
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '@io!2+0*rw1o0tjq%t5zb8e$v(wf3p#yk_8#lb^%hrerzijwt1'
>
> # List of callables that know how to import templates from various sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.template.loaders.app_directories.Loader',
> # 'django.template.loaders.eggs.Loader',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> # Uncomment the next line for simple clickjacking protection:
> # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
>
> ROOT_URLCONF = 'djangopractice.urls'
>
> # Python dotted path to the WSGI application used by Django's runserver.
> WSGI_APPLICATION = 'djangopractice.wsgi.application'
>
> TEMPLATE_DIRS = (
> "/home/username/djangosites/djangopractice/Templates"
> # Put strings here, like "/home/html/django_templates" or 
> "C:/www/django/templates".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> IN

Re: Django community, is it active?

2012-12-20 Thread Sithembewena Lloyd Dube
"Working with a framework is like any relationship... you make sacrifices..
*the love you get back depends on what you put in*.." - hehe ... moving on
swiftly ...

Vis. the bears, I can only recommend bear spray - and a good one, at that.

To address the queries at hand - coming from several languages and
platforms, I was asking the same questions a few years ago. I evaluated
other popular MVC frameworks and stuck with Django. Not a regret had to
date.

- Django "just works" for a large share of "general" uses. The admin app is
a boon for those not too keen on reinventing the wheel when it comes to
"must-have" admin site functionality
- Django documentation is the amongst the best of any framework docs I have
had to consult. It is updated frequently and is never lagging too far back
from the current framework release. I will refrain from mentioning the
names of certain alternatives in this regard
- the Django community is sizeable and very active
- Django plays well on an array of development platforms. Linux, Windows,
Mac? Behaviour is consistent. This would be attributable in no small part
to Python's own cross-platform usability.
- Python. I do appreciate that the right tool must be used for each job,
but I am also still waiting to see that tool which would outdo Python in
most problem domains, at least relating to developer productivity.

On Thu, Dec 20, 2012 at 4:34 PM, patrick wrote:

> Two good resources off the top of my head (among many others that will
> probably be mentioned):
>
> Buddy Lindsey's GoDjango screencasts, they cover some good ground:
> http://godjango.com
>
> Also like Kenneth Love and Chris Jones' articles at  http://brack3t.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-pgwVdiekTYJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards,
Sithu Lloyd Dube

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



Re: Django community, is it active?

2012-12-20 Thread Sithembewena Lloyd Dube
"Working with a framework is like any relationship... you make sacrifices..
*the love you get back depends on what you put in*.." - hehe ... moving on
swiftly ...

Vis. the bears, I can only recommend bear spray, or a dictionary -
dependent on one's particular circumstances.

To address the queries at hand - coming from several languages and
platforms, I was asking the same questions a few years ago. I evaluated
other popular MVC frameworks and stuck with Django. Not a regret had to
date.

- Django "just works" for a large share of "general" uses. The admin app is
a boon for those not too keen on reinventing the wheel when it comes to
"must-have" admin site functionality
- Django documentation is the amongst the best of any framework docs I have
had to consult. It is updated frequently and is never lagging too far back
from the current framework release. I will refrain from mentioning the
names of certain alternatives in this regard
- the Django community is sizeable and very active
- Django plays well on an array of development platforms. Linux, Windows,
Mac? Behaviour is consistent. This would be attributable in no small part
to Python's own cross-platform usability.
- Python. I do appreciate that the right tool must be used for each job,
but I am also still waiting to see that tool which would outdo Python in
most problem domains, at least relating to developer productivity.


On Thu, Dec 20, 2012 at 4:34 PM, patrick wrote:

> Two good resources off the top of my head (among many others that will
> probably be mentioned):
>
> Buddy Lindsey's GoDjango screencasts, they cover some good ground:
> http://godjango.com
>
> Also like Kenneth Love and Chris Jones' articles at  http://brack3t.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-pgwVdiekTYJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards,
Sithu Lloyd Dube

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



Re: Converting Django app into a Desktop app

2012-12-20 Thread Mike Dewhirst
See also https://us.pycon.org/2012/schedule/presentation/393/ by Ryan 
Kelly and his 'esky' package for safely updating distributed apps. There 
is a link to that and other items in the above pycon talk.


Mike


On 21/12/2012 9:55am, Filip Wasilewski wrote:

Hi,

On Tuesday, December 18, 2012 5:06:19 PM UTC+1, Loai Ghoraba wrote:

Hi

I am very comfortable with Django, and I was wondering about whether
there is some way to convert a Django web app into a Desktop app
(may be not 100%), so that I can distribute it to users. May be
wrapping it in a light web server "if there is something like this".


I've been recently going through the process of distributing Django web
application with binary dependencies (NumPy/SciPy) as an one-click
executable. I have evaluated several solutions and the most effective
was creating a single-file binary package using PyInstaller
(pyinstaller.org, development version with some modifications for proper
dependency discovery). As for the web server I went with the pure-Python
CherryPy server (cherrypy.org). See https://gist.github.com/4349257 for
sample server script.


Filip
en.ig.ma

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


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



Re: Converting Django app into a Desktop app

2012-12-20 Thread Filip Wasilewski
Hi,

On Tuesday, December 18, 2012 5:06:19 PM UTC+1, Loai Ghoraba wrote:
>
> Hi
>
> I am very comfortable with Django, and I was wondering about whether there 
> is some way to convert a Django web app into a Desktop app (may be not 
> 100%), so that I can distribute it to users. May be wrapping it in a light 
> web server "if there is something like this". 
>

I've been recently going through the process of distributing Django web 
application with binary dependencies (NumPy/SciPy) as an one-click 
executable. I have evaluated several solutions and the most effective was 
creating a single-file binary package using PyInstaller 
(pyinstaller.org, development version with some modifications for proper 
dependency discovery). As for the web server I went with the pure-Python 
CherryPy server (cherrypy.org). See https://gist.github.com/4349257 for 
sample server script.


Filip
en.ig.ma

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



Re: Can't display data from app in flatpages

2012-12-20 Thread Jason Arnst-Goodrich
The flatpages view is not provided the context which includes 'posts'.

IMO you are correct with the {% load posts %} technique because it is 
entirely as result of the template you are using that requires you display 
that information -- if that makes sense.

In other words it's not because of the flatpage you are loading but rather 
the template you are using which necessitates the 'posts' being used.

On Wednesday, December 19, 2012 8:40:21 PM UTC-8, Frank Valcarcel wrote:
>
> I have a Django app called blogengine which does exactly what the name 
> implies. I can't seem to get data from blogengine (posts) to display in 
> templates when they're called by flatpages. I'm new to Django but I assume 
> this is a urls.py issue.
>
> My urls.py:
>
> from django.conf.urls.defaults import patterns, include, urlfrom 
> blogengine.views import PostsFeed
> # Uncomment the next two lines to enable the admin:from django.contrib import 
> admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # Uncomment the admin/doc line below to enable admin documentation:
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
>
> # Home page
> url(r'^$', 'blogengine.views.getPosts'),
> url(r'^(\d+)/?$', 'blogengine.views.getPosts'),
>
> # tinyMCE
> (r'^tinymce/', include('tinymce.urls')),
>
> # Blog posts
> url(r'^\d{4}/\d{1,2}/([-a-zA-Z0-9]+)/?$', 'blogengine.views.getPost'),
>
> # Categories
> url(r'^categories/(\w+)/?$', 'blogengine.views.getCategory'),
> url(r'^categories/(\w+)/(\d+)/?$', 'blogengine.views.getCategory'),
>
> # Comments
> #url(r'^comments/', include('django.contrib.comments.urls')),
>
> # RSS feeds
> url(r'^feeds/posts/$', PostsFeed()),
>
>
> # Flat pages
> #url(r'', include('django.contrib.flatpages.urls')),
> #not needed since '...middleware.FlatpageFallbackMiddleware' is installed 
> in settings.py
>
> )
>
> Would it be better practice to create a tag so I could just call {% load 
> posts %} when and where I need it?
>
> I can call them up by normal means by using  {% if posts %}...{% for post 
> in posts %}  but trying to use this in flatpages that call the same 
> template section of the page displays nothing. Any ideas?
>

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



Re: how to send confirmation mail

2012-12-20 Thread Timothy Makobu
Where specifically are you stuck? We need more details.


On Thu, Dec 20, 2012 at 9:49 AM, Randa Hisham  wrote:

> how to send confirmation mail and encryprted ink
> --
> Randa Hesham
> Software Developer
>
> Twitter:@ro0oraa 
> FaceBook:Randa Hisham 
>
> ٍ
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Django community, is it active?

2012-12-20 Thread patrick
Two good resources off the top of my head (among many others that will 
probably be mentioned):

Buddy Lindsey's GoDjango screencasts, they cover some good ground: 
http://godjango.com

Also like Kenneth Love and Chris Jones' articles at  http://brack3t.com

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



Re: ImportError at/ No module name

2012-12-20 Thread Sandeep kaur
Make installed apps as :

INSTALLED_APPS = (
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'djangopractice.blog',
)

Hope this helps.

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

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



Re: Django community, is it active?

2012-12-20 Thread djangobie
Great question, and welcome to the group.
I found quite few helpful posts here. and as per stats there are around 1k+ 
new posts every month.
Me too, looking forward to some good blogs.
-http://lincolnloop.com/blog/categories/django/ (Technical articles)
-http://jacobian.org/writing/ (General to Technical)

And for your " Does it have a real future and please be honest." some 
latest stats : 
http://jacobian.org/writing/django-community/django-community-2012/

On Wednesday, December 19, 2012 2:36:42 AM UTC+5, Glyn Jackson wrote:
>
> I'm hoping this is the right place to ask such questions, please forgive 
> me if not.
>
> I'm making a real time investment in learning another server side 
> language. I have 10 years ColdFusion, 5 years  PHP, JAVA. Having never 
> touched Python let alone the framework Django, for the past 4 weeks I have 
> been testing Django out. Darn, Raspberry Pi started me with my blog (
> http://www.glynjackson.org/blog/) I have to say its nice, however my 
> concerns are now to do with the community and not so much with the 
> framework itself.
>
> No one likes to back a loser and every time I search for Django community 
> I'm faced with a host of negative posts. for example: 
> http://news.ycombinator.com/item?id=2777883  
>
> Unlike other languages I'm active in and still use, I'm also finding it 
> hard to find any user groups locally in the UK (I'm based in Manchester, 
> UK).
>
> So from the community itself how alive is Django? Should I really invest 
> the time to learn? Does it have a real future and please be honest.
>
> other questions
>
> 1) is this worth going? --- http://2013.djangocon.eu
> 2) who are the top blogs people within the Django community who should I 
> be following, blogs feed etc.
>
> Sorry for the stupid questions, but and just want a new skillset that I 
> can use for many years to come. Django is really cool
>
>
>
>
>
>
>
>
>
>

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



ImportError at/ No module name

2012-12-20 Thread djangobie
Hi, I have just started practicing a tutorial for buidling a  basic blog ( 
http://www.djangorocks.com/tutorials/how-to-create-a-basic-blog-in-django/starting-your-application.html
 )

Did exactly the same (except, using 'djangopractice' as project name 
instead of 'djangorocks')
Actually It also did run twice, but than started showing ImportError.

My files:

***settings.py***

# Django settings for djangopractice project.
#import os, django
#DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
#SITE_ROOT = os.path.dirname(os.path.realpath('__file__'))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 
'mysql', 'sqlite3' or 'oracle'.
'NAME': 'djangopractice',  # Or path to 
database file if using sqlite3.
'USER': 'root',  # Not used with sqlite3.
'PASSWORD': '1290',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for 
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for default. 
Not used with sqlite3.
}
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Asia/Karachi'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded 
files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/";, "http://example.com/media/";
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/";
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '@io!2+0*rw1o0tjq%t5zb8e$v(wf3p#yk_8#lb^%hrerzijwt1'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'djangopractice.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'djangopractice.wsgi.application'

TEMPLATE_DIRS = (
"/home/username/djangosites/djangopractice/Templates"
# Put strings here, like "/home/html/django_templates" or 
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'blog',
)

# A sample logging configuration. The only tangible logging
# per

A new kind of blocktrans that works with an unknown format string and a dictionary containing substitutes.

2012-12-20 Thread Kal Sze
Hello,

While trying to develop my first real Django project, I have come across an 
*apparent* need to i18n'ize any arbitrary, unknown format string, with an 
accompanying dictionary that contains the substitutes to insert into the 
translated format string. For instance, I have a template that is displayed 
when a certain SomeError is raised:

except SomeError as error:
render_to_response('myapp/some_error.html',
   { 'the_error': error },
   context_instance=RequestContext(request))

I expect the SomeError object to contain information to be displayed to the 
user. Specifically, SomeError will have a format_string attribute and a 
substitute_dict attribute. The content of format_string is chosen at 
runtime, but it is assumed that translations exist. For instance, 
format_string could be:

"{{user}}, you cannot upload this video because you are out of quota. 
You only have {{capacity}} out of {{quota}} left in your account."

or it could be:

"{{user}}, you cannot upload this video because it is in a format that 
we don't accept ({{video_format}})."

Now assume that French, Spanish, Chinese, etc. translations exist for the 
two example strings above.

And substitute_dict would contain the correct substitute strings. For 
instance:

{
'user': 'Alice',
'capacity': '50 MB',
'quota': '20 GB',
}

or

{
'user': 'Alice',
'video_format': '3ivx',
}

As you can imagine, even Django's built-in {% blocktrans %} tag doesn't 
seem to help here, for two reasons (as far as I understand):

   1. it requires the substitutes to be explicitly declared and bound to 
   variables right in the template file;
   2. it requires the i18n string to be spelled out between {% blocktrans %}
and {% endblocktrans %}; it cannot work with an i18n string that is 
   itself inside a variable.

Which means that I apparently need a new template tag, maybe something 
called {% blockdicttrans format_string substitute_dict %}.

Is this madness? Have I overlooked some Django or Pythonic way? Or is it 
actually a justifiable use case?

Cheers,
Kal

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



Re: ajax

2012-12-20 Thread Ehab Ahmed
hello

see this tutorial :

http://www.pythondiary.com/tutorials/django-and-ajax-jquery.html





 From: Randa Hisham 
To: django-users@googlegroups.com 
Sent: Wednesday, December 19, 2012 2:11 PM
Subject: ajax
 

hey,
if i wana use ajax in my django project
could i use jquery or dajax liberary

-- 

Randa Hesham
Software Developer

Twitter:@ro0oraa
FaceBook:Randa Hisham

ٍ

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

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



ImportError at/ No module name

2012-12-20 Thread Nabeel Ahmed
Hi, I have just started practicing a tutorial for buidling a  basic blog ( 
http://www.djangorocks.com/tutorials/how-to-create-a-basic-blog-in-django/starting-your-application.html
 )

Did exactly the same (except, using 'djangopractice' as project name 
instead of 'djangorocks')
Actually It also did run twice, but than started showing ImportError.

My files:

***settings.py***

# Django settings for djangopractice project.
#import os, django
#DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
#SITE_ROOT = os.path.dirname(os.path.realpath('__file__'))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 
'mysql', 'sqlite3' or 'oracle'.
'NAME': 'djangopractice',  # Or path to 
database file if using sqlite3.
'USER': 'root',  # Not used with sqlite3.
'PASSWORD': '1290',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for 
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for default. 
Not used with sqlite3.
}
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Asia/Karachi'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded 
files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/";, "http://example.com/media/";
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/";
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '@io!2+0*rw1o0tjq%t5zb8e$v(wf3p#yk_8#lb^%hrerzijwt1'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'djangopractice.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'djangopractice.wsgi.application'

TEMPLATE_DIRS = (
"/home/nabeel/djangosites/djangopractice/Templates"
# Put strings here, like "/home/html/django_templates" or 
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'blog',
)

# A sample logging configuration. The only tangible logging
# perfo

how to send confirmation mail

2012-12-20 Thread Randa Hisham
how to send confirmation mail and encryprted ink
-- 
Randa Hesham
Software Developer

Twitter:@ro0oraa 
FaceBook:Randa Hisham 

ٍ

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



Re: trouble with pre_delete signal method

2012-12-20 Thread Thomas Orozco
It's great that you could find where the issue is coming from!

Cheers,

Thomas


2012/12/20 Mike Dewhirst 

> On 19/12/2012 11:58pm, Thomas Orozco wrote:
>
>> Hi,
>>
>> If you have no relationship, I'm a bit at a loss. I think the easier
>> way would be to use a debugger if possible.
>>
>> I think we need to know what field is causing the ValidationError.
>> The line that's causing an error is in the to_python method of the
>> ModelChoiceField object.
>>
>> Basically, you'll need to use a debugger to extract as much
>> information from that object to be able to tell which field it is.
>> (ModelChoiceField.queryset will give you the list of objects that can
>> fit in that field. It could help).
>>
>
> Thomas
>
> I adjusted the error message in ModelChoiceField to include the key, value
> and the actual error raised. This revealed the problem. Thanks for pointing
> me in the right direction.
>
> It is raising DoesNotExist and nominating the first B record which would
> be deleted according to my code.
>
> This says it is already deleted. Which leads me to believe my code is
> deleting it unexpectedly as far as the Admin is concerned.
>
> I believe the Admin is built to delete records itself and won't cope with
> records being deleted behind its back. It must be designed to consider such
> a thing as an integrity error.
>
> If I adjust my code to simply null the item_id then everything looks good
> and I end up with a bunch of orphaned records in the database. Lucky its
> just a prototype :)
>
> I don't think I can do anything about this. It would need an Admin dev to
> figure out what to do. My inclination would be a meta option to signal that
> ModelChoiceField needn't worry if the record does not exist.
>
> Thanks for all your effort
>
> Much appreciated
>
> Mike
>
>
>
>> (See https://github.com/django/**django/blob/master/django/**
>> forms/models.py#L988
>> )
>>
>>
>>
>> On a side note, I can't see how your delete_bparts method would work:
>>
>> When you don't want to delete, you join using '' ( bpart.a_partcodes =
>> ' '.join(acodes) )
>> But you split using split(), which splits on whitespace: acodes =
>> bpart.a_partcodes.split()
>>
>> Am I missing something here?
>>
>
> It must be a typo because I actually join using a space.
>
>
>
>>
>>
>> Last, would you mind sharing the bpart.a_partcodes code ?
>>
>>
>> Cheers,
>>
>>
>> Thomas
>>
>> 2012/12/19 Mike Dewhirst :
>>
>>> Thomas
>>>
>>> Thanks for replying
>>>
>>>
>>> On 19/12/2012 12:06am, Thomas Orozco wrote:
>>>

 Hi,


 Could you provide the following information?
   - What's the relationship between A and B (model code of the
 field,
 if there is, would be great)

>>>
>>>
>>> There is no relationship at all. A and B are separately and independently
>>> related to Item.
>>>
>>> A and B are actually copied from 'a' and 'b' which *are* related but
>>> exist
>>> purely as a stand-alone reference. When Item gets an A record (and it can
>>> have many) it is copied from its 'a' reference record. Item then
>>> automatically gets copies of all the corresponding 'b' reference records
>>> as
>>> B records - except duplicates are semi-skipped.
>>>
>>> Where a duplicate would have occurred, I append the A_code into a special
>>> field on the B record to indicate which A records were/are "interested"
>>> in
>>> that B record. When A records are deleted, it is necessary to delete
>>> their
>>> corresponding B records - unless another A record is still interested in
>>> which case we just remove the deleted A_code from the special field.
>>>
>>> I could send you the model code off-list if you wish.
>>>
>>>
>>>- The code of your pre_delete signal handler / the method it
 calls.

>>>
>>>
>>> #  this lives in models.A_Part.py   #   #   #
>>>
>>> from django.db.models.signals import pre_delete, post_delete
>>>
>>> def cleanup_bparts(sender, instance, **kwargs):
>>>  instance.item.delete_bparts(a_**code=instance.a_code)
>>>
>>> pre_delete.connect(cleanup_**bparts, sender=A_Part, weak=False)
>>> #post_delete.connect(cleanup_**bparts, sender=A_Part, weak=False)
>>>
>>> #   #   #   #   #   #   #   #   #   #   #   #
>>>
>>> ... and the item.delete_bparts() code ...
>>>
>>>
>>> def delete_bparts(self, a_code):
>>>  qs_bpart = B_Part.objects.filter(item=**self,
>>>   a_partcodes__contains=a_code)
>>>  for bpart in qs_bpart:
>>>  acodes = bpart.a_partcodes.split()
>>>  if len(acodes) == 1:
>>>  bpart.delete()
>>>  else:
>>>  acodes.remove(a_code)
>>>  bpart.a_partcodes = ' '.join(acodes)
>>>  bpart.save()
>>>
>>>
>>>
 I think you have a ForeignKey field that is required or limited and that
 is causing the ValidationError.
 Indeed, that line 988 is in the code for ModelChoiceField

>>>
>>>
>>> I have been through a

Re: ajax

2012-12-20 Thread Joey "JoeLinux" Espinosa

Sorry, accidentally sent the email before the link:

http://therealjoelinux.blogspot.com/2011/11/making-ajax-calls-in-django-using-dojo.html

*Joey "JoeLinux" Espinosa*
Software Developer
http://about.me/joelinux

On 12/20/2012 06:18 AM, Joey "JoeLinux" Espinosa wrote:

Randa,

You really could use any AJAX library you want. AJAX is just a 
front-end web request, so as long as you've provided Django a way to 
"catch" that request (a URL in urls.py, a view in views.py, etc), then 
there should be no problem.


Here's a rudimentary example for running a Python script via AJAX that 
I wrote last year (should still apply today):


*Joey "JoeLinux" Espinosa*
Software Developer
http://about.me/joelinux
On 12/20/2012 01:39 AM, jirka.vejra...@gmail.com wrote:

Yes

*From: * Randa Hisham 
*Sender: * django-users@googlegroups.com
*Date: *Wed, 19 Dec 2012 13:11:35 +0200
*To: *
*ReplyTo: * django-users@googlegroups.com
*Subject: *ajax

hey,
if i wana use ajax in my django project
could i use jquery or dajax liberary

--
Randa Hesham
Software Developer

Twitter:@ro0oraa 
FaceBook:Randa Hisham 

ٍ
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




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



Re: ajax

2012-12-20 Thread Joey "JoeLinux" Espinosa

Randa,

You really could use any AJAX library you want. AJAX is just a front-end 
web request, so as long as you've provided Django a way to "catch" that 
request (a URL in urls.py, a view in views.py, etc), then there should 
be no problem.


Here's a rudimentary example for running a Python script via AJAX that I 
wrote last year (should still apply today):


*Joey "JoeLinux" Espinosa*
Software Developer
http://about.me/joelinux
On 12/20/2012 01:39 AM, jirka.vejra...@gmail.com wrote:

Yes

*From: * Randa Hisham 
*Sender: * django-users@googlegroups.com
*Date: *Wed, 19 Dec 2012 13:11:35 +0200
*To: *
*ReplyTo: * django-users@googlegroups.com
*Subject: *ajax

hey,
if i wana use ajax in my django project
could i use jquery or dajax liberary

--
Randa Hesham
Software Developer

Twitter:@ro0oraa 
FaceBook:Randa Hisham 

ٍ
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


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



What are the required options in order to enable djangodblog for error logging in a MySQL database?

2012-12-20 Thread dariyoosh


Hello everybody,

I would like to ask a question about djangodblog used for logging real time 
Django exceptions 
into the application database. I use the following tools for my project

*Database:* 5.5.28 MySQL Community Server

*OS*: Fedora Core 17 (X86_64)

*Django* 1.4.2

*Python* 2.7.3

According to what I read in Jim McGaw's book : "Beginning Django 
E-Commerce" 
I defined my *settings.py* including the following items:

*DEBUG =** False*...*MIDDLEWARE_CLASSES **= (*
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'djangodblog.DBLogMiddleware',
*djangodblog**.middleware.DBLogMiddleware**',*
)
.
.
.*INSTALLED_APPS = (*
#'django.contrib.auth',
#'django.contrib.contenttypes',
#'django.contrib.sessions',
#'django.contrib.sites',
#'django.contrib.messages',
#'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
*'**djangodblog',*)

Once I run:

*python -tt manage.**py syncdb*

All tables were created successfully (I checked by connecting to the 
database). 
However, *it seems that djangodblog is not active as there is no row 
inserted 
whenever there is an exception*. For example, let's say, you specify a 
template 
that does not yet exist or the directory path to the template is not 
correct. In this case, 
Django raises exceptions such as TemplateDoesNotExist (which you can see in 
the 
browser as a printed error StackTrace if the DEBUG is set to True within 
project settings.py).

Consequently, I would like to ask is there any further parameter to 
define/enable? 
in order to force Django to update error logs in MySQL as they happen in 
real time?

Thanks in advance,

Regards,
Dariyoosh


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



Re: how to use jquery onclick event and django inclusion_tag/assignment_tag?

2012-12-20 Thread Andriyko
Thank you for the quick and clean answer. It is one more entry in my todo 
list - Ajax! 

On Wednesday, December 19, 2012 9:00:39 PM UTC+2, ke1g wrote:
>
>
>
> On Wed, Dec 19, 2012 at 1:34 PM, Andriyko 
> > wrote:
>
>> Hello dear Django Users!
>>
>> I'm trying to use django inclusion_tag or/and assignment_tag with jquery 
>> 'onclick' event.
>> Encountered such problems:
>> 1. When using inclusion_tag/assignment_tag the content returned by them 
>> is rendered on page load, not onclick.
>> And I suspect that it is correct behavior, once the tag is met it is 
>> rendered by template render. So, I think that should be some way to skip 
>> django tags? How?
>>
>> 2. With inclusion_tag the result returned by tag is shown in the place 
>> where it was called, not where it is 'intended' to be.
>> And again, I think it is correct. But how to use inclusion_tag really 
>> onclick event?
>> For example,
>> ---
>> 
>> $(function() {
>> var result = $("#select-result").empty();
>> $('#myid').somecontainer({animate:true,
>> onClick: function(node){
>>result.html('{% my_inclusion_tag "param1" "param2" 
>> %}');
>> }
>> });
>> });
>> 
>> ---
>> As the result(in source of loaded page) I have content returned by 
>> inclusion_tag inside , not under  #select-result div.
>> Like 
>> ...
>> onClick: function(node){
>>result.html(lalalala);
>>  }
>> ...
>>
>> The code that works as expected :), onclick not onload.
>>
>> 
>> $(function() {
>> var result = $("#select-result").empty();
>> $('#myid').somecontainer({animate:true,
>> onClick: function(node){
>>alert(node.text);
>> }
>> });
>> });
>> 
>>
>>
>> The tags are just a feature of the template language.  Their purpose is 
> to render the response that django will send to the browser.  There is no 
> automatic coupling to actions in the browser.  As you note, by the time 
> that the initial page load completes, the tags have finished all that they 
> are going to do.
>
> I'm guessing that what you want calls for an AJAX scheme: You arrange for 
> click to produce an AJAX request (there is jquery support), which the 
> browser sends back to a specified (almost certainly different) url (but 
> probably on the same server/django).  Your urlconf must route this to a 
> view that recognizes the AJAX request, and returns data (xml, json, ...) 
> needed to define the content that you want to show, and returns it as a 
> response.  When this arrives back at the browser, a JavaScript function 
> that you have designated as the AJAX request's success callback is invoked 
> with access to the returned data.  This function must modify the DOM 
> according to the data.
>
> Bill
>
>

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



Re: Django community, is it active?

2012-12-20 Thread peter

On 12/19/2012 07:09 PM, Glyn Jackson wrote:

@Odagi

point well made. thanks for everyone for being so welcoming :0 I spent 
today building my first Django local site,
ended up with 4 apps. taken me awhile to get my head around things i 
ended up with


registration
  - handles my user signed
security
 - login, logout
web
 - flat pages etc
- rewards
 - a simple api link to an existing platform in java

given this was my first time really playing with the framework, well 
it conforms to what i'm use to in java and ColdFusion,
views are almost the same as CF MVC. at some point i will do a write 
up on my blog http://www.glynjackson.org/blog/ (plug, plug)


so i have some of the basic stuff down with models and views, I'm sure 
i will have lost of stupid questions in the coming months.


I go to some cons so why not add another one to my list (my wife will 
kill me)!!!



again thanks :)





I'm pretty glad, that you found django helpful for you.

There is no stupid questions. There are only stupid answers





On Tuesday, December 18, 2012 9:36:42 PM UTC, Glyn Jackson wrote:

I'm hoping this is the right place to ask such questions, please
forgive me if not.

I'm making a real time investment in learning another server side
language. I have 10 years ColdFusion, 5 years  PHP, JAVA. Having
never touched Python let alone the framework Django, for the past
4 weeks I have been testing Django out. Darn, Raspberry Pi started
me with my blog (http://www.glynjackson.org/blog/
) I have to say its nice,
however my concerns are now to do with the community and not so
much with the framework itself.

No one likes to back a loser and every time I search for Django
community I'm faced with a host of negative posts. for example:
http://news.ycombinator.com/item?id=2777883


Unlike other languages I'm active in and still use, I'm also
finding it hard to find any user groups locally in the UK (I'm
based in Manchester, UK).

So from the community itself how alive is Django? Should I really
invest the time to learn? Does it have a real future and please be
honest.

other questions

1) is this worth going? --- http://2013.djangocon.eu
2) who are the top blogs people within the Django community who
should I be following, blogs feed etc.

Sorry for the stupid questions, but and just want a new skillset
that I can use for many years to come. Django is really cool









--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/IEh4i5vg2qAJ.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


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



Re: Entity has an event Lifecycle, how does Django do it?

2012-12-20 Thread Glyn Jackson
@Russel, right, now I know what i'm looking for it makes it easier lol. 
thank you signals is what I needed.

On Wednesday, December 19, 2012 11:29:28 PM UTC, Russell Keith-Magee wrote:
>
> Hi Glyn,
>
> What you're calling "events", Django calls "signals" [1]. In particular, 
> I'm guessing you're looking for the pre_save and post_save signals.
>
> [1] https://docs.djangoproject.com/en/dev/topics/signals/
>
> Yours,
> Russ Magee %-)
>
> On Wed, Dec 19, 2012 at 5:53 PM, Glyn Jackson 
> > wrote:
>
>> In other languages and frameworks I have used when you have an entity 
>> such as user. Each entity has an event lifecycle i.e. post update, pre 
>> update, post save etc
>>
>> The following code below is my first save using Django. But its looks 
>> very messy, it should be than user has a pre create for member and member 
>> has a pre create for user depending on which way you are coming at it 
>> In Django is this possible?  
>>
>>
>> in my views.py
>>
>>
>>  user = User.objects.create_user(
>> 
>> username=form.cleaned_data.get()['username'],
>> 
>> email=form.cleaned_data['email'], 
>> 
>> password=form.cleaned_data['password']
>> )
>> user.save()
>> member = Member(
>> user=user,
>> name=form.cleaned_data['name']
>> )
>> member.save()
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/M2vbXJQCJQAJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

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