handling multiple parallel request

2012-02-19 Thread rafiee.nima
hi
I want to develop a VIEW for cashier system which my receives multiple
parallel form as request  from deferent clients
I want to know how can I handle these request  ...is there any thing
like queue in django
tnx

-- 
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: handling multiple parallel request

2012-02-20 Thread rafiee.nima
tnx alot
but actually my scenario dose not deal with user so I thing cookies do
not help a lot
suppose there are 3 airline counter which fill ticket forms and send
them to the cashier maybe  simultaneously  .forms are sent to the
cashier which is just a function in my view ,,I want to know how I can
handle these simultaneous request ..I also should be concern about
power failure ( actually  It is important not to miss queued request
if there is any queue  )

On Feb 19, 7:29 pm, Dennis Lee Bieber  wrote:
> On Sun, 19 Feb 2012 06:27:19 -0800 (PST), "rafiee.nima"
>
>  wrote:
> >hi
> >I want to develop a VIEW for cashier system which my receives multiple
> >parallel form as request  from deferent clients
> >I want to know how can I handle these request  ...is there any thing
> >like queue in django
>
>         The first thing you need to understand is that HTML is stateless; by
> itself it has no knowledge or history of other activity -- not even for
> a single user, much less multiple users. Everything a server receives
> from a client is a new activity.
>
>         This is why browser "cookies" were invented. On the first connection
> a cookie is generated to identify the user-session and passed to the
> browser; all related connections have to return the cookie in order to
> identify which session this post applies to. The cookie may be used to
> retrieve transient information from a database (this is how the history
> of previous posts is maintained).
>
>         Since going back to the server for minor updates may be so costly,
> one may find lots of JavaScript in a page -- to handle collection and
> verification of data on a form, and only sending a complete transaction
> back to the server at the end. Or one advances into AJAX processing
> which may  be able to bypass the webserver itself for some stuff; this
> way the session/user information stays on the client browser while the
> JavaScript goes around the webserver [the "asynchronous" part of AJAX].
> --
>         Wulfraed                 Dennis Lee Bieber         AF6VN
>         wlfr...@ix.netcom.com    HTTP://wlfraed.home.netcom.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.



method for checking logged in user

2012-02-26 Thread rafiee.nima
Hi
I want to know is there any built in function to check if a user is
logged in
actually I want to check if a user from a request is logged in or not
tnx

-- 
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: Login Issues

2012-02-28 Thread rafiee.nima
hi
check if you import login view in url.py to be like this :
from django.contrib.auth.views import login

and also check your pattern in url.py to be like this :
site_media=os.path.join(os.path.dirname(__file__),'site_media')
urlpatterns = patterns(' ',
(r'^login/$',login), )
and dont change the location of login.html in registration.html



On Feb 28, 6:01 am, hack  wrote:
> I'm attempting to follow the instructions on the Django website and
> use the registration/login.html.  I created the file in myapp/
> registration/login.html.
>
> I've added the following to my urls.py file:
> url(r'^login/$', 'django.contrib.auth.views.login'),
>
> When I attempt to access /myapp/login I get the following error:
> Could not import hcp.views.django.contrib.auth.views. Error was: No
> module named django.contrib.auth.views
>
> I did setup my urls file by moving it into the myapp directory and
> putting the following in the original:
> url(r'^myapp/',include('myapp.urls')),
>
> Any suggestions on why django thinks the template doesn't exist?  Any
> help would be greatly appreciated.  Thanks.

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



Re: Login Issues

2012-02-28 Thread rafiee.nima
sorry
site_media=os.path.join(os.path.dirname(__file__),'site_media')   is
not needed it was a line of code from my own project :D

On Feb 28, 7:54 pm, "rafiee.nima"  wrote:
> hi
> check if you import login view in url.py to be like this :
> from django.contrib.auth.views import login
>
> and also check your pattern in url.py to be like this :
> site_media=os.path.join(os.path.dirname(__file__),'site_media')
> urlpatterns = patterns(' ',
>     (r'^login/$',login), )
> and dont change the location of login.html in registration.html
>
> On Feb 28, 6:01 am, hack  wrote:
>
>
>
>
>
>
>
> > I'm attempting to follow the instructions on the Django website and
> > use the registration/login.html.  I created the file in myapp/
> > registration/login.html.
>
> > I've added the following to my urls.py file:
> > url(r'^login/$', 'django.contrib.auth.views.login'),
>
> > When I attempt to access /myapp/login I get the following error:
> > Could not import hcp.views.django.contrib.auth.views. Error was: No
> > module named django.contrib.auth.views
>
> > I did setup my urls file by moving it into the myapp directory and
> > putting the following in the original:
> > url(r'^myapp/',include('myapp.urls')),
>
> > Any suggestions on why django thinks the template doesn't exist?  Any
> > help would be greatly appreciated.  Thanks.

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



signals

2012-03-10 Thread rafiee.nima
I want to listen to pre  ( or post ) save signal from a special model
in my models but the problem is in listen function I can not mention a
specific model . it gets signal from all models but I want to just use
signal from a specific models
I would tnx for any idea

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



django and jquery data grids

2012-06-25 Thread rafiee.nima
Hi 
I want to know what is the most compatible and straight forward  jquery 
data grid plugin for django
and also how I can integrated jqgrid with django 

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



error : need more than 1 value to unpack

2012-07-04 Thread rafiee.nima
Hi I got below error from my view which handle ajax request 

 need more than 1 value to unpack

here is my code

def add_room(request):
context={}
status=''
if request.is_ajax:
if request.POST:
hotel_instance=Hotel.objects.get(request.POST['hotel'])
if request.POST['id'] > 0 :
room=HotelRoom.objects.get(id=request.POST['id'])
room.hotel=hotel_instance
room.number=request.POST['number']
room.bed_count=request.POST['bed_count']
room.ground_sleep=request.POST['ground_sleep']
room.view=request.POST['view']
room.reserved=request.POST['reserved']
room.tv=request.POST['tv']
room.phone=request.POST['phone']
room.refrigerator=request.POST['refrigerator']
room.air_condition=request.POST['air_condition']
room.toilet=request.POST['toilet']
room.creator=request.user
room.save()
else:
room = HotelRoom(
hotel=hotel_instance,
number=request.POST['number'],
bed_count=request.POST['bed_count'],
ground_sleep=request.POST['ground_sleep'],
view=request.POST['view'],
reserved=request.POST['reserved'],
tv=request.POST['tv'],
phone=request.POST['phone'],
refrigerator=request.POST['refrigerator'],
air_condition=request.POST['air_condition'],
toilet=request.POST['toilet'],
creator=request.user )
room.save()

return HttpResponse({status:'success'}, mimetype="application/json")

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-E9oadkhuuUJ.
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: error : need more than 1 value to unpack

2012-07-04 Thread rafiee.nima
Oh 
I find out my mistake :D 

On Wednesday, July 4, 2012 12:38:11 PM UTC+4:30, rafiee.nima wrote:
>
> Hi I got below error from my view which handle ajax request 
> hotel_instance=Hotel.objects.get(id=request.POST['hotel'])
>  need more than 1 value to unpack
>
> here is my code
>
> def add_room(request):
> context={}
> status=''
> if request.is_ajax:
> if request.POST:
> hotel_instance=Hotel.objects.get(request.POST['hotel'])
> if request.POST['id'] > 0 :
> room=HotelRoom.objects.get(id=request.POST['id'])
> room.hotel=hotel_instance
> room.number=request.POST['number']
> room.bed_count=request.POST['bed_count']
> room.ground_sleep=request.POST['ground_sleep']
> room.view=request.POST['view']
> room.reserved=request.POST['reserved']
> room.tv=request.POST['tv']
> room.phone=request.POST['phone']
> room.refrigerator=request.POST['refrigerator']
> room.air_condition=request.POST['air_condition']
> room.toilet=request.POST['toilet']
> room.creator=request.user
> room.save()
> else:
> room = HotelRoom(
> hotel=hotel_instance,
> number=request.POST['number'],
> bed_count=request.POST['bed_count'],
> ground_sleep=request.POST['ground_sleep'],
> view=request.POST['view'],
> reserved=request.POST['reserved'],
> tv=request.POST['tv'],
> phone=request.POST['phone'],
> refrigerator=request.POST['refrigerator'],
> air_condition=request.POST['air_condition'],
> toilet=request.POST['toilet'],
> creator=request.user )
> room.save()
>
> return HttpResponse({status:'success'}, mimetype="application/json")
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/fNXaSuOjeKcJ.
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: error : need more than 1 value to unpack

2012-07-04 Thread rafiee.nima
tnx ;)

On Wednesday, July 4, 2012 1:03:37 PM UTC+4:30, Jon Black wrote:
>
>   You're also returning mimetype="application/json" outside of the 
> request.is_ajax check. I doubt you want that.
>  On Wed, Jul 4, 2012, at 01:20, rafiee.nima wrote:
>
> Oh  
> I find out my mistake :D 
>
> On Wednesday, July 4, 2012 12:38:11 PM UTC+4:30, rafiee.nima wrote: 
>
> Hi I got below error from my view which handle ajax request  
> hotel_instance=Hotel.objects.get(id=request.POST['hotel'])
>   need more than 1 value to unpack
>   
>  here is my code
>   
>  def add_room(request):
>  context={}
>  status=''
>  if request.is_ajax:
>  if request.POST:
>  hotel_instance=Hotel.objects.get(request.POST['hotel'])
>  if request.POST['id'] > 0 :
>  room=HotelRoom.objects.get(id=request.POST['id'])
>  room.hotel=hotel_instance
>  room.number=request.POST['number']
>  room.bed_count=request.POST['bed_count']
>  room.ground_sleep=request.POST['ground_sleep']
>  room.view=request.POST['view']
>  room.reserved=request.POST['reserved']
>  room.tv=request.POST['tv']
>  room.phone=request.POST['phone']
>  room.refrigerator=request.POST['refrigerator']
>  room.air_condition=request.POST['air_condition']
>  room.toilet=request.POST['toilet']
>  room.creator=request.user
>  room.save()
>  else:
>  room = HotelRoom(
>  hotel=hotel_instance,
>  number=request.POST['number'],
>  bed_count=request.POST['bed_count'],
>  ground_sleep=request.POST['ground_sleep'],
>  view=request.POST['view'],
>  reserved=request.POST['reserved'],
>  tv=request.POST['tv'],
>  phone=request.POST['phone'],
>  refrigerator=request.POST['refrigerator'],
>  air_condition=request.POST['air_condition'],
>  toilet=request.POST['toilet'],
>  creator=request.user )
>  room.save()
>   
>  return HttpResponse({status:'success'}, mimetype="application/json")
>  
>   
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/fNXaSuOjeKcJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>
>

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



problem with django model method save()

2012-07-04 Thread rafiee.nima
Hi Im some how new to django . I write a view to handle ajax request
but I find out that save() method dose not save model instance in to the 
database
here is my code 

def add_room(request):
context={}
status=''
if request.is_ajax:
if request.POST:
hotel_instance=Hotel.objects.get(id=request.POST['hotel'])
room_id=int(request.POST['id'])
if room_id > 0 :
room=HotelRoom.objects.get(id=request.POST['id'])
room.hotel=hotel_instance
room.number=request.POST['number']
room.bed_count=request.POST['bed_count']
room.ground_sleep=request.POST['ground_sleep']
room.view=request.POST['view']
room.reserved=request.POST['reserved']
room.tv=request.POST['tv'].capitalize()
room.phone=request.POST['phone']
room.refrigerator=request.POST['refrigerator']
room.air_condition=request.POST['air_condition']
room.toilet=request.POST['toilet']
room.creator=request.user
room.save()
room_json=model_to_dict(room)
status="room successfully updated"
else:
room = HotelRoom(
hotel=hotel_instance,
number=request.POST['number'],
bed_count=request.POST['bed_count'],
ground_sleep=request.POST['ground_sleep'],
view=request.POST['view'],
reserved=request.POST['reserved'],
tv=request.POST['tv'],
phone=request.POST['phone'],
refrigerator=request.POST['refrigerator'],
air_condition=request.POST['air_condition'],
toilet=request.POST['toilet'],
creator=request.user )
room.save()
status="new room successfully added "
raw_data={'status':status,'data':room_json}
data=simplejson.dumps(raw_data)
return HttpResponse(data, mimetype="application/json")

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



using vars() function in django

2012-08-12 Thread rafiee.nima
Hi I need to to assign dynamic name to a variable I use blow code :
 for item,value in request.POST.items():
 if item=="kid_room"
vars()[item]="ok"
list.append({"a":kid_room})
data=simplejson.dumps(list,cls=DjangoJSONEncoder)
return HttpResponse(data, mimetype="application/json")

which kid_room is request.POST item 
but i got error that kid_room is not defined which means vars()[item]="ok" 
dose not work
please help 





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



problem with integrating bootstrap 3.1.1 and django 1.6

2014-03-09 Thread rafiee.nima
hi

I am new to bootstarp and I want to use it in my django project.
I put the needed folder's(css , js , img) in my project static folder and 
config my setting.py to access static directory
I can access bootstrap.css from http:///..myprojecet/static/bootstrap.css 
which means I correctly config setting.py
but the problem is that no bootstrap style applied to my temeplates. (I 
also check in  firebug if css and js files been inclueded )

here is my base.html code that other templates inhierent from it

{% load static %}





 

 


  Dropup
  

Toggle Dropdown
  
  
  

{% block body_block %}
{% endblock %}









-- 
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/d1141e5f-7972-47c0-a88a-4a00fd1709b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with integrating bootstrap 3.1.1 and django 1.6

2014-03-09 Thread rafiee.nima


On Sunday, March 9, 2014 10:29:37 PM UTC+3:30, Camilo Torres wrote:
>
> On Sunday, March 9, 2014 12:11:11 PM UTC-4:30, rafiee.nima wrote:
>>
>> I am new to bootstarp and I want to use it in my django project.
>> I put the needed folder's(css , js , img) in my project static folder and 
>> config my setting.py to access static directory
>> I can access bootstrap.css from http:///..myprojecet/static/bootstrap.css 
>> which means I correctly config setting.py
>> but the problem is that no bootstrap style applied to my temeplates. (I 
>> also check in  firebug if css and js files been inclueded )
>>
>> here is my base.html code that other templates inhierent from it
>>
>> {% load static %}
>> 
>> 
>> 
>> 
>> 
>>  > media="screen">
>> 
>>  
>> 
>> 
>>   Dropup
>>   > data-toggle="dropdown">
>> 
>> Toggle Dropdown
>>   
>>   
>>   
>> 
>> {% block body_block %}
>> {% endblock %}
>>
>> 
>> 
>> 
>> 
>>
> Hello,
>
> This URL looks bad:  http:///..myprojecet/static/bootstrap.css
> What is in your settings.py?
> Should it be: {% static 'bootstrap.min.css'% }?
>


tnx for reply 
the actual ulr was http://127.0.0.1:8000/static/css/bootstrap.min.css which 
I use to test if I correctly configure static path and url in my setting.py 
I attached my setting.py  

-- 
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/008d8e89-6d8b-4867-a19d-c3db6ce54e6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"""
Django settings for tango_with_django_project project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ip1$@b#8a3$nz=l0e*ij@3(t%ouid$gc^!6qxshw5a(g3sv8&u'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rango',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'tango_with_django_project.urls'

WSGI_APPLICATION = 'tango_with_django_project.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'rango.db'),
}
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True
LOGIN_URL = '/rango/login/'

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/

STATIC_URL = '/static/'
MEDIA_URL = '/media/'

TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'),)
STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'),)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)


TEMPLATE_CONTEXT_PROCESSORS=(

"django.contrib.auth.context_processors.auth",
'django.core.context_processors.request',
 "django.core.context_processors.debug",
 "django.core.context_processors.i18n",
 "django.core.context_processors.media",
 "django.core.context_processors.static",
 "django.core.context_processors.tz",
 "django.contrib.messages.context_processors.messages"
)



Re: problem with integrating bootstrap 3.1.1 and django 1.6

2014-03-15 Thread rafiee.nima
I'm using development server . and when i use   it 
seems work correctly but when I use   my project file and directory structure is like :

   1. root project folder
   1. app folder
   2. static
  1. css
 1. bootstarp.css
 2. js
  3. img
  3. media 
   4. template
  1. app 
  1. base.html
 


On Friday, March 14, 2014 7:49:32 PM UTC+3:30, Tom Evans wrote:
>
> On Fri, Mar 14, 2014 at 2:33 AM, Camilo Torres 
> > 
> wrote: 
> > python manage.py startapp testapp 
> > 
> > Inside the newly created test app directory, create static/css/ and put 
> your 
> > file there. Now try to reload your template to see if the template 
> loads. 
> > 
> > This may make it work for you, but in your case, is not the final 
> solution. 
> > You may need to actually put these static files that are 'site global' 
> in a 
> > central location in your filesystem, let's say: 
> /var/www/static/(css|js|etc) 
> > 
> > To do that, you need to add a setting to your settings.py: 
> > 
> > STATICFILES_DIRS = ( 
> > '/var/www/static/', 
> > ) 
> > 
> > That way you put all of your static site wide files inside 
> subdirectories in 
> > a common path. 
>
> This advice is wrong, do not copy your static files from 
> /static to a folder listed in STATICFILES_DIRS. 
>
> STATICFILES_DIRS is a list of _additional_ project folders that are 
> searched for files _in addition_ to your application static files. 
>
> However, you do need to copy the files from your application static 
> directories _and_ your project static file directories to the 
> directory specified by STATIC_ROOT. You do not do this manually, the 
> management command collectstatic does this for you. You also only need 
> to do this in production, in development (using runserver), the static 
> files are served for you by runserver. 
>
> For complete info on static files, there is an excellent step-by-step doc: 
>
> https://docs.djangoproject.com/en/1.6/howto/static-files/ 
>
> Cheers 
>
> Tom 
>

-- 
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/3b32d61d-3465-4c00-87a5-f11dfb33e702%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: error in AUTHENTICATION using socialregistration

2014-04-14 Thread rafiee.nima
did you add facebook namespace in your main project urls.py  ? 

On Friday, May 17, 2013 11:20:34 AM UTC+4:30, Avnesh Shakya wrote:
>
> hi,
>I am getting error -  
>   
>   NoReverseMatch at /login/ 
>
>u'facebook' is not a registered namespace inside 'socialregistration'
>
> when I am clicking on login link. I have installed all required things using 
> documantation - 
>
> http://django-socialregistration.readthedocs.org/en/latest/contrib/facebook.html
> but it's showing error.
> Please help me... I am unable to find this error.
>
> settings.py- i have added-
> INSTALLED_APPS = (
> 'apps.socialregistration',
> 'apps.socialregistration.contrib.facebook',
> )
>
> and
> AUTHENTICATION_BACKENDS = (
> 'django.contrib.auth.backends.ModelBackend',
> 'apps.socialregistration.contrib.facebook.auth.FacebookAuth',
> )
>
> FACEBOOK_APP_ID = '278691145597349'
> FACEBOOK_SECRET_KEY = '359ed87e4cc3b3cdf2e567f7ab043d8c'
>
> and in login.html page
> i have added-
> {% load facebook %}
> {% facebook_button %}
>
> thanks in advance.
>
>

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


error in using socialregistration

2014-04-14 Thread rafiee.nima
Hi 
Im using django socialregistration i configure everything step by step 
using  socialregistration doc. i also add sit_id .but i got this error : 


Exception Type: TypeError at /social/linkedin/redirect/
Exception Value:  is not JSON serializable

-- 
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/b7a66432-cd3c-47ae-a83e-a203f87d03e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: error in using socialregistration

2014-04-14 Thread rafiee.nima
I'v fixed the problem by adding

SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer'
to setting.py 


On Monday, April 14, 2014 8:41:10 PM UTC+4:30, rafiee.nima wrote:
>
> Hi 
> Im using django socialregistration i configure everything step by step 
> using  socialregistration doc. i also add sit_id .but i got this error : 
>
>
> Exception Type: TypeError at /social/linkedin/redirect/
> Exception Value:  object at 0xb49c97ec> is not JSON serializable
>

-- 
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/f6d30ada-04e6-4a9b-9ea1-8179b735ce43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Exception Value: (502, 'Error: command "EHLO" not implemented')

2014-04-20 Thread rafiee.nima
Hi

Im using django send mail and here is my view code . 

def send(request):
send_mail('subject', 'message, 'mym...@gmail.com', 
['mym...@gmail.com'], fail_silently=False)

and I got thie error : 

Traceback:

  110. self.connection.sendmail(from_email, recipients, 
message.as_bytes())
File "/usr/lib/python2.7/smtplib.py" in sendmail
  710. self.ehlo_or_helo_if_needed()
File "/usr/lib/python2.7/smtplib.py" in ehlo_or_helo_if_needed
  537. raise SMTPHeloError(code, resp)

Exception Type: SMTPHeloError at /user/send/
Exception Value: (502, 'Error: command "EHLO" not implemented')

if anyboy can 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/6d67f44e-1f31-4c64-a5a4-0ca9a8516af1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.