Re: Django Deployment showing list of directory

2017-10-19 Thread sarfaraz ahmed
This is been fixed

On Monday, 8 May 2017 15:39:25 UTC+5:30, sarfaraz ahmed wrote:
>
> Hello Guys,
>
> After lot of struggle I understood there is no MOD_WSGI file available for 
> latest version of XAMP which is compiled in VC14. I am not sure how to 
> compile MOD_WSGI with VC 14 so I gave up
>
> Now I downloaded Apache 2.4 compiled in VC9 + Python 2.7.13 on my windows 
> server 2016(AWS instance) I moved my website to this server. Changed 
> firewall setting to accepting incoming traffic and also networking 
> configuration. 
>
> Now I am seeing the list of directory and files instead of website. 
>
> Here is my wsgi.py file
>
> --
> import os
> import sys
> from django.core.wsgi import get_wsgi_application
> sys.path.append('C:\Apache24\htdocs\testarhamcollections\')
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project1.settings")
> application = get_wsgi_application()
>
> -
>
>
> This is conf file for Apache
>
> --
> 
> ServerAdmin ad...@testarhamcollections.com
> DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
> ServerName www.testarhamcollections.com
> ServerAlias testarhamcollections.com
> ErrorLog 
> "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-error.log"
> CustomLog 
> "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log"
>  
> common
> 
> WSGIScriptAlias / 
> "c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py"
>
> Alias / "c:/Apache24/htdocs/testarhamcollections"
> Alias /static/ "c:/Apache24/htdocs/testarhamcollections/static/"
> Alias /media/ "c:/Apache24/htdocs/testarhamcollections/static/media/"
> 
> 
> Require all granted
> 
> 
> 
>
> -------
> I checked the error log of website it shows nothing. 
>
>
> -- 
> Thanks with regards,
> Sarfaraz Ahmed
>
>
>

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


Re: Django deployement Apache

2017-10-19 Thread sarfaraz ahmed
Thanks you all you friends.. this is been fixed.


On Thursday, 31 August 2017 14:47:05 UTC+5:30, Antonis Christofides wrote:
>
> Did you run collectstatic? After you do so, the files will be copied to 
> /var/www/static_root or whatever your STATIC_ROOT points to.
>
> Some other notes:
>
>- You normally don't need to touch STATICFILES_DIRS at all. 
>- The value os.path.join(os.path.dirname(BASE_DIR), 'static_root') is 
>a bad idea for production. On development it may be OK, but in production 
>you'd better specify the full path, such as '/var/www/static_root'. 
>- You don't need to specify both "Alias /static/admin" and "Alias 
>/static". Just the second one will do. "Alias /static 
> /var/www/static_root" 
>and that's it. 
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2017-08-30 21:58, sarfaraz ahmed wrote:
>
> Thanks Antonis,
>
> I reached your website googling undoubtedly this is well explained. I have 
> been able to deploy but here is my problem
>
> STATIC_URL = '/static/'
> MEDIA_URL = '/media/'
>
>
> STATICFILES_DIRS = [os.path.join(BASE_DIR, 
> "static"),os.path.join(BASE_DIR,"static","admin")]
> STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR),'static_root')
> MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR),'media_root')
>
> This is my settings in settingss.py 
>
> Here is my vhost.conf files
>
> WSGIPythonHome /usr/local/lib/python2.7/dist-packages
>
>
> WSGIPythonPath /var/www/firsttest
>
> 
> ServerName firsttest.com
> ServerAlias www.firsttest.com
> ServerAdmin webmaster@localhost
>
> WSGIScriptAlias / /var/www/firsttest/firsttest/wsgi.py
>
> ErrorLog   /var/log/apache2/firsttest/first_error.log
> CustomLog   /var/log/apache2/firsttest/first_access.log combined
> Alias */static/admin /var/www/firsttest/static/admin*
> 
> Require all granted
> 
>
> Alias /static  */var/www/firsttest/static*
> 
> Require all granted
> 
>
> 
> 
> Require all granted
> 
> 
> 
>
> Now with this conf file everything works fine. CSS, js all works fine. 
> However, you notice the conf file marked in red. its not actually pointing 
> to my static_root folder which in settings defined as 
> /var/www/static_root
>
> static root is one which gathers all my static files when I run collect 
> static
>
> if I understand correctly from documentation. Web server should point to 
> static root folder to access css files in production. 
>
> Regards,
> Sarfaraz Ahmed
>
>
>  
>
> On Wednesday, 30 August 2017 13:44:35 UTC+5:30, Antonis Christofides 
> wrote: 
>>
>> Hello Sarfaraz,
>>
>> You could try "How Django static files work in production 
>> <https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/>"
>>  
>> to get some understanding of the correct way to do it.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>> On 2017-08-28 06:17, sarfaraz ahmed wrote:
>>
>> Thanks for your help. Yes it was permission issue. However I am not able 
>> to find anything under my site-packages. when I point the same to 
>> dist-packages it works. 
>>
>> WSGIPythonHome /usr/local/lib/python2.7/dist-packages
>> WSGIPythonPath /var/www/firsttest
>>
>> 
>> ServerName firsttest.com
>> ServerAlias www.firsttest.com
>> ServerAdmin webmaster@localhost
>>
>> WSGIScriptAlias / /var/www/firsttest/firsttest/wsgi.py
>>
>> ErrorLog   /var/log/apache2/firsttest/first_error.log
>> CustomLog   /var/log/apache2/firsttest/first_access.log combined
>> Alias /static/admin/ 
>> /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/
>> Alias /static/ /var/www/firsttest/static
>> 
>> 
>> Require all granted
>> 
>> 
>> 
>>
>> -
>>
>>
>> This is my new conf file and it works. However I am still not able to see 
>> my static files in admin. Any help would be appreciated.
>>
>>
>> Regards
>> Sarfaraz
>>
>> On Su

Re: Need help with deployment

2017-10-19 Thread sarfaraz ahmed
Yes, I moved to linux all working fine now.

On Saturday, 13 May 2017 00:06:44 UTC+5:30, mohammed ferozkhan wrote:
>
> Hi 
> Problem will solved?? 
> If no ping me on what'sapp +91 8686962047

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


“Manager isn't available; User has been swapped”

2017-10-19 Thread sarfaraz ahmed
ser=CustomUser.objects.get(pk=user_id)
if user.is_active:
return user
return None
except CustomUser.DoesNotExist:
return None
 
 
-
form.py 
--
from django.contrib.auth import authenticate
from django.contrib.auth import get_user_model

class CustomUserCreationForm(UserCreationForm):
"""
A form that creates a user, with no privileges, from the given email and
password.
"""
def __init__(self, *args, **kargs):
super(CustomUserCreationForm, self).__init__(*args, **kargs)
#del self.fields['username']
def clean(self):
password1=self.cleaned_data.get('password1')
password2=self.cleaned_data.get('password2')
username=self.cleaned_data.get('email')
print username
try:
user=CustomUser.objects.get(email=username)
except:
user=None
if user:
raise forms.ValidationError("Email address already 
registered with us")

if password1!=password2:
raise forms.ValidationError("Both password should be same")


class Meta:
model = CustomUser
#fields = "__all__"
fields = ("email",)


class CustomUserChangeForm(UserChangeForm):
"""A form for updating users. Includes all the fields on
the user, but replaces the password field with admin's
password hash display field.
"""

def __init__(self, *args, **kargs):
super(CustomUserChangeForm, self).__init__(*args, **kargs)
#del self.fields['username']


class Meta:
model = CustomUser
fields = "__all__"



class UserLoginForm(forms.Form):
username = forms.CharField()
password= forms.CharField(widget=forms.PasswordInput)

def clean(self):
username = self.cleaned_data.get('username')
password = self.cleaned_data.get('password')
#user = authenticate(username=username, password=password)
try:
user=CustomUser.objects.get(email=username)
except:
user=None
if not user:
raise forms.ValidationError("Email not registered with us.")
if not user.is_active and user.check_password(password):
raise forms.ValidationError("Account is inactive, please check 
your mail for activation email")
else:
if not user.check_password(password):
raise forms.ValidationError("Incorrect password")
#if not user:
#raise forms.ValidationError("Sorry, that login was invalid. 
Please try again.")
return self.cleaned_data



def login(self, request):
username = self.cleaned_data.get('username')
password = self.cleaned_data.get('password')
user = authenticate(username=username, password=password)
return user

I hope I included enough for someone to help me. Not sure but I hardly got 
any help from this group.

Regards,
Sarfaraz Ahmed

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


Re: AttributeError When Overwritting AUTH_USER_MODEL in Test Cases

2017-10-19 Thread sarfaraz ahmed
I am getting similar issue. No reply on your question. Please share the 
solution if you found


On Monday, 8 February 2016 19:50:07 UTC+5:30, Aubrey Stark-Toller wrote:
>
> Hello, 
>
> When I override the AUTH_USER_MODEL setting to "auth.User",  when 
> AUTH_USER_MODEL in settings is not set to "auth.User", in 
> either a TestCase or individual test, and then try to access the objects 
> attribute on the user model, I get an AttributeError. 
>
> The exact error I get is: 
> AttributeError: Manager isn't available; 'auth.User' has been swapped 
> for 'None' 
>
> I've found this to be the case in both Django 1.8 and 1.9. 
>
> This is easily reproducible in a fresh project : create a boilerplate 
> project with a boilerplate app, add a new user model (call it 
> CustomUser) to the app and set to AUTH_USER_MODEL to CustomUser, and add 
> the following test case to the app: 
>
> > from django.test import TestCase, override_settings 
> > from django.contrib.auth import get_user_model 
> > 
> > class MyTestCase(TestCase): 
> >@override_settings(AUTH_USER_MODEL = 'auth.User') 
> >def test_custom_user(self): 
> >UserModel = get_user_model() 
> >UserModel.objects.all() 
>
> get_user_model() retrieves the correct model but accessing objects 
> attribute gives the stated error when running the test. 
>
> If I throw in another user model (say CustomerUser2) and write a test 
> such as: 
>
> >@override_settings(AUTH_USER_MODEL = 'another_app.CustomerUser2') 
> >def test_custom_user(self): 
> >UserModel = get_user_model() 
> >UserModel.objects.all() 
>
> this works fine, and if I unset AUTH_USER_MODEL in settings again 
> everything works as expected. 
>
> Perhaps someone can shed some light on this behavior? 
>
> Cheers, 
> Aubrey 
>

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


Re: Django deployement Apache

2017-08-30 Thread sarfaraz ahmed
Thanks Antonis,

I reached your website googling undoubtedly this is well explained. I have 
been able to deploy but here is my problem

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


STATICFILES_DIRS = [os.path.join(BASE_DIR, 
"static"),os.path.join(BASE_DIR,"static","admin")]
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR),'static_root')
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR),'media_root')

This is my settings in settingss.py 

Here is my vhost.conf files

WSGIPythonHome /usr/local/lib/python2.7/dist-packages


WSGIPythonPath /var/www/firsttest


ServerName firsttest.com
ServerAlias www.firsttest.com
ServerAdmin webmaster@localhost

WSGIScriptAlias / /var/www/firsttest/firsttest/wsgi.py

ErrorLog   /var/log/apache2/firsttest/first_error.log
CustomLog   /var/log/apache2/firsttest/first_access.log combined
Alias */static/admin /var/www/firsttest/static/admin*

Require all granted


Alias /static  */var/www/firsttest/static*

Require all granted




Require all granted




Now with this conf file everything works fine. CSS, js all works fine. 
However, you notice the conf file marked in red. its not actually pointing 
to my static_root folder which in settings defined as 
/var/www/static_root

static root is one which gathers all my static files when I run collect 
static

if I understand correctly from documentation. Web server should point to 
static root folder to access css files in production. 

Regards,
Sarfaraz Ahmed


 

On Wednesday, 30 August 2017 13:44:35 UTC+5:30, Antonis Christofides wrote:
>
> Hello Sarfaraz,
>
> You could try "How Django static files work in production 
> <https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/>"
>  
> to get some understanding of the correct way to do it.
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2017-08-28 06:17, sarfaraz ahmed wrote:
>
> Thanks for your help. Yes it was permission issue. However I am not able 
> to find anything under my site-packages. when I point the same to 
> dist-packages it works. 
>
> WSGIPythonHome /usr/local/lib/python2.7/dist-packages
> WSGIPythonPath /var/www/firsttest
>
> 
> ServerName firsttest.com
> ServerAlias www.firsttest.com
> ServerAdmin webmaster@localhost
>
> WSGIScriptAlias / /var/www/firsttest/firsttest/wsgi.py
>
> ErrorLog   /var/log/apache2/firsttest/first_error.log
> CustomLog   /var/log/apache2/firsttest/first_access.log combined
> Alias /static/admin/ 
> /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/
> Alias /static/ /var/www/firsttest/static
> 
> 
> Require all granted
> 
> 
> 
>
> -
>
>
> This is my new conf file and it works. However I am still not able to see 
> my static files in admin. Any help would be appreciated.
>
>
> Regards
> Sarfaraz
>
> On Sunday, 27 August 2017 10:57:12 UTC+5:30, Vernon Swanepoel wrote: 
>>
>> Hello Sarfaraz, 
>>
>> A couple things you could look at:
>>
>>1. Are you including both your site-packages (eg 
>>python3.6/lib/site-packages) and your django project root (where you 
>>actually built the project) in your WSGIPythonPath?  String them together 
>>with a clone 
>>(/path/to/python3.6/lib/site-packages:/path/to/django/project/myproject) 
>>2. Your wsgi is within your django app 
>>(/path/to/django/project/myproject/myproject/wsgi...).  It sits in the 
>> same 
>>file as your settings.py.  Make sure it's pointing to the right place, 
>>because in your examples above your directory for django and your 
>> directory 
>>for the wsgi don't match. 
>>3. Have you set execute permissions all the way down the django app 
>>(using chmod +x /all/the/way/up/the/django/project/to/wsgi.py) 
>>
>> Deploying the first time is a frustrating process, and it's hard to get 
>> specific help because nobody knows exactly what you've got running, but if 
>> you stick with it, you'll get it working.
>>
>> Regards,
>> Vernon
>>
>> On Saturday, 26 August 2017 21:31:34 UTC+1, sarfaraz ahmed wrote: 
>>>
>>> Hey Team,
>>>
>>> Please someone help.
>>> I am still getting error
>>>
>>&g

Doubts about static files

2017-08-30 Thread sarfaraz ahmed
 Hello Team,

I have doubts about static files. I read articles on Django but it does not 
clearly states that atleast I got confused.

STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] this is my 
STATICFILES_DIRS settings which points out to static folder under my 
project. Also, I can add all the folder from individual app which hold 
static files here so that it search for static files.
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR),'static_root') which 
points out to one level up folder than my project. This is how my project 
folder structures look like

static_root
MyProject
--static
CSS
JS
imgs
--MyProject
--MyApp

When I run collectstatic files moves files from static files from static 
folder to static root. 

Now, my question is when deploy it on apache which folder should I point to 
in my conf files. static_root or static. 

Regards,
Sarfaraz Ahmed





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


Re: Django deployement Apache

2017-08-27 Thread sarfaraz ahmed
Thanks for your help. Yes it was permission issue. However I am not able to 
find anything under my site-packages. when I point the same to 
dist-packages it works. 

WSGIPythonHome /usr/local/lib/python2.7/dist-packages
WSGIPythonPath /var/www/firsttest


ServerName firsttest.com
ServerAlias www.firsttest.com
ServerAdmin webmaster@localhost

WSGIScriptAlias / /var/www/firsttest/firsttest/wsgi.py

ErrorLog   /var/log/apache2/firsttest/first_error.log
CustomLog   /var/log/apache2/firsttest/first_access.log combined
Alias /static/admin/ 
/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/
Alias /static/ /var/www/firsttest/static


Require all granted



-


This is my new conf file and it works. However I am still not able to see 
my static files in admin. Any help would be appreciated.


Regards
Sarfaraz

On Sunday, 27 August 2017 10:57:12 UTC+5:30, Vernon Swanepoel wrote:
>
> Hello Sarfaraz,
>
> A couple things you could look at:
>
>1. Are you including both your site-packages (eg 
>python3.6/lib/site-packages) and your django project root (where you 
>actually built the project) in your WSGIPythonPath?  String them together 
>with a clone 
>(/path/to/python3.6/lib/site-packages:/path/to/django/project/myproject)
>2. Your wsgi is within your django app 
>(/path/to/django/project/myproject/myproject/wsgi...).  It sits in the 
> same 
>file as your settings.py.  Make sure it's pointing to the right place, 
>because in your examples above your directory for django and your 
> directory 
>for the wsgi don't match.
>3. Have you set execute permissions all the way down the django app 
>(using chmod +x /all/the/way/up/the/django/project/to/wsgi.py)
>
> Deploying the first time is a frustrating process, and it's hard to get 
> specific help because nobody knows exactly what you've got running, but if 
> you stick with it, you'll get it working.
>
> Regards,
> Vernon
>
> On Saturday, 26 August 2017 21:31:34 UTC+1, sarfaraz ahmed wrote:
>>
>> Hey Team,
>>
>> Please someone help.
>> I am still getting error
>>
>> * ImportError: No module named django.core.wsgi*mentioned below is my 
>> latest vhost file in ubuntu. 
>>
>> 
>> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
>> ServerName firstweb.com
>>
>> ServerAlias www.firstweb.com
>> 
>> 
>> Require all granted
>>     
>>     
>> CustomLog /var/log/apache2/firstweb-access.log combined
>> ErrorLog /var/log/apache2/firstweb-error.log
>> 
>>
>> Earlier I missed WSGIScriptAlias argument.
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>>
>>
>> On Saturday, 26 August 2017 20:02:47 UTC+5:30, sarfaraz ahmed wrote:
>>>
>>> Hello Friends,
>>>
>>> Please help me with this. 
>>>
>>> I am new to linux and I am attempting to deploy my trial app on AWS 
>>> ubuntu server.
>>>
>>> my vhost file looks like this 
>>> 
>>> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
>>>
>>> WSGIPythonPath /var/www/firstweb
>>> ServerName firstweb.com
>>>
>>> ServerAlias www.firstweb.com
>>> 
>>> 
>>> Require all granted
>>> 
>>> 
>>> 
>>>
>>> now when I add WSGIPythonPath.. my apache fails to restart. 
>>>
>>> If I remove that that I get following error when I try to access this 
>>> from my computer. 
>>> ImportError: No module named django.core.wsgi
>>>
>>> Now, I searched on the web and found following link
>>> https://www.webforefront.com/django/setupapachewebserverwsgi.html
>>>  
>>> which has some solution which I am not able to understand so far.
>>>
>>> after wasting my time in attempting to deploy on windows server. 
>>> everyone suggested me to deploy on linux.
>>>
>>> I M NOT USING virualenv. 
>>>
>>> Thanks in advance. 
>>>
>>> Regards,
>>> Sarfaraz Ahmed
>>>
>>>
>>>
>>>
>>>

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


Re: Django deployement Apache

2017-08-26 Thread sarfaraz ahmed
Hey Team,

Please someone help.
I am still getting error

* ImportError: No module named django.core.wsgi*mentioned below is my 
latest vhost file in ubuntu. 


WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
ServerName firstweb.com

ServerAlias www.firstweb.com


Require all granted


CustomLog /var/log/apache2/firstweb-access.log combined
ErrorLog /var/log/apache2/firstweb-error.log


Earlier I missed WSGIScriptAlias argument.

Regards,
Sarfaraz Ahmed



On Saturday, 26 August 2017 20:02:47 UTC+5:30, sarfaraz ahmed wrote:
>
> Hello Friends,
>
> Please help me with this. 
>
> I am new to linux and I am attempting to deploy my trial app on AWS ubuntu 
> server.
>
> my vhost file looks like this 
> 
> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
>
> WSGIPythonPath /var/www/firstweb
> ServerName firstweb.com
>
> ServerAlias www.firstweb.com
> 
> 
> Require all granted
> 
> 
> 
>
> now when I add WSGIPythonPath.. my apache fails to restart. 
>
> If I remove that that I get following error when I try to access this from 
> my computer. 
> ImportError: No module named django.core.wsgi
>
> Now, I searched on the web and found following link
> https://www.webforefront.com/django/setupapachewebserverwsgi.html
>  
> which has some solution which I am not able to understand so far.
>
> after wasting my time in attempting to deploy on windows server. everyone 
> suggested me to deploy on linux.
>
> I M NOT USING virualenv. 
>
> Thanks in advance. 
>
> Regards,
> Sarfaraz Ahmed
>
>
>
>
>

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


Re: Django deployement Apache

2017-08-26 Thread sarfaraz ahmed

i have made following changes in my vhost conf file and now services run. 
Also, I don't see any error. But instead of default django page I get 
default apache page.

Here is my new conf file.
-

ServerName firstweb.com
ServerAlias www.firstweb.com


Require all granted





--

I checked for error. I don't see any error. 

Please help


On Saturday, 26 August 2017 20:02:47 UTC+5:30, sarfaraz ahmed wrote:
>
> Hello Friends,
>
> Please help me with this. 
>
> I am new to linux and I am attempting to deploy my trial app on AWS ubuntu 
> server.
>
> my vhost file looks like this 
> 
> WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py
>
> WSGIPythonPath /var/www/firstweb
> ServerName firstweb.com
>
> ServerAlias www.firstweb.com
> 
> 
> Require all granted
> 
> 
> 
>
> now when I add WSGIPythonPath.. my apache fails to restart. 
>
> If I remove that that I get following error when I try to access this from 
> my computer. 
> ImportError: No module named django.core.wsgi
>
> Now, I searched on the web and found following link
> https://www.webforefront.com/django/setupapachewebserverwsgi.html
>  
> which has some solution which I am not able to understand so far.
>
> after wasting my time in attempting to deploy on windows server. everyone 
> suggested me to deploy on linux.
>
> I M NOT USING virualenv. 
>
> Thanks in advance. 
>
> Regards,
> Sarfaraz Ahmed
>
>
>
>
>

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


Django deployement Apache

2017-08-26 Thread sarfaraz ahmed
Hello Friends,

Please help me with this. 

I am new to linux and I am attempting to deploy my trial app on AWS ubuntu 
server.

my vhost file looks like this 

WSGIScriptAlias / /var/www/firstweb/firstweb/wsgi.py

WSGIPythonPath /var/www/firstweb
ServerName firstweb.com

ServerAlias www.firstweb.com


Require all granted




now when I add WSGIPythonPath.. my apache fails to restart. 

If I remove that that I get following error when I try to access this from 
my computer. 
ImportError: No module named django.core.wsgi

Now, I searched on the web and found following link
https://www.webforefront.com/django/setupapachewebserverwsgi.html
 
which has some solution which I am not able to understand so far.

after wasting my time in attempting to deploy on windows server. everyone 
suggested me to deploy on linux.

I M NOT USING virualenv. 

Thanks in advance. 

Regards,
Sarfaraz Ahmed




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


Re: Django Deployment showing list of directory

2017-05-08 Thread sarfaraz ahmed
Hey Tom,

Thanks, you rightly pointed out right security way to implement django. But
currently I am facing issue with implementing whatever way I tried.

Please suggest what is wrong in vhost file. Here is my host file. Please
take a look

WSGIPythonPath C:\Python27\Lib\site-packages


ServerAdmin ad...@testarhamcollections.com

DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
ServerName www.testarhamcollections.com
ServerAlias testarhamcollections.com

ErrorLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-error.log"
CustomLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log"
common


Require all granted


WSGIScriptAlias / c:\Apache24\htdocs\testarhamcollections

Alias / "c:/Apache24/htdocs/testarhamcollections"


Require all granted




Also, you appreciate if you come on Google Hangout.


Regards,
Sarf

On 8 May 2017 at 23:22, 'Tom Evans' via Django users <
django-users@googlegroups.com> wrote:

> On Mon, May 8, 2017 at 11:08 AM, sarfaraz ahmed 
> wrote:
> > Hello Guys,
> > [ .. ]
> > This is conf file for Apache
> > 
> 
> --
> > 
> > ServerAdmin ad...@testarhamcollections.com
> > DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
> > ServerName www.testarhamcollections.com
> > ServerAlias testarhamcollections.com
> > ErrorLog
> > "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-
> error.log"
> > CustomLog
> > "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-
> access.log"
> > common
> >
> > WSGIScriptAlias /
> > "c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py"
> >
> > Alias / "c:/Apache24/htdocs/testarhamcollections"
> > Alias /static/ "c:/Apache24/htdocs/testarhamcollections/static/"
> > Alias /media/ "c:/Apache24/htdocs/testarhamcollections/static/
> media/"
>
> DANGER!
>
> Python/WSGI is not like PHP, the program files should not live in web
> accessible directory.
> Your WSGI script should not be in a web accessible directory.
> The only things that should be in a web accessible directory are your
> static htdocs, which are collected to that location by Django using
> the command "collectstatic".
>
> Your project files should be OUTSIDE the document root and NOT aliased
> into it in any way!
>
>
> A typical layout should look like so:
>
>
> c:/DjangoProjects/project_name
> ├── htdocs
> ├── logs
> ├── my_project
> │   ├── manage.py
> │   ├── my_app1
> │   │   ├── __init__.py
> │   │   ├── admin.py
> │   │   ├── apps.py
> │   │   ├── migrations
> │   │   │   └── __init__.py
> │   │   ├── models.py
> │   │   ├── tests.py
> │   │   └── views.py
> │   ├── my_app2
> │   │   ├── __init__.py
> │   │   ├── admin.py
> │   │   ├── apps.py
> │   │   ├── migrations
> │   │   │   └── __init__.py
> │   │   ├── models.py
> │   │   ├── tests.py
> │   │   └── views.py
> │   └── my_project
> │   ├── __init__.py
> │   ├── settings.py
> │   ├── urls.py
> │   └── wsgi.py
> └── my_virtual_env
>
> The only directory of those that should be web accessible is htdocs,
> and none of your code should live there.
>
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAFHbX1JoAHqgWnyxeNMn1EwqaMnvf8fsahT8JW0nK2A9%2BYRoOQ%
> 40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: Django Deployment showing list of directory

2017-05-08 Thread sarfaraz ahmed
Thanks for your reply

This is how it looks like after all the changes made. WSGIPythonPath cannot
be under virtual host


WSGIPythonPath C:/Python27/Lib/site-packages


ServerAdmin ad...@testarhamcollections.com

DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
ServerName www.testarhamcollections.com
ServerAlias testarhamcollections.com

ErrorLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-error.log"
CustomLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log"
common


Require all granted


WSGIScriptAlias / c:/Apache24/htdocs/testarhamcollections

Alias / "c:/Apache24/htdocs/testarhamcollections"


Require all granted



---
Inspite of all this, its still not working..


On 8 May 2017 at 20:12, Matthew Pava  wrote:

> Let’s review.  This is the configuration directive I had in my first
> answer your question:
>
> WSGIPythonPath ${project_path};${project_virtualenv};
>
>
>
> You also moved the WSGIScriptAlias outside the VirtualHost block, which is
> contrary to what the documentation states. (And it makes sense, if you
> really think about it.)
>
>
>
> Please review the mod_wsgi documentation--at least the quick configuration
> guide:
>
> http://modwsgi.readthedocs.io/en/develop/user-guides/quick-
> configuration-guide.html
>
>
>
> It may appear like a strange syntax, but Apache allows us to define
> variables that we can use throughout the config file.  Use the ${} syntax
> to use them throughout the config file.
>
> Define project_path c:/Apache24/htdocs/testarhamcollections
>
> Define project_virtualenv C:/python27/Lib/site-packages/
>
> WSGIPythonPath ${project_path};${project_virtualenv};
>
>
>
> Also, it was my mistake to point to the Python executable.  It is to the
> site-packages where your dependencies are installed.
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 9:28 AM
>
> *To:* django-users@googlegroups.com
> *Subject:* Re: Django Deployment showing list of directory
>
>
>
> I would create seperate enviroment and test the same if it runs on python
> 3.6
>
> You have been very helpful. Thank you so much.
>
> This is how the file looks now. Still not working
> 
> 
> WSGIScriptAlias / c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py
> WSGIPythonPath c:/python27
>
> 
> ServerAdmin ad...@testarhamcollections.com
> DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
> ServerName www.testarhamcollections.com
> ServerAlias testarhamcollections.com
> ErrorLog "C:/Apache24/htdocs/testarhamcollections/logs/
> testarhamcollections.com-error.log"
> CustomLog "C:/Apache24/htdocs/testarhamcollections/logs/
> testarhamcollections.com-access.log" common
>
>
> Alias / "c:/Apache24/htdocs/testarhamcollections"
> 
> Require all granted
> 
>
> 
>
>
>
> On 8 May 2017 at 19:46, Matthew Pava  wrote:
>
> You need to add the path to the Python executable, which ought to be in
> your virtual environment for your project.
>
>
>
> As for the differences between 2.7 and 3.6, I suggest trying to run your
> code in 3.6 to see if you actually need to make any changes.  They aren’t 
> *that
> *different from each other.  The biggest habit I had to change was to use
> print as a function, basically surrounding the print string in parentheses.
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 9:13 AM
>
>
> *To:* django-users@googlegroups.com
> *Subject:* Re: Django Deployment showing list of directory
>
>
>
> I am new to python 2.7 and I see python 3.6 is very different from 2.7.
>
> I tried your suggestion. Now my vhost file looks like this
>
> WSGIScriptAlias / c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py
> WSGIPythonPath c:/Apache24/htdocs/testarhamcollections
>
> 
> ServerAdmin ad...@testarhamcollections.com
> DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
> ServerName www.testarhamcollections.com
> ServerAlias testarhamcollections.com
> ErrorLog "C:/Apache24/htdocs/testarhamcollections/logs/
> testarhamcollections.com-error.log"
> CustomLog "C:/Apache24/htdo

Re: Django Deployment showing list of directory

2017-05-08 Thread sarfaraz ahmed
I would create seperate enviroment and test the same if it runs on python
3.6

You have been very helpful. Thank you so much.

This is how the file looks now. Still not working

WSGIScriptAlias / c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py
WSGIPythonPath c:/python27


ServerAdmin ad...@testarhamcollections.com
DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
ServerName www.testarhamcollections.com
ServerAlias testarhamcollections.com
ErrorLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-error.log"
CustomLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log"
common


Alias / "c:/Apache24/htdocs/testarhamcollections"

Require all granted





On 8 May 2017 at 19:46, Matthew Pava  wrote:

> You need to add the path to the Python executable, which ought to be in
> your virtual environment for your project.
>
>
>
> As for the differences between 2.7 and 3.6, I suggest trying to run your
> code in 3.6 to see if you actually need to make any changes.  They aren’t 
> *that
> *different from each other.  The biggest habit I had to change was to use
> print as a function, basically surrounding the print string in parentheses.
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@googlegro
> ups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 9:13 AM
>
> *To:* django-users@googlegroups.com
> *Subject:* Re: Django Deployment showing list of directory
>
>
>
> I am new to python 2.7 and I see python 3.6 is very different from 2.7.
>
> I tried your suggestion. Now my vhost file looks like this
>
> WSGIScriptAlias / c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py
> WSGIPythonPath c:/Apache24/htdocs/testarhamcollections
>
> 
> ServerAdmin ad...@testarhamcollections.com
> DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
> ServerName www.testarhamcollections.com
> ServerAlias testarhamcollections.com
> ErrorLog "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcolle
> ctions.com-error.log"
> CustomLog 
> "C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log"
> common
>
>
> Alias / "c:/Apache24/htdocs/testarhamcollections"
> 
> Require all granted
> 
>
> 
> --
>
> Still not working
>
>
>
>
>
> On 8 May 2017 at 18:58, Matthew Pava  wrote:
>
> Ah, I see.  Well, why don’t you upgrade to Python 3.6?  I did that last
> year and haven’t looked back.
>
>
>
> To answer your other question, you need to specify WSGIPythonPath outside
> of your VirtualHost directive in your Apache config.
>
>
>
> WSGIPythonPath ${project_path};${project_virtualenv};
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@googlegro
> ups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 8:21 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: Django Deployment showing list of directory
>
>
>
> forgot to mention I m using python 2.7. If you look at link, there is not
> mod_wsgi for python 2.7 with VC14
>
> Regards,
>
> Sarfaraz Ahmed
>
>
>
> On 8 May 2017 at 18:44, Matthew Pava  wrote:
>
> Hi Sarfaraz,
>
> Here is a compiled version of mod_wsgi for VC14:
>
> http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
>
>
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@googlegro
> ups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 5:09 AM
> *To:* django-users@googlegroups.com
> *Subject:* Django Deployment showing list of directory
>
>
>
> Hello Guys,
>
> After lot of struggle I understood there is no MOD_WSGI file available for
> latest version of XAMP which is compiled in VC14. I am not sure how to
> compile MOD_WSGI with VC 14 so I gave up
>
> Now I downloaded Apache 2.4 compiled in VC9 + Python 2.7.13 on my windows
> server 2016(AWS instance) I moved my website to this server. Changed
> firewall setting to accepting incoming traffic and also networking
> configuration.
>
> Now I am seeing the list of directory and files instead of website.
>
>
>
> Here is my wsgi.py file
> 
> 
> -

Re: Django Deployment showing list of directory

2017-05-08 Thread sarfaraz ahmed
I am new to python 2.7 and I see python 3.6 is very different from 2.7.

I tried your suggestion. Now my vhost file looks like this

WSGIScriptAlias / c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py
WSGIPythonPath c:/Apache24/htdocs/testarhamcollections


ServerAdmin ad...@testarhamcollections.com
DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
ServerName www.testarhamcollections.com
ServerAlias testarhamcollections.com
ErrorLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-error.log"
CustomLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log"
common


Alias / "c:/Apache24/htdocs/testarhamcollections"

Require all granted



--

Still not working



On 8 May 2017 at 18:58, Matthew Pava  wrote:

> Ah, I see.  Well, why don’t you upgrade to Python 3.6?  I did that last
> year and haven’t looked back.
>
>
>
> To answer your other question, you need to specify WSGIPythonPath outside
> of your VirtualHost directive in your Apache config.
>
>
>
> WSGIPythonPath ${project_path};${project_virtualenv};
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 8:21 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: Django Deployment showing list of directory
>
>
>
> forgot to mention I m using python 2.7. If you look at link, there is not
> mod_wsgi for python 2.7 with VC14
>
> Regards,
>
> Sarfaraz Ahmed
>
>
>
> On 8 May 2017 at 18:44, Matthew Pava  wrote:
>
> Hi Sarfaraz,
>
> Here is a compiled version of mod_wsgi for VC14:
>
> http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
>
>
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 5:09 AM
> *To:* django-users@googlegroups.com
> *Subject:* Django Deployment showing list of directory
>
>
>
> Hello Guys,
>
> After lot of struggle I understood there is no MOD_WSGI file available for
> latest version of XAMP which is compiled in VC14. I am not sure how to
> compile MOD_WSGI with VC 14 so I gave up
>
> Now I downloaded Apache 2.4 compiled in VC9 + Python 2.7.13 on my windows
> server 2016(AWS instance) I moved my website to this server. Changed
> firewall setting to accepting incoming traffic and also networking
> configuration.
>
> Now I am seeing the list of directory and files instead of website.
>
>
>
> Here is my wsgi.py file
> 
> 
> --
> import os
> import sys
> from django.core.wsgi import get_wsgi_application
> sys.path.append('C:\Apache24\htdocs\testarhamcollections\')
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project1.settings")
> application = get_wsgi_application()
> 
> 
> -
>
> This is conf file for Apache
>
> 
> 
> --
> 
> ServerAdmin ad...@testarhamcollections.com
> DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
> ServerName www.testarhamcollections.com
> ServerAlias testarhamcollections.com
> ErrorLog "C:/Apache24/htdocs/testarhamcollections/logs/
> testarhamcollections.com-error.log"
> CustomLog "C:/Apache24/htdocs/testarhamcollections/logs/
> testarhamcollections.com-access.log" common
>
> WSGIScriptAlias / "c:/Apache24/htdocs/testarhamcollections/project1/
> wsgi.py"
>
> Alias / "c:/Apache24/htdocs/testarhamcollections"
> Alias /static/ "c:/Apache24/htdocs/testarhamcollections/static/"
> Alias /media/ "c:/Apache24/htdocs/testarhamcollections/static/media/"
> 
> 
> Require all granted
> 
> 
> 
> 
> 
> ---
>
> I checked the error log of website it shows nothing.
>
> --
>
> Thanks with regards,
> Sarfaraz Ahmed
>
> --
> You received this message because you are subscribed to t

Re: Django Deployment showing list of directory

2017-05-08 Thread sarfaraz ahmed
forgot to mention I m using python 2.7. If you look at link, there is not
mod_wsgi for python 2.7 with VC14

Regards,
Sarfaraz Ahmed

On 8 May 2017 at 18:44, Matthew Pava  wrote:

> Hi Sarfaraz,
>
> Here is a compiled version of mod_wsgi for VC14:
>
> http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
>
>
>
>
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Monday, May 8, 2017 5:09 AM
> *To:* django-users@googlegroups.com
> *Subject:* Django Deployment showing list of directory
>
>
>
> Hello Guys,
>
> After lot of struggle I understood there is no MOD_WSGI file available for
> latest version of XAMP which is compiled in VC14. I am not sure how to
> compile MOD_WSGI with VC 14 so I gave up
>
> Now I downloaded Apache 2.4 compiled in VC9 + Python 2.7.13 on my windows
> server 2016(AWS instance) I moved my website to this server. Changed
> firewall setting to accepting incoming traffic and also networking
> configuration.
>
> Now I am seeing the list of directory and files instead of website.
>
>
>
> Here is my wsgi.py file
> 
> 
> --
> import os
> import sys
> from django.core.wsgi import get_wsgi_application
> sys.path.append('C:\Apache24\htdocs\testarhamcollections\')
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project1.settings")
> application = get_wsgi_application()
> 
> 
> -
>
> This is conf file for Apache
>
> 
> 
> --
> 
> ServerAdmin ad...@testarhamcollections.com
> DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
> ServerName www.testarhamcollections.com
> ServerAlias testarhamcollections.com
> ErrorLog "C:/Apache24/htdocs/testarhamcollections/logs/
> testarhamcollections.com-error.log"
> CustomLog "C:/Apache24/htdocs/testarhamcollections/logs/
> testarhamcollections.com-access.log" common
>
> WSGIScriptAlias / "c:/Apache24/htdocs/testarhamcollections/project1/
> wsgi.py"
>
> Alias / "c:/Apache24/htdocs/testarhamcollections"
> Alias /static/ "c:/Apache24/htdocs/testarhamcollections/static/"
> Alias /media/ "c:/Apache24/htdocs/testarhamcollections/static/media/"
> 
> 
>     Require all granted
> 
> 
> 
> 
> 
> ---
>
> I checked the error log of website it shows nothing.
>
> --
>
> Thanks with regards,
> Sarfaraz Ahmed
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAEPJdixr3x3f3v9Kyw%3DtxKZP4wX9i0ZckEsYhaBxmbFzbJ1
> aEg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEPJdixr3x3f3v9Kyw%3DtxKZP4wX9i0ZckEsYhaBxmbFzbJ1aEg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/cc4fe8b57f3c4858bdc8f54adb245e0e%40ISS1.ISS.LOCAL
> <https://groups.google.com/d/msgid/django-users/cc4fe8b57f3c4858bdc8f54adb245e0e%40ISS1.ISS.LOCAL?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed


Django Deployment showing list of directory

2017-05-08 Thread sarfaraz ahmed
Hello Guys,

After lot of struggle I understood there is no MOD_WSGI file available for
latest version of XAMP which is compiled in VC14. I am not sure how to
compile MOD_WSGI with VC 14 so I gave up

Now I downloaded Apache 2.4 compiled in VC9 + Python 2.7.13 on my windows
server 2016(AWS instance) I moved my website to this server. Changed
firewall setting to accepting incoming traffic and also networking
configuration.

Now I am seeing the list of directory and files instead of website.

Here is my wsgi.py file
--
import os
import sys
from django.core.wsgi import get_wsgi_application
sys.path.append('C:\Apache24\htdocs\testarhamcollections\')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project1.settings")
application = get_wsgi_application()
-


This is conf file for Apache
--

ServerAdmin ad...@testarhamcollections.com
DocumentRoot "C:/Apache24/htdocs/testarhamcollections"
ServerName www.testarhamcollections.com
ServerAlias testarhamcollections.com
ErrorLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-error.log"
CustomLog
"C:/Apache24/htdocs/testarhamcollections/logs/testarhamcollections.com-access.log"
common

WSGIScriptAlias /
"c:/Apache24/htdocs/testarhamcollections/project1/wsgi.py"

Alias / "c:/Apache24/htdocs/testarhamcollections"
Alias /static/ "c:/Apache24/htdocs/testarhamcollections/static/"
Alias /media/ "c:/Apache24/htdocs/testarhamcollections/static/media/"


Require all granted



---
I checked the error log of website it shows nothing.


-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: Need help with deployment

2017-05-08 Thread sarfaraz ahmed
This is first time I am trying to deploy my django project. Doing online
research I found Django+Apache makes good combination.

Regards,
Sarfaraz Ahmed

On 6 May 2017 at 01:41, Luiz Guilherme Silva 
wrote:

> Hello Ahmed.
>
> Why are you using apache instead of IIS? I know it's not the question, but
> I've worked in a project running on IIS for a long time without big
> problems, and you don't need Apache for this.
>
> 2017-05-04 16:00 GMT-03:00 sarfaraz ahmed :
>
>> Hello Friends,
>>
>> I have an Windows 2016 Server edition on EC2.
>> I install Apache 2.4 VC10 on my server and installed 2.7.13
>>
>> I am not able to find MOD_WSGI.SO for this combination.
>>
>> Can someone provide me steps to compile or link to download
>>
>> --
>> Thanks with regards,
>> Sarfaraz Ahmed
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAEPJdixOMiS%3DBsPusybJaoKhJfaa1Pfqy6D3ND%3
>> DEOQ8EkbsnDA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAEPJdixOMiS%3DBsPusybJaoKhJfaa1Pfqy6D3ND%3DEOQ8EkbsnDA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAPgKrJ2V6OWuJ6ZTQVASYa1aUtMpgm-TeQ0EJxODqZ3i78tt%3DA%
> 40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPgKrJ2V6OWuJ6ZTQVASYa1aUtMpgm-TeQ0EJxODqZ3i78tt%3DA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

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


Need help with deployment

2017-05-04 Thread sarfaraz ahmed
Hello Friends,

I have an Windows 2016 Server edition on EC2.
I install Apache 2.4 VC10 on my server and installed 2.7.13

I am not able to find MOD_WSGI.SO for this combination.

Can someone provide me steps to compile or link to download

-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: password_reset error

2017-04-10 Thread sarfaraz ahmed
Thanks... I tried... everythings...

It worked..




On 10 April 2017 at 13:21, ludovic coues  wrote:

> That should be all the information needed to fix the problem :)
>
> TL:DR:
> use `{{ protocol }}://{{ domain }}{% url 
> 'user_management:password_reset_confirm'
> uidb64=uid token=token %}` on line 5 of your email template.
>
> Long answer:
> The amount of information you provided last time would have been enough
> for my gut feeling, which is the same as the tl;dr. But I needed pretty
> much everything you have given here to be sure :)
>
> The traceback is pretty much useless to finding the origin of the error
> with template. That's why there is a Template error section. In you case,
> as you can guess, django try to find a named url but get nothing. To know
> why, we need to dive into the source and the traceback will be our guide.
>
> Starting with the end, the two last function, _reverse_with_prefix and
> reverse are internal to django routing. I let them alone.
> Next one live in defaulttags and cause issue at a call to reverse. I
> believe that it's the url template tag. I'm mainly curious about the
> current_app argument in reverse. I know that url name can take the form
> "app:name". In your case, that would be 
> "user_management:password_reset_confirm".
> The current_app argument come from the context property of the tag object
> [1].
> When looking at the traceback, two things stand out for the few followings
> lines. They all live in the template module and they all have a context
> argument. So I skip them.
> Next stop is send_mail in contrib/auth/forms.py. We get out of the
> template module but we still have the context argument, which disappear in
> the following line. Look like a good place to find the value of context.
> Oops, look like I was off by one. send_mail take the context argument from
> save, same file. The call to send_mail taking 4 lines, the context argument
> have been stripped from the line in the traceback. But the context is
> defined in the save method [2].
> You will notice it's a simple dict without a request key. But if you have
> looked at how the URL tag define the current_app, you'll notice it make use
> of the request key of the context.
>
> That's the root of your problem. Email are generated without a request.
> And without a request, you need to specify the full name of url, as you
> don't have access to the current_app. By the way, current_app is matching
> app_name you specify in your URL.py file. That's why I asked the full
> urls.py the first time.
>
> I hope I'm clear and that will help you :)
> All you need to remember is that sometimes, you need to specify the full
> name of an url.
>
> [1] https://github.com/django/django/blob/1.10.5/django/
> template/defaulttags.py#L428-L434
> [2] https://github.com/django/django/blob/1.10.5/django/
> contrib/auth/forms.py#L278-L286
>
> 2017-04-10 7:09 GMT+02:00 sarfaraz ahmed :
>
>> Hello Friends,
>>
>> I have attempted to make CustomUser model in django to signin using email.
>>
>> I am using password_reset view when I am getting this error. I checked
>> password_reset view and found i am getting error during this line
>>
>> form.save(**opts)
>>
>> in password_reset
>>
>> 
>> 
>> 
>> URL.py
>> 
>> 
>> from django.conf.urls import url,include
>>
>> from django.conf.urls import url
>> from django.conf.urls import include
>>
>>
>> from . import views
>> from views import *
>>
>>
>> from django.contrib.auth import views as auth_views
>> from django.contrib.auth.views import password_reset,password_reset_done
>>
>>
>> app_name ="user_management"
>>
>> urlpatterns =   [
>> url(r'^login/',login,name='login'),
>> url(r'^auth_view/',auth_view, name='auth_view'),
>> url(r'^signup_success/',signup
>> _success,name='signup_success'),
>> url(r'^signup/',signup,name='signup'),
>> url(r'^logout/',logout,name='logout'),
>> url(r'^signup_confirm/(?P> vation_key>\w+)',signup_confirm,name='signup_confirm'),
>> url(r'^acc

Re: Password reset custom view

2017-04-09 Thread sarfaraz ahmed
https://groups.google.com/forum/#!topic/django-users/6mYFE2pgt0w

This is full info  about new error

On 10 April 2017 at 10:41, sarfaraz ahmed  wrote:

> I fixed that i am facing new error. Posted as new problem
>
> regards,
> Sarfaraz Ahmed
>
> On 10 April 2017 at 01:49, Matthew Pava  wrote:
>
>> As another user mentioned, you did not specify the name keyword argument
>> for password_reset_done.  You also have the line commented out in your urls
>> file.
>>
>>
>>
>> # url(r'^password_reset/done/$', auth_views.password_reset_done,
>> {'template_name': 'user_management/password_rese
>> t_done.html','post_reset_redirect':'/reset/done/'}),
>>
>>
>>
>> should become
>>
>>
>>
>> url(r'^password_reset/done/$', auth_views.password_reset_done,
>> {'template_name': 'user_management/password_rese
>> t_done.html','post_reset_redirect':'/reset/done/'},
>> name='password_reset_done'),
>>
>>
>>
>> *From:* django-users@googlegroups.com [mailto:django-users@googlegro
>> ups.com] *On Behalf Of *sarfaraz ahmed
>> *Sent:* Sunday, April 9, 2017 3:13 PM
>> *To:* django-users@googlegroups.com
>> *Subject:* Re: Password reset custom view
>>
>>
>>
>> Here is full error message
>> 
>> 
>> NoReverseMatch at /password_reset/
>>
>> Reverse for 'password_reset_done' with arguments '()' and keyword arguments 
>> '{}' not found. 0 pattern(s) tried: []
>>
>> Request Method: GET Request URL: http://127.0.0.1:8000/password_reset/
>> Django Version: 1.10.5 Exception Type: NoReverseMatch Exception Value:
>>
>> Reverse for 'password_reset_done' with arguments '()' and keyword arguments 
>> '{}' not found. 0 pattern(s) tried: []
>>
>> Exception Location: C:\Python27\lib\site-packages\
>> django-1.10.5-py2.7.egg\django\urls\resolvers.py in
>> _reverse_with_prefix, line 392 Python Executable: C:\Python27\python.exe
>> Python Version: 2.7.9 Python Path:
>>
>> ['G:\\DJANGO_Project\\project1',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_extensions-1.4.9-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\six-1.9.0-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\werkzeug-0.9.6-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_cron-0.3.5-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_common_helpers-0.6.3-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\south-1.0.2-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_crontab-0.6.0-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_kronos-0.6-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\python_crontab-1.9.1-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_chronograph-0.3.1-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\python_dateutil-1.5-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\crontab-0.20.2-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_chroniker-0.6.8-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\psutil-2.2.0-py2.7-win32.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\celery-3.1.17-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\kombu-3.0.24-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\billiard-3.3.0.19-py2.7-win32.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\pytz-2014.10-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\amqp-1.4.6-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\anyjson-0.3.3-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_celery-3.1.16-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_kombu-0.9.4-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\django_windows_tools-0.1.1-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\elasticsearch-1.3.0-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\urllib3-1.10.1-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\beautifulsoup-3.2.1-py2.7.egg',
>>
>>  'C:\\Python27\\lib\\site-packages\\xmluti

Re: Password reset custom view

2017-04-09 Thread sarfaraz ahmed
I fixed that i am facing new error. Posted as new problem

regards,
Sarfaraz Ahmed

On 10 April 2017 at 01:49, Matthew Pava  wrote:

> As another user mentioned, you did not specify the name keyword argument
> for password_reset_done.  You also have the line commented out in your urls
> file.
>
>
>
> # url(r'^password_reset/done/$', auth_views.password_reset_done,
> {'template_name': 'user_management/password_reset_done.html','post_reset_
> redirect':'/reset/done/'}),
>
>
>
> should become
>
>
>
> url(r'^password_reset/done/$', auth_views.password_reset_done,
> {'template_name': 
> 'user_management/password_reset_done.html','post_reset_redirect':'/reset/done/'},
> name='password_reset_done'),
>
>
>
> *From:* django-users@googlegroups.com [mailto:django-users@
> googlegroups.com] *On Behalf Of *sarfaraz ahmed
> *Sent:* Sunday, April 9, 2017 3:13 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: Password reset custom view
>
>
>
> Here is full error message
> 
> 
> NoReverseMatch at /password_reset/
>
> Reverse for 'password_reset_done' with arguments '()' and keyword arguments 
> '{}' not found. 0 pattern(s) tried: []
>
> Request Method: GET Request URL: http://127.0.0.1:8000/password_reset/
> Django Version: 1.10.5 Exception Type: NoReverseMatch Exception Value:
>
> Reverse for 'password_reset_done' with arguments '()' and keyword arguments 
> '{}' not found. 0 pattern(s) tried: []
>
> Exception Location: 
> C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\urls\resolvers.py
> in _reverse_with_prefix, line 392 Python Executable: C:\Python27\python.exe
> Python Version: 2.7.9 Python Path:
>
> ['G:\\DJANGO_Project\\project1',
>
>  'C:\\Python27\\lib\\site-packages\\django_extensions-1.4.9-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\six-1.9.0-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\werkzeug-0.9.6-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_cron-0.3.5-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_common_helpers-0.6.3-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\south-1.0.2-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_crontab-0.6.0-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_kronos-0.6-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\python_crontab-1.9.1-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_chronograph-0.3.1-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\python_dateutil-1.5-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\crontab-0.20.2-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_chroniker-0.6.8-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\psutil-2.2.0-py2.7-win32.egg',
>
>  'C:\\Python27\\lib\\site-packages\\celery-3.1.17-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\kombu-3.0.24-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\billiard-3.3.0.19-py2.7-win32.egg',
>
>  'C:\\Python27\\lib\\site-packages\\pytz-2014.10-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\amqp-1.4.6-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\anyjson-0.3.3-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_celery-3.1.16-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_kombu-0.9.4-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\django_windows_tools-0.1.1-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\elasticsearch-1.3.0-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\urllib3-1.10.1-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\beautifulsoup-3.2.1-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\xmlutils-1.1-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\pillow-2.9.0-py2.7-win32.egg',
>
>  'C:\\Python27\\lib\\site-packages\\requests-2.7.0-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\openpyxl-2.3.4-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\et_xmlfile-1.0.1-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\jdcal-1.2-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\xlrd-0.9.4-py2.7.egg',
>
>  'C:\\Python27\\lib\\site-packages\\webcolors-1.5-py2.7.egg',

password_reset error

2017-04-09 Thread sarfaraz ahmed
eware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']


Template error:
In template
G:\DJANGO_Project\project1\user_management\templates\user_management\password_reset_email.html,
error at line 5
   Reverse for 'password_reset_confirm' with arguments '()' and keyword
arguments '{u'uidb64': 'Mg', u'token': u'4l3-29face0d2514fc5a70e4'}' not
found. 0 pattern(s) tried: []   1 : {% autoescape off %}
   2 : To initiate the password reset process for your {{ user.get_username
}} Arham Account,
   3 : click the link below:
   4 :
   5 : {{ protocol }}://{{ domain }} {% url 'password_reset_confirm'
uidb64=uid token=token %}
   6 :
   7 : If clicking the link above doesn't work, please copy and paste the
URL in a new browser
   8 : window instead.
   9 :
   10 : Sincerely,
   11 : The Arham Collections
   12 : {% endautoescape %}

Traceback:

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\handlers\exception.py"
in inner
  39. response = get_response(request)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\handlers\base.py"
in _get_response
  187. response = self.process_exception_by_middleware(e,
request)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\core\handlers\base.py"
in _get_response
  185. response = wrapped_callback(request, *callback_args,
**callback_kwargs)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\contrib\auth\views.py"
in inner
  47. return func(*args, **kwargs)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\utils\decorators.py"
in _wrapped_view
  149. response = view_func(request, *args, **kwargs)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\contrib\auth\views.py"
in password_reset
  212. form.save(**opts)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\contrib\auth\forms.py"
in save
  291. user.email,
html_email_template_name=html_email_template_name,

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\contrib\auth\forms.py"
in send_mail
  240. body = loader.render_to_string(email_template_name, context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\loader.py"
in render_to_string
  68. return template.render(context, request)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\backends\django.py"
in render
  66. return self.template.render(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\base.py"
in render
  208. return self._render(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\base.py"
in _render
  199. return self.nodelist.render(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\base.py"
in render
  994. bit = node.render_annotated(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\base.py"
in render_annotated
  961. return self.render(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\defaulttags.py"
in render
  39. output = self.nodelist.render(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\base.py"
in render
  994. bit = node.render_annotated(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\base.py"
in render_annotated
  961. return self.render(context)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\template\defaulttags.py"
in render
  439. url = reverse(view_name, args=args, kwargs=kwargs,
current_app=current_app)

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\urls\base.py"
in reverse
  91. return force_text(iri_to_uri(resolver._reverse_with_prefix(view,
prefix, *args, **kwargs)))

File
"C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\urls\resolvers.py"
in _reverse_with_prefix
  392. (lookup_view_s, args, kwargs, len(patterns), patterns)

Exception Type: NoReverseMatch at /password_reset/
Exception Value: Reverse for 'password_reset_confirm' with arguments '()'
and keyword arguments '{u'uidb64': 'Mg', u'token':
u'4l3-29face0d2514fc5a70e4'}' not found. 0 pattern(s) tried: []
-
I hope this information is enough
-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: Password reset custom view

2017-04-09 Thread sarfaraz ahmed
Here is full error message

NoReverseMatch at /password_reset/

Reverse for 'password_reset_done' with arguments '()' and keyword
arguments '{}' not found. 0 pattern(s) tried: []

Request Method: GET Request URL: http://127.0.0.1:8000/password_reset/
Django Version: 1.10.5 Exception Type: NoReverseMatch Exception Value:

Reverse for 'password_reset_done' with arguments '()' and keyword
arguments '{}' not found. 0 pattern(s) tried: []

Exception Location:
C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\urls\resolvers.py
in _reverse_with_prefix, line 392 Python Executable: C:\Python27\python.exe
Python Version: 2.7.9 Python Path:

['G:\\DJANGO_Project\\project1',
 'C:\\Python27\\lib\\site-packages\\django_extensions-1.4.9-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\six-1.9.0-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\werkzeug-0.9.6-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_cron-0.3.5-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_common_helpers-0.6.3-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\south-1.0.2-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_crontab-0.6.0-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_kronos-0.6-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\python_crontab-1.9.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_chronograph-0.3.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\python_dateutil-1.5-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\crontab-0.20.2-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_chroniker-0.6.8-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\psutil-2.2.0-py2.7-win32.egg',
 'C:\\Python27\\lib\\site-packages\\celery-3.1.17-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\kombu-3.0.24-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\billiard-3.3.0.19-py2.7-win32.egg',
 'C:\\Python27\\lib\\site-packages\\pytz-2014.10-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\amqp-1.4.6-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\anyjson-0.3.3-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_celery-3.1.16-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_kombu-0.9.4-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django_windows_tools-0.1.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\elasticsearch-1.3.0-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\urllib3-1.10.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\beautifulsoup-3.2.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\xmlutils-1.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\pillow-2.9.0-py2.7-win32.egg',
 'C:\\Python27\\lib\\site-packages\\requests-2.7.0-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\openpyxl-2.3.4-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\et_xmlfile-1.0.1-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\jdcal-1.2-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\xlrd-0.9.4-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\webcolors-1.5-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\bpython-0.15-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\greenlet-0.4.9-py2.7-win32.egg',
 'C:\\Python27\\lib\\site-packages\\curtsies-0.2.6-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\pygments-2.1.3-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\wcwidth-0.1.6-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\blessings-1.6-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\dnspython-1.14.0-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django-1.10.5-py2.7.egg',
 'C:\\Windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages',
 'C:\\Python27\\lib\\site-packages\\win32',
 'C:\\Python27\\lib\\site-packages\\win32\\lib',
 'C:\\Python27\\lib\\site-packages\\Pythonwin']

Server time: Sun, 9 Apr 2017 20:09:38 +


URL.py


from django.conf.urls import url,include

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


from . import views
from views import *


from django.contrib.auth import views as auth_views


app_name ="user_management"

urlpatterns =   [
url(r'^login/',login,name='login'),
url(r'^auth_view/',auth_view, name='auth_view'),

url(r'^signup_success/',signup_success,name='signup_success'),
url(r'^signup/',signup,name='signup'),
url(r'^logout/',logout,name='logout'),

url(r'^signup_confirm/(?P\w+)',signup_confirm,name='signup_confirm'),
url(r'^account_info/',account_info,name='account_info'),
url(r'^user_profile/',user_profile,name='user_profile'),
url(r'^address/',address,name='address'),

url(r'^change_password/',change_password,name='change_password'),
url(r'^add_address/

Re: Password reset custom view

2017-04-09 Thread sarfaraz ahmed
This is full url.py... i have made all templates I also used
name="password_reset_done". But still get same error

On 9 April 2017 at 18:19, ludovic coues  wrote:

> Do you mind to share your full urls.py file and the full traceback ?
>
> If I have to take a guess with the informations you have have shared,
> I would say the line
>
>url(r'^password_reset/done/$', auth_views.password_reset_done,
> {'template_name':
> 'user_management/password_reset_done.html','post_reset_
> redirect':'password_reset_confirm'}),
>
> is missing an argument name="password_reset_done".
>
> 2017-04-09 7:26 GMT+02:00 sarfaraz ahmed :
> >
> > urlpatterns =   [
> > url(r'^login/',login,name='login'),
> > url(r'^auth_view/',auth_view, name='auth_view'),
> >
> > url(r'^signup_success/',signup_success,name='signup_success'),
> > url(r'^signup/',signup,name='signup'),
> > url(r'^logout/',logout,name='logout'),
> >
> > url(r'^signup_confirm/(?P\w+)',signup_
> confirm,name='signup_confirm'),
> > url(r'^account_info/',account_info,name='account_info'),
> > url(r'^user_profile/',user_profile,name='user_profile'),
> > url(r'^address/',address,name='address'),
> >
> > url(r'^change_password/',change_password,name='change_password'),
> > url(r'^add_address/',add_address,name='add_address'),
> >
> > url(r'^edit_address/(?P\d+)',edit_address,name='edit_address'),
> >
> > url(r'^delete_address/(?P\d+)',delete_address,name='
> delete_address'),
> >
> > url(r'^change_password/',change_password,name='change_password'),
> > url(r'^email_test/',email_test,name='email_test'),
> > url(r'^password_reset/$', auth_views.password_reset
> > ,{'template_name':'user_management/password_reset.
> html','email_template_name':
> > 'user_management/password_reset_email.html'}),
> > url(r'^password_reset/done/$',
> > auth_views.password_reset_done,  {'template_name':
> > 'user_management/password_reset_done.html','post_reset_
> redirect':'password_reset_confirm'}),
> >
> > url(r'^reset/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-
> z]{1,13}-[0-9A-Za-z]{1,20})/$',
> > auth_views.password_reset_confirm,
> > name='password_reset_confirm'),
> > url(r'^reset/done/$', auth_views.password_reset_
> complete,
> > {'template_name':'user_management/password_reset_complete.html'},name='
> password_reset_complete'),
> > ]
> >
> >
> > ----
> ----
> ----
> > ERROR
> > 
> 
> 
> > Request Method: GET Request URL: http://127.0.0.1:8000/password_reset/
> > Django Version: 1.10.5 Exception Type: NoReverseMatch Exception Value:
> >
> > Reverse for 'password_reset_done' with arguments '()' and keyword
> arguments
> > '{}' not found. 0 pattern(s) tried: []
> >
> > Exception Location:
> > C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\
> django\urls\resolvers.py
> > in _reverse_with_prefix, line 392 Python Executable:
> C:\Python27\python.exe
> > Python Version: 2.7.9
> >
> > Please help
> >
> >
> > --
> > Thanks with regards,
> > Sarfaraz Ahmed
> >
> >
> >
> > --
> > Thanks with regards,
> > Sarfaraz Ahmed
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at https://groups.google.com/group/django-users.
> > To view this 

Password reset custom view

2017-04-08 Thread sarfaraz ahmed
urlpatterns =   [
url(r'^login/',login,name='login'),
url(r'^auth_view/',auth_view, name='auth_view'),

url(r'^signup_success/',signup_success,name='signup_success'),
url(r'^signup/',signup,name='signup'),
url(r'^logout/',logout,name='logout'),

url(r'^signup_confirm/(?P\w+)',signup_confirm,name='signup_confirm'),
url(r'^account_info/',account_info,name='account_info'),
url(r'^user_profile/',user_profile,name='user_profile'),
url(r'^address/',address,name='address'),

url(r'^change_password/',change_password,name='change_password'),
url(r'^add_address/',add_address,name='add_address'),

url(r'^edit_address/(?P\d+)',edit_address,name='edit_address'),

url(r'^delete_address/(?P\d+)',delete_address,name='delete_address'),

url(r'^change_password/',change_password,name='change_password'),
url(r'^email_test/',email_test,name='email_test'),
url(r'^password_reset/$', auth_views.password_reset
,{'template_name':'user_management/password_reset.html','email_template_name':
'user_management/password_reset_email.html'}),
url(r'^password_reset/done/$',
auth_views.password_reset_done,  {'template_name':
'user_management/password_reset_done.html','post_reset_redirect':'password_reset_confirm'}),

url(r'^reset/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
auth_views.password_reset_confirm,
name='password_reset_confirm'),
url(r'^reset/done/$', auth_views.password_reset_complete,
{'template_name':'user_management/password_reset_complete.html'},name='password_reset_complete'),
]



ERROR

Request Method: GET Request URL: http://127.0.0.1:8000/password_reset/
Django Version: 1.10.5 Exception Type: NoReverseMatch Exception Value:

Reverse for 'password_reset_done' with arguments '()' and keyword arguments
'{}' not found. 0 pattern(s) tried: []

Exception Location:
C:\Python27\lib\site-packages\django-1.10.5-py2.7.egg\django\urls\resolvers.py
in _reverse_with_prefix, line 392 Python Executable: C:\Python27\python.exe
Python Version: 2.7.9

Please help


-- 
Thanks with regards,
Sarfaraz Ahmed



-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: Hello I am new to django

2017-03-05 Thread sarfaraz ahmed
Where to include
models.OneToOneField(CustomUser, related_name='profile')

I tried including this in customuser model it does not understand.



On 5 March 2017 at 14:24, ludovic coues  wrote:

> You should look at the related_name argument of relationship. Using `
> models.OneToOneField(CustomUser, related_name='profile')` will add a
> profile property to your custom user object.
>
> Then your function became something like that :
>
> def get_full_name(self):
> full_name = '%s %s' %(self.profile.first_name, self.profile.last_
> name)
> return full_name.strip()
>
> Don't forget to write some test and to take into account what happens if
> you user have no UserProfile associated
>
> On 5 Mar 2017 1:09 a.m., "sarfaraz ahmed"  wrote:
>
> I am trying to create custom user authentication using abstractbaseuser.
> All worked fine. but I wanted to move first_name and last_name to other
> models
>
>
> from django.db import models
> from django.contrib.auth.models import AbstractBaseUser,BaseUserManag
> er,PermissionsMixin
> from django.core.mail import send_mail
> from django.utils.translation import ugettext_lazy as _
> #now=time.strftime('%Y-%M-%D %H:%m:%S.%u%Z')
> import datetime
> from datetime import timedelta
>
> from django.utils import timezone
>
> tomorrow = datetime.date.today() + timedelta(days=1)
>
> class CustomUserManager(BaseUserManager):
> def _create_user(self,email,password,is_staff,is_superuser,
> **extra_fields):
>
> if not email:
> raise ValueError('The given email must be set')
>
> email=self.normalize_email(email)
> user= self.model(email=email,
>  is_staff=is_staff,
>  is_active = True,
>  is_superuser =is_superuser,
>  last_login=timezone.now(),
>  date_joined=timezone.now(),
> **extra_fields)
> user.set_password(password)
> user.save(using=self._db)
> return user
>
> def create_user(self, email,password=None,**extra_fields):
> return self._create_user(email,passwo
> rd,False,False,**extra_fields)
>
> def create_superuser(self, email,password,**extra_fields):
> return self._create_user(email,password,True,True,**extra_fields)
>
> class CustomUser(AbstractBaseUser,PermissionsMixin):
> username =models.CharField(max_length =256, unique = True,blank =
> True,null= True)
> email =models.EmailField(blank=False, unique =True)
> date_joined  = models.DateTimeField(_('date joined'),
> default=timezone.now())
> is_active= models.BooleanField(default=True)
> is_admin = models.BooleanField(default=False)
> is_staff = models.BooleanField(default=False)
> is_superuser = models.BooleanField(default=False)
>
> USERNAME_FIELD ='email'
> REQUIRED_FIELD =['user_name','date_joined']
>
> objects=CustomUserManager()
>
> class Meta:
> verbose_name=_('user')
> verbose_name_plural=_('users')
>
> def get_absolute_url(self):
> return "/user/%s" %urlquote(self.email)
>
> def get_full_name(self):
>
>
>
> *#a=UserProfile.objects.get(id=id)
> #self.first_name=a.first_name#self.last_name= a.last_name*
> full_name = '%s %s' %(self.first_name,self.last_name)
> return full_name.strip()
>
> def get_short_name(self):
> self.first_name='a'
> return self.first_name
>
> def email_user(self,subject,message,from_email=None):
> send_mail(subject,message,from_email,[self.email])
>
>
> #code
>
> class UserProfile(models.Model):
>
> email = models.OneToOneField(CustomUser)
> first_name=models.CharField(max_length =256, blank = True)
> last_name=models.CharField(max_length =256, blank = True)
> activation_key = models.CharField(max_length=40,blank=True)
> gender = models.CharField(max_length=6, choices=(
> ('male', 'Male'),
> ('female', 'Female'),))
> date_of_birth=models.DateField(null=True)
> key_expires = models.DateTimeField(default=timezone.now())
>
> def __str__(self):
> full_name = '%s %s' %(self.first_name,self.last_name)
> return full_name
>
> class Meta:
> verbose_name=u'User profile'
> verbose_name_plural=u'User profiles'
>
>
> class UserAddress(m

Hello I am new to django

2017-03-04 Thread sarfaraz ahmed
I am trying to create custom user authentication using abstractbaseuser.
All worked fine. but I wanted to move first_name and last_name to other
models


from django.db import models
from django.contrib.auth.models import
AbstractBaseUser,BaseUserManager,PermissionsMixin
from django.core.mail import send_mail
from django.utils.translation import ugettext_lazy as _
#now=time.strftime('%Y-%M-%D %H:%m:%S.%u%Z')
import datetime
from datetime import timedelta

from django.utils import timezone

tomorrow = datetime.date.today() + timedelta(days=1)

class CustomUserManager(BaseUserManager):
def _create_user(self,email,password,is_staff,is_superuser,
**extra_fields):

if not email:
raise ValueError('The given email must be set')

email=self.normalize_email(email)
user= self.model(email=email,
 is_staff=is_staff,
 is_active = True,
 is_superuser =is_superuser,
 last_login=timezone.now(),
 date_joined=timezone.now(),
**extra_fields)
user.set_password(password)
user.save(using=self._db)
return user

def create_user(self, email,password=None,**extra_fields):
return self._create_user(email,password,False,False,**extra_fields)

def create_superuser(self, email,password,**extra_fields):
return self._create_user(email,password,True,True,**extra_fields)

class CustomUser(AbstractBaseUser,PermissionsMixin):
username =models.CharField(max_length =256, unique = True,blank =
True,null= True)
email =models.EmailField(blank=False, unique =True)
date_joined  = models.DateTimeField(_('date joined'),
default=timezone.now())
is_active= models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)
is_staff = models.BooleanField(default=False)
is_superuser = models.BooleanField(default=False)

USERNAME_FIELD ='email'
REQUIRED_FIELD =['user_name','date_joined']

objects=CustomUserManager()

class Meta:
verbose_name=_('user')
verbose_name_plural=_('users')

def get_absolute_url(self):
return "/user/%s" %urlquote(self.email)

def get_full_name(self):



*#a=UserProfile.objects.get(id=id)
#self.first_name=a.first_name#self.last_name= a.last_name*
full_name = '%s %s' %(self.first_name,self.last_name)
return full_name.strip()

def get_short_name(self):
self.first_name='a'
return self.first_name

def email_user(self,subject,message,from_email=None):
send_mail(subject,message,from_email,[self.email])


#code

class UserProfile(models.Model):

email = models.OneToOneField(CustomUser)
first_name=models.CharField(max_length =256, blank = True)
last_name=models.CharField(max_length =256, blank = True)
activation_key = models.CharField(max_length=40,blank=True)
gender = models.CharField(max_length=6, choices=(
('male', 'Male'),
('female', 'Female'),))
date_of_birth=models.DateField(null=True)
key_expires = models.DateTimeField(default=timezone.now())

def __str__(self):
full_name = '%s %s' %(self.first_name,self.last_name)
return full_name

class Meta:
verbose_name=u'User profile'
verbose_name_plural=u'User profiles'


class UserAddress(models.Model):
address_contact=models.CharField(max_length=300,blank=False)
address_line1=models.CharField(max_length=300,blank=False)
address_line2=models.CharField(max_length=300,blank=True)
land_mark=models.CharField(max_length=100,blank=False)
city=models.CharField(max_length=140,blank=False)
state=models.CharField(max_length=100,blank=False)
pin_code = models.BigIntegerField()
mobile_no=models.CharField(max_length=13,blank=True)
last_shipped_flag=models.BooleanField(default=False)
is_active_flag=models.BooleanField(default=True)
creation_date=models.DateTimeField(auto_now_add=True,editable=False)
updation_date=models.DateTimeField(auto_now=True,editable=False)
user=models.ForeignKey(UserProfile,default=0)

def __str__(self):
return self.address_contact


class Meta:
verbose_name=u'User Address'
verbose_name_plural=u'User Addresses'


Now get_full_name is part of customuser model where was first_name and
last_name are part UserProfile.
Please help me to join both models using onetoone relationship

-- 
Thanks with regards,
Sarfaraz Ahmed

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

Re: Need help with auto_now_add and auto_now fields

2015-08-03 Thread sarfaraz ahmed
I have entries present in User Profile Table. But this field belongs to
User_Address model which is new and does not have any entries present.
Please advice.




On Tue, Aug 4, 2015 at 12:51 AM, rajan santhanam 
wrote:

> Hi Ahmed,
>
> This message is because you hav few entries already present for that model
> in DB. If it is OK for you, you can add datetime.now as default value for
> the existing rows
>
> Many Thanks
> Rajan
>
> --
> 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/CACO5KE9VA0QFKmk25HpEnwubKSpbk_6LUT%2BU%3DUwh7y0Dgu3YYw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACO5KE9VA0QFKmk25HpEnwubKSpbk_6LUT%2BU%3DUwh7y0Dgu3YYw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: Need help with auto_now_add and auto_now fields

2015-08-03 Thread sarfaraz ahmed
I missed the pastebin link in my last post. Sorry...

Here is the model code
http://pastebin.com/5EF1hV8U


On Tuesday, 4 August 2015 00:48:18 UTC+5:30, sarfaraz ahmed wrote:
>
> Hello Team,
>
> I have a model and I have added two fields to User_Address model 
> creation_date and updation_date. I have pasted the model code at pastebin. 
> Please take a look. 
>
> I am getting following error while running makemigrations command 
>
> You are trying to add a non-nullable field 'creation_date' to user_address 
> witho
> ut a default; we can't do that (the database needs something to populate 
> existin
> g rows).
> Please select a fix:
>  1) Provide a one-off default now (will be set on all existing rows)
>  2) Quit, and let me add a default in models.py
> Select an option: 
>
> Please help...
>
> Regards,
> Sarfaraz Ahmed
>

-- 
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/4339bbfd-d91b-4ef7-8669-be22e02b332e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need help with auto_now_add and auto_now fields

2015-08-03 Thread sarfaraz ahmed
Hello Team,

I have a model and I have added two fields to User_Address model 
creation_date and updation_date. I have pasted the model code at pastebin. 
Please take a look. 

I am getting following error while running makemigrations command 

You are trying to add a non-nullable field 'creation_date' to user_address 
witho
ut a default; we can't do that (the database needs something to populate 
existin
g rows).
Please select a fix:
 1) Provide a one-off default now (will be set on all existing rows)
 2) Quit, and let me add a default in models.py
Select an option: 

Please help...

Regards,
Sarfaraz Ahmed

-- 
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/93c56122-26f6-4bb1-89b5-d1b310c0fb68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Introduction to Pulpo-Forms

2015-08-02 Thread sarfaraz ahmed
Demos looks great. Can you post some videos showing actual
implementationsin some project. I am planning to work on project which
need to capture geo-location ..

I think this will be awesome..

Great work...!!

Regards,
Sarfaraz Ahmed

On Sat, Aug 1, 2015 at 2:55 AM, Luciano Ferrari  wrote:

> Excellent Fabio!!!
>
> Thanks for the suggestion we will take that into account.
>
> Luciano
>
>
> El viernes, 31 de julio de 2015, 17:30:07 (UTC-3), Fabio Caritas
> Barrionuevo da Luz escribió:
>>
>> interesting, thanks for sharing.
>>
>> personally, I think that the organization of files on package is somewhat
>> confusing.
>>
>> said that, you can use a template (skeleton) as a base to create and
>> better organize the package.
>> I like these two
>>
>> for a django package:
>>
>> https://github.com/pydanny/cookiecutter-djangopackage
>>
>> or more generic to any python package:
>>
>> https://github.com/ionelmc/cookiecutter-pylibrary
>>
>> It is quite easy to generate a new project skeleton:
>>
>> pip install cookiecutter
>>
>> cookiecutter https://github.com/pydanny/cookiecutter-djangopackage
>>
>> or
>>
>> cookiecutter https://github.com/ionelmc/cookiecutter-pylibrary
>>
>>
>>
>> Em quinta-feira, 30 de julho de 2015 18:46:12 UTC-3, Luciano Ferrari
>> escreveu:
>>>
>>> Last April we finished the development of a dynamic form builder, called
>>> pulpo-forms, to use within a Django Project. Today we’re excited to
>>> announce that we’re making the source code available on GitHub
>>> <https://github.com/octobot-dev/pulpo-forms-django>.
>>>
>>> Here is a short list with the most important features of this new open
>>> source tool:
>>>
>>>- Enable users to create forms with an easy drag&drop UI
>>>- Angular directives to render the form
>>><https://github.com/octobot-dev/pulpo-forms-angular>and the dashboard
>>>- Multi pages forms.
>>>- RESTful API
>>>- Customizable fields validations such as required, length,etc.
>>>- Conditional enable for fields based on other field values (e.g. in
>>>a food preferences survey, hide the *‘How do you like your steak?’ 
>>> *question
>>>to someone that previously answered that’s a vegetarian).
>>>- Conditional enable for form pages based on other field values.
>>>- Versions and drafts.
>>>- Integration for Django models.
>>>- Signals.
>>>- Configurable actions – show a thank you screen, send an email, etc.
>>>- Built-in statistics in the dashboard
>>>- Basic field types answers can be filtered in the dashboard
>>>
>>> Since it was made to be flexible from the beginning, this can be
>>> extended to add new fields, validations and so on.
>>>
>>> We hope you enjoy it, and of coursed we are open to comments, questions
>>> and pull requests <https://github.com/octobot-dev/pulpo-forms-django>!
>>>
>> --
> 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/f5bc7597-8dd7-480c-8db3-3a092368b573%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f5bc7597-8dd7-480c-8db3-3a092368b573%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

-- 
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/CAEPJdiygirAK7JPkYm2z5HB0DetXdMe604ZCD%2Bsyk3-UQUm-fA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie: Saving User and UserProfle from same template

2015-08-02 Thread sarfaraz ahmed
It worked for me!! Please review my code... and let me know if I have
done everything correct...!!

On Sun, Aug 2, 2015 at 12:25 PM, sarfaraz ahmed 
wrote:

> Changed the edit_user to following. it works fine except... newly added
> field date_of_birth does not load data.
> Please take a look at link below
> http://pastebin.com/nXpiLMJp
>
> 
> Regards,
> Sarfaraz Ahmed
>
>
> On Sunday, 2 August 2015 01:28:37 UTC+5:30, sarfaraz ahmed wrote:
>>
>> Hello Team,
>>
>> I have extending the user with userprofile. I want to change first_name,
>> last_name and sex from userprofile using one template. I have defined form
>> and models. Please hellp this is code for edit_user view, model for user
>> profile and model forms code
>>
>>
>> ---
>>
>> class UserProfile(models.Model):
>>
>> user = models.OneToOneField(User)
>> activation_key = models.CharField(max_length=40,blank=True)
>> sex = models.CharField(max_length=6, choices=(
>> ('male', 'Male'),
>> ('female', 'Female'),))
>> key_expires = models.DateTimeField(default=datetime.date.today())
>>
>> def __str__(self):
>> return self.user.username
>>
>> class Meta:
>> verbose_name_plural=u'User profiles'
>>
>> ---
>> class UserProfileForm(forms.ModelForm):
>> class Meta:
>>model=User
>>fields =('first_name','last_name')
>>
>> class UserProfileForm1(forms.ModelForm):
>> class Meta:
>>model=UserProfile
>>fields=('sex',)
>>
>>
>> --
>> def edit_user(request):
>> args={}
>> if request.method=="POST":
>> form=UserProfileForm(request.POST, instance=request.user)
>>
>> if form.is_valid():
>> form.save()
>> form1=UserProfileForm1(request.POST, instance=request.user)
>> if form1.is_valid():
>> form1.save()
>> UserProfile.save()
>> return HttpResponseRedirect('/useraccount/edit_user')
>> else:
>> form=UserProfileForm()
>> form1=UserProfileForm1()
>>
>> args['form']=form
>> args['form1']=form1
>>
>> return render(request,'useraccount/edit_user.html',args)
>>
>> Now the i go to edit user view it load blank and do nothing when I click
>> on save. Please help
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>> --
> 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/ded7528b-5ca4-46bb-b222-7039892c23b5%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ded7528b-5ca4-46bb-b222-7039892c23b5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: Newbie: Saving User and UserProfle from same template

2015-08-01 Thread sarfaraz ahmed
Changed the edit_user to following. it works fine except... newly added 
field date_of_birth does not load data.
Please take a look at link below
http://pastebin.com/nXpiLMJp

Regards,
Sarfaraz Ahmed

On Sunday, 2 August 2015 01:28:37 UTC+5:30, sarfaraz ahmed wrote:
>
> Hello Team,
>
> I have extending the user with userprofile. I want to change first_name, 
> last_name and sex from userprofile using one template. I have defined form 
> and models. Please hellp this is code for edit_user view, model for user 
> profile and model forms code
>
>
> ---
>
> class UserProfile(models.Model):
> 
> user = models.OneToOneField(User)
> activation_key = models.CharField(max_length=40,blank=True)
> sex = models.CharField(max_length=6, choices=(
> ('male', 'Male'),
> ('female', 'Female'),))
> key_expires = models.DateTimeField(default=datetime.date.today())
>   
> def __str__(self):
> return self.user.username
>
> class Meta:
> verbose_name_plural=u'User profiles'
>
> ---
> class UserProfileForm(forms.ModelForm):
> class Meta:
>model=User
>fields =('first_name','last_name')
>
> class UserProfileForm1(forms.ModelForm):
> class Meta:
>model=UserProfile
>fields=('sex',)
>
>
> --
> def edit_user(request):
> args={}
> if request.method=="POST":
> form=UserProfileForm(request.POST, instance=request.user)
> 
> if form.is_valid():
> form.save()
> form1=UserProfileForm1(request.POST, instance=request.user)
> if form1.is_valid():
> form1.save()
> UserProfile.save()
> return HttpResponseRedirect('/useraccount/edit_user')
> else:
> form=UserProfileForm()
> form1=UserProfileForm1()
> 
> args['form']=form
> args['form1']=form1
> 
> return render(request,'useraccount/edit_user.html',args)
>
> Now the i go to edit user view it load blank and do nothing when I click 
> on save. Please help
>
> Regards,
> Sarfaraz Ahmed
>
>

-- 
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/ded7528b-5ca4-46bb-b222-7039892c23b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie: Saving User and UserProfle from same template

2015-08-01 Thread sarfaraz ahmed
Hello Team,

I have extending the user with userprofile. I want to change first_name, 
last_name and sex from userprofile using one template. I have defined form 
and models. Please hellp this is code for edit_user view, model for user 
profile and model forms code

---

class UserProfile(models.Model):

user = models.OneToOneField(User)
activation_key = models.CharField(max_length=40,blank=True)
sex = models.CharField(max_length=6, choices=(
('male', 'Male'),
('female', 'Female'),))
key_expires = models.DateTimeField(default=datetime.date.today())
  
def __str__(self):
return self.user.username

class Meta:
verbose_name_plural=u'User profiles'
---
class UserProfileForm(forms.ModelForm):
class Meta:
   model=User
   fields =('first_name','last_name')

class UserProfileForm1(forms.ModelForm):
class Meta:
   model=UserProfile
   fields=('sex',)

--
def edit_user(request):
args={}
if request.method=="POST":
form=UserProfileForm(request.POST, instance=request.user)

if form.is_valid():
form.save()
form1=UserProfileForm1(request.POST, instance=request.user)
if form1.is_valid():
form1.save()
UserProfile.save()
return HttpResponseRedirect('/useraccount/edit_user')
else:
form=UserProfileForm()
form1=UserProfileForm1()

args['form']=form
args['form1']=form1

return render(request,'useraccount/edit_user.html',args)

Now the i go to edit user view it load blank and do nothing when I click on 
save. Please help

Regards,
Sarfaraz Ahmed

-- 
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/74aaaff7-eec5-4564-a6e3-36c325b8e859%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re. My Django Book.

2015-07-31 Thread sarfaraz ahmed
I am also looking for books which provide more of examples. The two scoops
of Django is more of doing things right than tutoring as MOnobot said. This
are the following things I want to learn in Django

I want to learn how to manually create form rather than creating modelform.
Combing forms from multiple models and show them under one view.

Rgards,
Sarfaraz Ahmed

On Fri, Jul 31, 2015 at 9:01 PM, monoBOT  wrote:

> two scoops is more like ways of doing things right than really explaining
> or tutoring.
>
> 2015-07-31 15:33 GMT+01:00 Mark Phillips :
>
>> The django docs are excellent. However, if you are more of a book person,
>> then try Try Two Scoops of Django (http://twoscoopspress.org/) - well
>> written and updated.
>>
>> Mark
>>
>> On Fri, Jul 31, 2015 at 6:33 AM, rmschne  wrote:
>>
>>> I'm no way an advanced user, but I found the book simplistic and not
>>> worth it.  Django's own documentation is much better
>>> https://docs.djangoproject.com
>>>
>>> On Thursday, 30 July 2015 21:35:16 UTC+1, Steve Burrus wrote:
>>>>
>>>> * Say I was wondering if anyone else has ever read this particulkar
>>>> Django book called "Sams Teach Yourself Django in 24 Hours" I checked out
>>>> of the library yesterday? [yeah I know it's one of the "24 hours" series]
>>>> Does it really teach the beginner a lot of things concerning Django?*
>>>>
>>>>
>>>>
>>>>
>>> --
>>> 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/272afb4b-6e50-45be-92a8-4580049c3a3f%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/272afb4b-6e50-45be-92a8-4580049c3a3f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> 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/CAEqej2PGuSBiLChgYu9jk%3DS_5otDK1WMeZsfJqYYjKTMXh0TSQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAEqej2PGuSBiLChgYu9jk%3DS_5otDK1WMeZsfJqYYjKTMXh0TSQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> *monoBOT*
> Visite mi sitio(Visit my site): monobotsoft.es/blog/
>
> --
> 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/CA%2BxOsGAO8imS8%3D0OaDZiCGXFsWoyDs%3DCMtrAknd-gEqT8k0vqg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BxOsGAO8imS8%3D0OaDZiCGXFsWoyDs%3DCMtrAknd-gEqT8k0vqg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: Want to change template based on full_name(request.user.username)

2015-07-30 Thread sarfaraz ahmed
Thanks, this worked like awesome..!!!




On Thu, Jul 30, 2015 at 3:06 AM, Alex Heyden  wrote:

> {{user}} is implicitly sent in the request, so it might be worth trying to
> sort out what specifically went wrong when you say
> {{user.is_authenticated}} went wrong.
>
> Here's a fully functioning example of some things you can do with the user
> object:
>
> {% block header %}
>  role="navigation">
> 
> Home
> 
> {% if user.is_authenticated %}
> 
> 
> Projects
> Reports
> {% if user.is_staff %}
> Usage
> {% endif %}
> 
> 
> {% if user.is_superuser %}
> Settings
> {% endif %}
> 
>  data-toggle="dropdown">
> {% if user.first_name %}
> Welcome, {{ user.first_name }}
> {% else %}
> Welcome, {{ user.username }}
> {% endif %}
> 
> 
> Sign Out
> 
>     
> 
> 
> {% endif %}
> 
> {% endblock %}
>
> On Wed, Jul 29, 2015 at 4:20 PM, sarfaraz ahmed 
> wrote:
>
>> Hello All,
>>
>> I am facing an issue in my first django project. I am newbie. So, please
>> help me in detail. I don't want to use {{full_name}} in all the views. I
>> saw few post which says {{user.is_authenticated}} can be used. I tried but
>> it was not working. Passing {'full_name':request.user.username} to each is
>> very hectic. Also, not sure to this in one of my view where i am using
>> password_change. View is mentioned below where i am not able pass full_name.
>>
>> This is mentioned below is my *navigation.html*
>>
>>
>> 
>>   
>> 
>> 
>>   > data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
>> aria-expanded="false">
>> Toggle navigation
>> 
>> 
>> 
>>   
>>   
>> 
>>
>> 
>> > id="bs-example-navbar-collapse-1">
>>   
>> Home > class="sr-only">(current)
>> Sale > class="sr-only">(current)
>> About Us
>>
>>   
>> 
>>   
>>
>> {%if full_name %}
>>
>> 
>>
>>   > role="button" aria-haspopup="true" aria-expanded="false">{{full_name}}> class="caret">
>>   
>> My Account
>> Orders
>> Profile
>> Change
>> Password
>> 
>> Logout
>>   
>> 
>> {% else %}
>> Register
>> Login
>> {% endif %}
>>   
>> 
>>   
>> 
>>
>>
>> 
>> @login_required
>> def
>> my_change_password_view(request,template_name='useraccount/password_change_form.html'):
>> return password_change(request,template_name)
>>
>> --
>>
>> Please help.
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>> --
>> 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/f8521d79-c2a0-40a9-bd4e-0a90625264fe%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f8521d79-c2a0-40a9-bd4e-0a90625264fe%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options

Want to change template based on full_name(request.user.username)

2015-07-29 Thread sarfaraz ahmed
Hello All,

I am facing an issue in my first django project. I am newbie. So, please 
help me in detail. I don't want to use {{full_name}} in all the views. I 
saw few post which says {{user.is_authenticated}} can be used. I tried but 
it was not working. Passing {'full_name':request.user.username} to each is 
very hectic. Also, not sure to this in one of my view where i am using 
password_change. View is mentioned below where i am not able pass full_name.

This is mentioned below is my *navigation.html*



  


  
Toggle navigation



  
  




  
Home (current)
Sale (current)
About Us
  
  

  

{%if full_name %}



  {{full_name}}
  
My Account
Orders
Profile
Change 
Password

Logout
  

{% else %}
Register
Login
{% endif %}
  

  



@login_required
def 
my_change_password_view(request,template_name='useraccount/password_change_form.html'):
return password_change(request,template_name)
--

Please help.

Regards,
Sarfaraz Ahmed

-- 
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/f8521d79-c2a0-40a9-bd4e-0a90625264fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Interaction of Python Code with Django.

2015-05-13 Thread sarfaraz ahmed
 werkzeug is another debug tool which let you write and test code via
browser itself.

Regards,
Sarfaraz Ahmed

On Wed, May 13, 2015 at 3:43 PM, SUBHABRATA BANERJEE <
subhabrata.bane...@gmail.com> wrote:

> Hi Palansh,
>
> Thank you for your prompt answer, is it,
> return HttpResponse(template.render(context))
>
> https://docs.djangoproject.com/en/1.8/intro/tutorial03/
> under
> Write views that actually do something
> and you have worked out views.py
>
> Regards,
> Subhabrata Banerjee.
>
>
> On Wednesday, May 13, 2015 at 3:13:54 PM UTC+5:30, palansh agarwal wrote:
>>
>> Hello,
>> I suggest you go through django official docs first. The methods in
>> views.py returns response on a HTML templates. Look for them and try to
>> understand the workflow.
>>
>> On Wed, May 13, 2015 at 3:10 PM, SUBHABRATA BANERJEE <
>> subhabrat...@gmail.com> wrote:
>>
>>> Thanks Palansh. I have few questions here.
>>> a) I saw you have created a job search engine. I found its html source.
>>> Nice.
>>> b) I found your Django codes.
>>> My questions are,
>>> i) Where you are calling html source in your django code.
>>> ii) Is there any tutorial to learn this? I wanted to know it.
>>>
>>> Thanks Gergely, I am trying to check pexpect.
>>>
>>> Regards,
>>> Subhabrata Banerjee.
>>>
>>> On Tuesday, May 12, 2015 at 8:36:32 PM UTC+5:30, palansh agarwal wrote:
>>>>
>>>> Hi,
>>>> https://github.com/py-geek/Startup-job-search
>>>> look at the code in this repo an try to understand. It's a simple job
>>>> search portal developed by me.  A simple way is to use a simple HTML form
>>>> and map it's action attribute to a url. map that url to a method in your
>>>> urls.py file. write this method in your viws.py file. Put all your logic in
>>>> this method and return the result appropriately.
>>>> Regards,
>>>>
>>>> On Tue, May 12, 2015 at 8:29 PM, SUBHABRATA BANERJEE <
>>>> subhabrat...@gmail.com> wrote:
>>>>
>>>>> Dear Group,
>>>>>
>>>>> I want to integrate an interactive Python code, (it takes user input,
>>>>> processes input and gives output), with Django.
>>>>> I am new to Django, using Python2.7.9 on Windows 7 Professional.
>>>>>
>>>>> I am researching on it, but as it is a room for Django experts, I am
>>>>> trying to post this
>>>>> question, if anyone may kindly suggest how may I proceed? An example
>>>>> or web based tutorial would be great.
>>>>>
>>>>> Regards,
>>>>> Subhabrata Banerjee.
>>>>>
>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django-users...@googlegroups.com.
>>>>> To post to this group, send email to django...@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/django-users.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/10699b8a-3e40-42e6-a131-85d78e55a5ec%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> PALANSH AGARWAL
>>>> Y13UC185
>>>> Computer Science Engineering
>>>> 2nd Year
>>>> The LNM Institute of Information Technology, Jaipur
>>>> Find me on-> http://pygeek.strikingly.com/
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@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/f20afe04-b76d-4644-ad50-80127f9025cc%40googlegroups.com
>>> 

using celery with django.

2015-01-30 Thread sarfaraz ahmed
lery-3.1.17-py2.7.egg\celery\app\trace.p
, line 283, in trace_task
  uuid, retval, SUCCESS, request=task_request,
File 
"C:\Python27\lib\site-packages\celery-3.1.17-py2.7.egg\celery\backends\ba
.py", line 256, in store_result
  request=request, **kwargs)
File 
"C:\Python27\lib\site-packages\django_celery-3.1.16-py2.7.egg\djcelery\ba
ends\database.py", line 29, in _store_result
  traceback=traceback, children=self.current_task_children(request),
File 
"C:\Python27\lib\site-packages\django_celery-3.1.16-py2.7.egg\djcelery\ma
gers.py", line 42, in _inner
  return fun(*args, **kwargs)
File 
"C:\Python27\lib\site-packages\django_celery-3.1.16-py2.7.egg\djcelery\ma
gers.py", line 181, in store_result
  'meta': {'children': children}})
File 
"C:\Python27\lib\site-packages\django_celery-3.1.16-py2.7.egg\djcelery\ma
gers.py", line 87, in update_or_create
  return get_queryset(self).update_or_create(**kwargs)
File 
"C:\Python27\lib\site-packages\django_celery-3.1.16-py2.7.egg\djcelery\ma
gers.py", line 70, in update_or_create
  obj, created = self.get_or_create(**kwargs)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\qu
y.py", line 422, in get_or_create
  return self.get(**lookup), False
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\qu
y.py", line 345, in get
  clone = self.filter(*args, **kwargs)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\qu
y.py", line 691, in filter
  return self._filter_or_exclude(False, *args, **kwargs)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\qu
y.py", line 709, in _filter_or_exclude
  clone.query.add_q(Q(*args, **kwargs))
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\sq
query.py", line 1331, in add_q
  clause, require_inner = self._add_q(where_part, self.used_aliases)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\sq
query.py", line 1358, in _add_q
  current_negated=current_negated, connector=connector)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\sq
query.py", line 1182, in build_filter
  lookups, parts, reffed_aggregate = self.solve_lookup_type(arg)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\sq
query.py", line 1120, in solve_lookup_type
  _, field, _, lookup_parts = self.names_to_path(lookup_splitted, 
self.get_met
))
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\sq
query.py", line 1383, in names_to_path
  field, model, direct, m2m = opts.get_field_by_name(name)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\op
ons.py", line 416, in get_field_by_name
  cache = self.init_name_map()
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\op
ons.py", line 445, in init_name_map
  for f, model in self.get_all_related_m2m_objects_with_model():
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\op
ons.py", line 563, in get_all_related_m2m_objects_with_model
  cache = self._fill_related_many_to_many_cache()
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\db\models\op
ons.py", line 577, in _fill_related_many_to_many_cache
  for klass in self.apps.get_models():
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\utils\lru_ca
e.py", line 101, in wrapper
  result = user_function(*args, **kwds)
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\apps\registr
py", line 168, in get_models
  self.check_models_ready()
File 
"C:\Python27\lib\site-packages\django-1.7.2-py2.7.egg\django\apps\registr
py", line 131, in check_models_ready
  raise AppRegistryNotReady("Models aren't loaded yet.")
pRegistryNotReady: Models aren't loaded yet.

Am I doing something wrong? 

Regards,
Sarfaraz Ahmed

-- 
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/b2bec2f1-b849-4247-aca4-aee91be03687%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Windows path for django_crontab

2015-01-18 Thread sarfaraz ahmed
Thanks for replies I really wish people who posted packages should mention 
clearly about which OS it;s going to work. I ended up wasting two workdays 
in experimenting with kronos,DJANGO-CHRONOGRAPH 
<https://www.djangopackages.com/packages/p/django-chronograph/>,
DJANGO-CRONJOBS <https://www.djangopackages.com/packages/p/django-cronjobs/>
,DJANGO-CRON <https://www.djangopackages.com/packages/p/django-cron/>.

Surprisingly, DJANGO cron says that it is meant for Windows hosting where 
user does not have access to setup the cron jobs. I tried that to... 
nothing runs 

Regards,
Sarfaraz Ahmed



-- 
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/659ebe89-cb9b-4230-876a-4865a454648f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Windows path for django_crontab

2015-01-18 Thread sarfaraz ahmed
Hello All,

I am trying to use django_crontab to run repetitive task. I want to insert 
records to database on a particular time. Also, I am in process of learning 
django hence I m trying to reach every aspect of django. 

The issue i am facing i m able to configure django_crontab but its not able 
to find cron.py. I am using windows 7 and i believe it must be something 
else for windows

CRONJOBS = [
('*/5 * * * *', 'dms.Drop_Slot_Management.cron.my_scheduled_job')
]

dms is my project directory.

When I run the command manage.py crontab add it gives error saying "The 
system cannot find the path specified."

I am using Windows. 

Please help..

Regards,
Sarfaraz Ahmed

-- 
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/9ad0f430-458f-4113-b6be-2d61ab3ec447%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Exception occurred processing WSGI script

2015-01-07 Thread sarfaraz ahmed
Issue resolved. Please close this

On Wednesday, 7 January 2015 23:02:33 UTC+5:30, sarfaraz ahmed wrote:
>
> This is what I am trying to do.
>
> I am using amazon ec2 windows free tier and i am trying to setup django on 
> XAMPP.
>
> I am using apache 2.4 Windows 32 bit version
> python 2.7.9 window 32 bit version
> mod_wsgi 3.5 windows 32 bit version
> and Django 1.7
>
> my project as nothing but just mysite project with myapp as application
> My mod_wsgi file looks like this 
>
> ==
>
> import os,sys
> sys.path.append('c:\\xampp\\htdocs\\mysite')
> os.environ['DJANGO_SETTINGS_MODULE']='mysite.settings'
>
> import django.core.handlers.wsgi
> application= django.core.handlers.wsgi.WSGIHandler()
>
> =-==
>
>
> +++
> Apache error log looks horrible 
> +++
>
>
> mod_wsgi (pid=1980): Exception occurred processing WSGI script 
> 'C:/xampp/htdocs/mysite/mod.wsgi'.
> [Wed Jan 07 16:46:37.425730 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] Traceback (most recent call last):
> [Wed Jan 07 16:46:37.425730 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 
> 187, in __call__
> [Wed Jan 07 16:46:37.426729 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] response = self.get_response(request)
> [Wed Jan 07 16:46:37.426729 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\core\\handlers\\base.py", line 
> 199, in get_response
> [Wed Jan 07 16:46:37.426729 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] response = self.handle_uncaught_exception(request, resolver, 
> sys.exc_info())
> [Wed Jan 07 16:46:37.426729 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\core\\handlers\\base.py", line 
> 236, in handle_uncaught_exception
> [Wed Jan 07 16:46:37.426729 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] return debug.technical_500_response(request, *exc_info)
> [Wed Jan 07 16:46:37.427732 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\views\\debug.py", line 91, in 
> technical_500_response
> [Wed Jan 07 16:46:37.428730 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] html = reporter.get_traceback_html()
> [Wed Jan 07 16:46:37.428730 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\views\\debug.py", line 350, in 
> get_traceback_html
> [Wed Jan 07 16:46:37.428730 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] return t.render(c)
> [Wed Jan 07 16:46:37.428730 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\template\\base.py", line 148, in 
> render
> [Wed Jan 07 16:46:37.429731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] return self._render(context)
> [Wed Jan 07 16:46:37.429731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\template\\base.py", line 142, in 
> _render
> [Wed Jan 07 16:46:37.429731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] return self.nodelist.render(context)
> [Wed Jan 07 16:46:37.429731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\template\\base.py", line 844, in 
> render
> [Wed Jan 07 16:46:37.429731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] bit = self.render_node(node, context)
> [Wed Jan 07 16:46:37.429731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\template\\debug.py", line 80, in 
> render_node
> [Wed Jan 07 16:46:37.430731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] return node.render(context)
> [Wed Jan 07 16:46:37.430731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\template\\debug.py", line 90, in 
> render
> [Wed Jan 07 16:46:37.430731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948] output = self.filter_expression.resolve(context)
> [Wed Jan 07 16:46:37.430731 2015] [:error] [pid 1980:tid 1736] [client 
> ::1:49948]   File 
> "C:\\Python27\\lib\\site-packages\\django\\template\\ba

Re: Recommendations for hosting service?

2015-01-07 Thread sarfaraz ahmed
I have trying to setup django on aws windows instance that not easy.

Regards,
Sarfaraz Ahmed

On Wednesday, 7 January 2015 22:57:39 UTC+5:30, Stefano Probst wrote:
>
> OK, i just see you need 100GB. At Uberspace you have only 10GB for Data 
> (excl. OS, etc).
>
> Am Mittwoch, 7. Januar 2015 18:25:44 UTC+1 schrieb Stefano Probst:
>>
>> I use DigitalOcean <https://www.digitalocean.com/> (VPS) & Uberspace 
>> <https://uberspace.de/> (German, shared hosting, support Django 
>> <https://wiki.uberspace.de/cool:django>).
>>
>

-- 
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/4cb45272-f7a5-4d01-84e1-0374bd4d16b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 problem

2015-01-07 Thread sarfaraz ahmed
I have posted the entire issue in another post. After that I found your 
reply.

https://groups.google.com/forum/#!topic/django-users/mOJRvLYjzDs

I m beginner in Django. I have configured Django/Python/ Apache/Mod_wsgi on 
EC2 Amazon Windows instance. I see the similar error. I am not using any 
pluggins. The project is attempt to make Django work on Apache... and it 
not working. 

Regards,
Sarfaraz Ahmed

On Thursday, 8 January 2015 00:59:50 UTC+5:30, Andréas Kühne wrote:
>
> Hi Sarfaraz,
>
> Are you also having problems with the dbgettext plugin? Or is it with 
> another plugin?
>
> Regards,
>
> Andréas
>
> 2015-01-07 18:40 GMT+01:00 sarfaraz ahmed  >:
>
>> I believe i am too facing the same issue. But from above conversation I 
>> am not able to get solution of this issue. Could please help me. 
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>> On Thursday, 4 December 2014 15:21:59 UTC+5:30, Andréas Kühne wrote:
>>>
>>> 2014-12-04 1:39 GMT+01:00 Carl Meyer :
>>>
>>>> Hi Andreas,
>>>>
>>>> On 12/03/2014 01:34 PM, Andreas Kuhne wrote:
>>>> > I am trying to migrate our current website to django 1.7.
>>>> >
>>>> > Currently we are using a plugin called django-dbgettext to get parts 
>>>> of our
>>>> > database translated (we are running in 10 different languages). The 
>>>> problem
>>>> > is that django-dbgettext starts by going through all of the models 
>>>> and does
>>>> > this before the translation framework is running. So I get an 
>>>> exception
>>>> > during startup that says:
>>>> > "django.core.exceptions.AppRegistryNotReady: The translation 
>>>> infrastructure
>>>> > cannot be initialized before the apps registry is ready. Check that 
>>>> you
>>>> > don't make non-lazy gettext calls at import time."
>>>> >
>>>> > The problem seems to be that the classes are loaded before the models 
>>>> are
>>>> > correctly loaded and the translation framework is running. All of the
>>>> > classes use ugettext_lazy, but the stack trace includes ugettext.
>>>> >
>>>> > I want to rewrite the django-dbgettext plugin so that it goes through 
>>>> the
>>>> > code AFTER the models are correctly loaded. I don't know how to do 
>>>> this
>>>> > however. Is there anyway of running code after django is fully 
>>>> initialized?
>>>>
>>>> Indeed there is! See
>>>> https://docs.djangoproject.com/en/dev/ref/applications/#
>>>> django.apps.AppConfig.ready
>>>>
>>>> > Django admin should do the same thing, it also has a autodiscover()
>>>> > function and I was wondering why this doesn't happen with django 
>>>> admin?
>>>> > Could this be a good place to start looking for a solution?
>>>>
>>>> Yes, admin.autodiscover now runs in the admin's AppConfig.ready() in
>>>> Django 1.7, so that would have been a good place to start looking :-)
>>>>
>>>> Carl
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to django-users...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>> msgid/django-users/547FAD59.5090809%40oddbird.net.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> Thanks Carl,
>>>
>>> With your help here I was able to fix this in less than an hour. Was 
>>> really easy :-)
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5609842d-2c79-428d-b5f6-81117bbf222c%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/5609842d-2c79-428d-b5f6-81117bbf222c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> 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/3900a5d4-a2de-411c-b23b-1770a46584fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 problem

2015-01-07 Thread sarfaraz ahmed
I believe i am too facing the same issue. But from above conversation I am 
not able to get solution of this issue. Could please help me. 

Regards,
Sarfaraz Ahmed

On Thursday, 4 December 2014 15:21:59 UTC+5:30, Andréas Kühne wrote:
>
> 2014-12-04 1:39 GMT+01:00 Carl Meyer >:
>
>> Hi Andreas,
>>
>> On 12/03/2014 01:34 PM, Andreas Kuhne wrote:
>> > I am trying to migrate our current website to django 1.7.
>> >
>> > Currently we are using a plugin called django-dbgettext to get parts of 
>> our
>> > database translated (we are running in 10 different languages). The 
>> problem
>> > is that django-dbgettext starts by going through all of the models and 
>> does
>> > this before the translation framework is running. So I get an exception
>> > during startup that says:
>> > "django.core.exceptions.AppRegistryNotReady: The translation 
>> infrastructure
>> > cannot be initialized before the apps registry is ready. Check that you
>> > don't make non-lazy gettext calls at import time."
>> >
>> > The problem seems to be that the classes are loaded before the models 
>> are
>> > correctly loaded and the translation framework is running. All of the
>> > classes use ugettext_lazy, but the stack trace includes ugettext.
>> >
>> > I want to rewrite the django-dbgettext plugin so that it goes through 
>> the
>> > code AFTER the models are correctly loaded. I don't know how to do this
>> > however. Is there anyway of running code after django is fully 
>> initialized?
>>
>> Indeed there is! See
>>
>> https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.ready
>>
>> > Django admin should do the same thing, it also has a autodiscover()
>> > function and I was wondering why this doesn't happen with django admin?
>> > Could this be a good place to start looking for a solution?
>>
>> Yes, admin.autodiscover now runs in the admin's AppConfig.ready() in
>> Django 1.7, so that would have been a good place to start looking :-)
>>
>> Carl
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/547FAD59.5090809%40oddbird.net
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> Thanks Carl,
>
> With your help here I was able to fix this in less than an hour. Was 
> really easy :-)
>
> Regards,
>
> Andréas
>

-- 
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/5609842d-2c79-428d-b5f6-81117bbf222c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Exception occurred processing WSGI script

2015-01-07 Thread sarfaraz ahmed
rror] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\template\\base.py", line 624, in 
resolve
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] new_obj = func(obj, *arg_vals)
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\template\\defaultfilters.py", 
line 769, in date
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] return format(value, arg)
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\dateformat.py", line 343, 
in format
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] return df.format(format_string)
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\dateformat.py", line 35, 
in format
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] pieces.append(force_text(getattr(self, piece)()))
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\dateformat.py", line 268, 
in r
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] return self.format('D, j M Y H:i:s O')
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\dateformat.py", line 35, 
in format
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] pieces.append(force_text(getattr(self, piece)()))
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\encoding.py", line 85, in 
force_text
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] s = six.text_type(s)
[Wed Jan 07 17:10:04.625685 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\functional.py", line 144, 
in __text_cast
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] return func(*self.__args, **self.__kw)
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\translation\\__init__.py", 
line 83, in ugettext
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] return _trans.ugettext(message)
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", 
line 325, in ugettext
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] return do_translate(message, 'ugettext')
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", 
line 306, in do_translate
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] _default = translation(settings.LANGUAGE_CODE)
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", 
line 209, in translation
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] default_translation = _fetch(settings.LANGUAGE_CODE)
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033]   File 
"C:\\Python27\\lib\\site-packages\\django\\utils\\translation\\trans_real.py", 
line 189, in _fetch
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] "The translation infrastructure cannot be initialized before 
the "
[Wed Jan 07 17:10:04.626684 2015] [:error] [pid 1980:tid 1736] [client 
::1:50033] AppRegistryNotReady: The translation infrastructure cannot be 
initialized before the apps registry is ready. Check that you don't make 
non-lazy gettext calls at import time.


Is that something I am missing. Any help would be appreciated.

Regards,
Sarfaraz Ahmed



-- 
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/84764e7d-6e40-46c8-b29e-34100397c5dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Form error messages not displayed

2014-07-16 Thread sarfaraz ahmed

>
> I tried {{form.errors}} in template.. but it still does not show up. When 
> I used the Werkeuq and print form it see the precise error in form. Not 
> sure what i am doing wrong.


Regards,
Sarfaraz Ahmed
 

-- 
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/5ca7714b-4bf3-4a8f-9073-53fbf7407042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Form error messages not displayed

2014-07-16 Thread sarfaraz ahmed
I am trying to display form.erros. I am using bootstrap modal and using 
ajax form submit to send data async. Everything works fine... I can see the 
error messages returned in code. But it automatically goes to default error 
pages of django when form.is_valid returns false. When I print form in 
debug mode I see the specific error. I am using Werkzeug  for debugging. 

Here is my view.py code

def register_user(request):
#args=UserCreationForm()
   
args={}
args.update(csrf(request))

if request.method=='POST':   
form = UserCreationForm(request.POST)
print 'step 2'
args['form']=form
if form.is_valid:
form.save()
print 'step 3'
return HttpResponseRedirect('/accounts/register_success/')
else:

return 
render_to_response('register.html',args,context_instance=RequestContext(request))
   
#assert false
#return 
render_to_response('register.html',args,context_instance=RequestContext(request))
else:
args['form'] = UserCreationForm()
return 
render_to_response('register.html',args,context_instance=RequestContext(request))


==
template code
{%csrf_token%}

×
Register
   

{%if form.errors %}
{{errors}}
{%endif%}

{{form.username.errors.as_text}}
Choose 
Username






{{form.password1.errors.as_text }}
Choose 
Password

  






{{form.password2.errors.as_text }}
Re-Enter 
Password




 










 


 
   $(document).ready(function() { 
   // bind 'myForm' and provide a simple callback function
   
var form_options = { 
target: '#modalcontent'

  ,success: function() {
   
}


,type: 'post'
//,clearForm: true
} 
$('#signup').ajaxForm(form_options);
   
});
  
 
   
 

Please 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/816d967e-60a6-46a2-b5c0-6f0073a62f7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django user authenication form in modal form twitter bootstrap

2014-06-29 Thread sarfaraz ahmed
The issue is almost resolved. The only problem now I am facing is when I 
include login function which provides form with csrf token. The bootstrap 
modal forms dissappear immediately after is comes on screen. If I do not 
include this url using data-remote option the modal comes. But without csrf 
it do not let me login. 

Here is code 

@csrf_protect
def login(request):
return render_to_response('login.html',{},RequestContext(request))



Now the code in red is issue. when I include the the modal does not stay. 

Regards,
Sarfaraz Ahmed


-- 
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/12cf734e-7204-475c-a65f-a88d2fe08a17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread sarfaraz ahmed
i am using attribute to call modal popup. Should I use JS and try. I would
give a try and let you know.

Thanks in advance,
Sarfaraz Ahmed


On Sat, Jun 28, 2014 at 6:09 AM, Mario Gudelj 
wrote:

> Sounds like you have a js issue now. Have a look inside chrome console for
> any errors and fix them. Modal not coming up wouldn't be a django issue.
> On 28/06/2014 5:41 am, "sarfaraz ahmed"  wrote:
>
>> Hello,
>>
>> You were absolutely right.. the function was wrong. Please help me sort
>> out that.. as this your suggestion took me one step close to fix this
>> issue.
>>
>> Now the scenario is like this
>> *views.py *has this function to render my login.html
>> --
>> @csrf_protect
>> def login(request):
>> #c={}
>> #c.update(csrf(request))
>> print 'step2'
>> return render_to_response('login.html',{},RequestContext(request))
>>
>> -
>>
>> base.html has include statement to include login.html and login.html has
>> following code
>>
>>
>> > aria-labelledby="myModalLabel" aria-hidden="true">
>> 
>> 
>> 
>> > data-dismiss="modal">×> class="sr-only">Close
>> Modal
>> title
>> 
>> 
>> > method='post'>{%csrf_token%}
>> User Name:
>> > id="username">
>> Password:
>> > id="password">
>> 
>> 
>> 
>> 
>> > data-dismiss="modal">Close
>> Save
>> changes
>> 
>> 
>> 
>> 
>>
>> When I click on link which has following code
>>  > data-target="#myModal" >Login
>>
>> Nothing happens...the modal does not open...
>>
>> When I manually go to link : accounts/login i can see the form with any
>> formatting and also can see csrf token.
>>
>> Desperately looking for help
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>>
>>
>>
>> On Fri, Jun 27, 2014 at 12:34 PM, sarfaraz ahmed 
>> wrote:
>>
>>> Hello Roman,
>>>
>>> Thanks for response. Tried what you suggested me. The modal does not
>>> even pop up if I used the code mentioned in your reply.
>>>
>>> Regards,
>>> Sarfaraz Ahmed
>>>
>>>
>>> On Fri, Jun 27, 2014 at 12:09 PM, Roman Klesel 
>>> wrote:
>>>
>>>> I think the view function is wrong.
>>>>
>>>> This should do:
>>>>
>>>> from django.views.decorators.csrf import csrf_protect
>>>> from django.shortcuts impor render
>>>>
>>>> @csrf_protect
>>>> def login(request):
>>>> return render(request, 'login.html')
>>>>
>>>>
>>>> 2014-06-27 6:03 GMT+02:00 sarfaraz ahmed :
>>>> > Hello
>>>> >
>>>> > I am new to django I am trying to use modal (bootstrap) for embed by
>>>> login
>>>> > form. I am using the following error. I have mentioned my code below
>>>> and
>>>> > tried lot of googling... still no use.
>>>> >
>>>> > Help
>>>> >
>>>> > Reason given for failure:
>>>> >
>>>> > CSRF token missing or incorrect.
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > Here is code in view.py
>>>> >
>>>> > from django.shortcuts import render_to_response
>>>> > from django.http import HttpResponseRedirect
>>>> > from django.contrib import auth
>>>> > from django.core.context_processors import csrf
>>>> > from django.template import RequestContext
>>>> > from django.views.decorators.csrf import csrf_protect
>>>> > from django.shortcuts import render
>>>> >
>>>> >
>>>> >
>>>> > @csrf_protect
>>>> > def login(request):
>>>> > c={}
>>>> >   

Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread sarfaraz ahmed
Hello,

You were absolutely right.. the function was wrong. Please help me sort out
that.. as this your suggestion took me one step close to fix this issue.

Now the scenario is like this
*views.py *has this function to render my login.html
--
@csrf_protect
def login(request):
#c={}
#c.update(csrf(request))
print 'step2'
return render_to_response('login.html',{},RequestContext(request))
-

base.html has include statement to include login.html and login.html has
following code






×Close
Modal
title


{%csrf_token%}
User Name:

Password:





Close
Save
changes





When I click on link which has following code
 Login

Nothing happens...the modal does not open...

When I manually go to link : accounts/login i can see the form with any
formatting and also can see csrf token.

Desperately looking for help

Regards,
Sarfaraz Ahmed




On Fri, Jun 27, 2014 at 12:34 PM, sarfaraz ahmed 
wrote:

> Hello Roman,
>
> Thanks for response. Tried what you suggested me. The modal does not even
> pop up if I used the code mentioned in your reply.
>
> Regards,
> Sarfaraz Ahmed
>
>
> On Fri, Jun 27, 2014 at 12:09 PM, Roman Klesel 
> wrote:
>
>> I think the view function is wrong.
>>
>> This should do:
>>
>> from django.views.decorators.csrf import csrf_protect
>> from django.shortcuts impor render
>>
>> @csrf_protect
>> def login(request):
>> return render(request, 'login.html')
>>
>>
>> 2014-06-27 6:03 GMT+02:00 sarfaraz ahmed :
>> > Hello
>> >
>> > I am new to django I am trying to use modal (bootstrap) for embed by
>> login
>> > form. I am using the following error. I have mentioned my code below and
>> > tried lot of googling... still no use.
>> >
>> > Help
>> >
>> > Reason given for failure:
>> >
>> > CSRF token missing or incorrect.
>> >
>> >
>> >
>> >
>> > Here is code in view.py
>> >
>> > from django.shortcuts import render_to_response
>> > from django.http import HttpResponseRedirect
>> > from django.contrib import auth
>> > from django.core.context_processors import csrf
>> > from django.template import RequestContext
>> > from django.views.decorators.csrf import csrf_protect
>> > from django.shortcuts import render
>> >
>> >
>> >
>> > @csrf_protect
>> > def login(request):
>> > c={}
>> > c.update(csrf(request))
>> > return
>> >
>> render_to_response('login.html',c,context_instance=RequestContext(request))
>> >
>> >
>> >
>> > I call the login.html via link in nav bar using
>> >
>> >  > > data-target="#myModal">Login
>> >
>> > That is code for login.html which is modal included in my base.html
>> >
>> >
>> > > > aria-labelledby="myModalLabel" aria-hidden="true">
>> > 
>> > 
>> > 
>> > > > data-dismiss="modal">×> > class="sr-only">Close
>> > Modal
>> title
>> > 
>> > 
>> > {%
>> csrf_token
>> > %}
>> > User Name:
>> > > > id="username">
>> > Password:
>> > > > id="password">
>> > 
>> > 
>> > 
>> > 
>> > > > data-dismiss="modal">Close
>> > Save
>> > changes
>> > 
>> > 
>> > 
>> > 
>> >
>> > --
>> > 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+unsubs

Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread sarfaraz ahmed
Hello Roman,

Thanks for response. Tried what you suggested me. The modal does not even
pop up if I used the code mentioned in your reply.

Regards,
Sarfaraz Ahmed


On Fri, Jun 27, 2014 at 12:09 PM, Roman Klesel 
wrote:

> I think the view function is wrong.
>
> This should do:
>
> from django.views.decorators.csrf import csrf_protect
> from django.shortcuts impor render
>
> @csrf_protect
> def login(request):
> return render(request, 'login.html')
>
>
> 2014-06-27 6:03 GMT+02:00 sarfaraz ahmed :
> > Hello
> >
> > I am new to django I am trying to use modal (bootstrap) for embed by
> login
> > form. I am using the following error. I have mentioned my code below and
> > tried lot of googling... still no use.
> >
> > Help
> >
> > Reason given for failure:
> >
> > CSRF token missing or incorrect.
> >
> >
> >
> >
> > Here is code in view.py
> >
> > from django.shortcuts import render_to_response
> > from django.http import HttpResponseRedirect
> > from django.contrib import auth
> > from django.core.context_processors import csrf
> > from django.template import RequestContext
> > from django.views.decorators.csrf import csrf_protect
> > from django.shortcuts import render
> >
> >
> >
> > @csrf_protect
> > def login(request):
> > c={}
> > c.update(csrf(request))
> > return
> >
> render_to_response('login.html',c,context_instance=RequestContext(request))
> >
> >
> >
> > I call the login.html via link in nav bar using
> >
> >   > data-target="#myModal">Login
> >
> > That is code for login.html which is modal included in my base.html
> >
> >
> >  > aria-labelledby="myModalLabel" aria-hidden="true">
> > 
> > 
> > 
> >  > data-dismiss="modal">× > class="sr-only">Close
> > Modal
> title
> > 
> > 
> > {%
> csrf_token
> > %}
> > User Name:
> >  > id="username">
> > Password:
> >  > id="password">
> > 
> > 
> > 
> > 
> >  > data-dismiss="modal">Close
> > Save
> > changes
> > 
> > 
> > 
> > 
> >
> > --
> > 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/943e0bf4-ce4d-4ef5-ae45-57e86c36f367%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/CAL2Rd%3DKwRHU-G_jF4winxka2nnLRB%3D-qbejfDdnQ0GE0zNNMeQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

-- 
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/CAEPJdizEX-0Jju_hT5wE8-dS%3D6Kxvp_h3kgtJKV7N5oOqvL0jQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django user authenication form in modal form twitter bootstrap

2014-06-26 Thread sarfaraz ahmed
Hello 

I am new to django I am trying to use modal (bootstrap) for embed by login 
form. I am using the following error. I have mentioned my code below and 
tried lot of googling... still no use.

Help

Reason given for failure:

CSRF token missing or incorrect.
  



Here is code in view.py 

from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.contrib import auth
from django.core.context_processors import csrf
from django.template import RequestContext
from django.views.decorators.csrf import csrf_protect
from django.shortcuts import render



@csrf_protect
def login(request):
c={}
c.update(csrf(request))
return 
render_to_response('login.html',c,context_instance=RequestContext(request))



I call the login.html via link in nav bar using 

 Login

That is code for login.html which is modal included in my base.html 






×Close
Modal title


{% csrf_token 
%}
User Name:

Password:





Close
Save 
changes





-- 
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/943e0bf4-ce4d-4ef5-ae45-57e86c36f367%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: trying to configure MSSQL 2012 as backend with Django.

2014-06-17 Thread sarfaraz ahmed
Hello Ezequiel
I have a database in SQL Server 2012. I used the following string and
everything worked.. find. Trust me I am new to django and feeling good to
be part of this community.

DATABASES = {
'default': {
'NAME': 'blogger',
'ENGINE': 'sqlserver_ado',
'HOST': ' ',
'USER': 'sa',
'PASSWORD': '**', # used actual password
'OPTIONS' : {
'provider': 'SQLNCLI11',
'extra_params' : 'DataTypeCompatibility=80;MARS Connection=True'
}
}
}


On Mon, Jun 16, 2014 at 3:02 AM, Ezequiel Bertti  wrote:

> What was the solution?
>
>
> On Sun, Jun 15, 2014 at 5:03 PM, sarfaraz ahmed 
> wrote:
>
>> Thanks for your help. The issue is resolved ... thanks :)
>>
>>
>>
>> On Mon, Jun 16, 2014 at 1:10 AM, sarfaraz ahmed 
>> wrote:
>>
>>> Yes, I saw and tried the steps mentioned in that link. I get following
>>> error
>>>
>>> "No module named sqlserver_ado.base".
>>>
>>> This is lines in setting.py Please help
>>>
>>> DATABASES = {
>>> 'default': {
>>> 'NAME': 'blogger',
>>> 'ENGINE': 'django.db.backends.sqlserver_ado',
>>> 'HOST': ' ',
>>> 'USER': 'sa',
>>> 'PASSWORD': '*',
>>> }
>>> }
>>> I am  new to DJANGO...
>>>
>>> Regards,
>>> Sarfaraz Ahmed
>>>
>>>
>>> On Mon, Jun 16, 2014 at 12:57 AM, Mark Phillips <
>>> m...@phillipsmarketing.biz> wrote:
>>>
>>>> Did you look here??
>>>>
>>>> http://django-mssql.readthedocs.org/en/latest/
>>>>
>>>> Mark
>>>>
>>>>
>>>> On Sun, Jun 15, 2014 at 11:35 AM, sarfaraz ahmed <
>>>> findsarfa...@gmail.com> wrote:
>>>>
>>>>> Hello Friends,
>>>>>
>>>>> I am trying to moving away from sqlite. Trying to use MS SQl 2012 as
>>>>> backend. So far I installed django-mssql on my machine. When I type import
>>>>> sqlserver_ado... It works fine.
>>>>>
>>>>> I am new to Django. Please provide me with example to get my MSSQL
>>>>> connected to django. More than one example will be appreciated. I check 
>>>>> lot
>>>>> of post however but i am unable find any solution. With proper example.
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Regards,
>>>>> Sarfaraz Ahmed
>>>>>
>>>>> --
>>>>> 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/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> 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/CAEqej2MMx6WBps%2BhNBA%2B5RueY18z212JQWs_NL5A2Rd-qR2Tqw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAEqej2MMx6WBps%2BhNBA%2B5RueY18z212JQWs_NL5A2Rd-qR2Tqw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>

Re: trying to configure MSSQL 2012 as backend with Django.

2014-06-15 Thread sarfaraz ahmed
Thanks for your help. The issue is resolved ... thanks :)



On Mon, Jun 16, 2014 at 1:10 AM, sarfaraz ahmed 
wrote:

> Yes, I saw and tried the steps mentioned in that link. I get following
> error
>
> "No module named sqlserver_ado.base".
>
> This is lines in setting.py Please help
>
> DATABASES = {
> 'default': {
> 'NAME': 'blogger',
> 'ENGINE': 'django.db.backends.sqlserver_ado',
> 'HOST': ' ',
> 'USER': 'sa',
> 'PASSWORD': '*',
> }
> }
> I am  new to DJANGO...
>
> Regards,
> Sarfaraz Ahmed
>
>
> On Mon, Jun 16, 2014 at 12:57 AM, Mark Phillips <
> m...@phillipsmarketing.biz> wrote:
>
>> Did you look here??
>>
>> http://django-mssql.readthedocs.org/en/latest/
>>
>> Mark
>>
>>
>> On Sun, Jun 15, 2014 at 11:35 AM, sarfaraz ahmed 
>> wrote:
>>
>>> Hello Friends,
>>>
>>> I am trying to moving away from sqlite. Trying to use MS SQl 2012 as
>>> backend. So far I installed django-mssql on my machine. When I type import
>>> sqlserver_ado... It works fine.
>>>
>>> I am new to Django. Please provide me with example to get my MSSQL
>>> connected to django. More than one example will be appreciated. I check lot
>>> of post however but i am unable find any solution. With proper example.
>>>
>>> Thanks in advance.
>>>
>>> Regards,
>>> Sarfaraz Ahmed
>>>
>>> --
>>> 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/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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/CAEqej2MMx6WBps%2BhNBA%2B5RueY18z212JQWs_NL5A2Rd-qR2Tqw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAEqej2MMx6WBps%2BhNBA%2B5RueY18z212JQWs_NL5A2Rd-qR2Tqw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Thanks with regards,
> Sarfaraz Ahmed
>
>
>


-- 
Thanks with regards,
Sarfaraz Ahmed

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


Re: trying to configure MSSQL 2012 as backend with Django.

2014-06-15 Thread sarfaraz ahmed
Yes, I saw and tried the steps mentioned in that link. I get following
error

"No module named sqlserver_ado.base".

This is lines in setting.py Please help

DATABASES = {
'default': {
'NAME': 'blogger',
'ENGINE': 'django.db.backends.sqlserver_ado',
'HOST': ' ',
'USER': 'sa',
'PASSWORD': '*',
}
}
I am  new to DJANGO...

Regards,
Sarfaraz Ahmed


On Mon, Jun 16, 2014 at 12:57 AM, Mark Phillips 
wrote:

> Did you look here??
>
> http://django-mssql.readthedocs.org/en/latest/
>
> Mark
>
>
> On Sun, Jun 15, 2014 at 11:35 AM, sarfaraz ahmed 
> wrote:
>
>> Hello Friends,
>>
>> I am trying to moving away from sqlite. Trying to use MS SQl 2012 as
>> backend. So far I installed django-mssql on my machine. When I type import
>> sqlserver_ado... It works fine.
>>
>> I am new to Django. Please provide me with example to get my MSSQL
>> connected to django. More than one example will be appreciated. I check lot
>> of post however but i am unable find any solution. With proper example.
>>
>> Thanks in advance.
>>
>> Regards,
>> Sarfaraz Ahmed
>>
>> --
>> 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/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CAEqej2MMx6WBps%2BhNBA%2B5RueY18z212JQWs_NL5A2Rd-qR2Tqw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEqej2MMx6WBps%2BhNBA%2B5RueY18z212JQWs_NL5A2Rd-qR2Tqw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks with regards,
Sarfaraz Ahmed

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


trying to configure MSSQL 2012 as backend with Django.

2014-06-15 Thread sarfaraz ahmed
Hello Friends,

I am trying to moving away from sqlite. Trying to use MS SQl 2012 as 
backend. So far I installed django-mssql on my machine. When I type import 
sqlserver_ado... It works fine. 

I am new to Django. Please provide me with example to get my MSSQL 
connected to django. More than one example will be appreciated. I check lot 
of post however but i am unable find any solution. With proper example. 

Thanks in advance.

Regards,
Sarfaraz Ahmed

-- 
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/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.