Re: Django-mssql repo has switched to Git

2014-11-14 Thread pythonista
I am connecting django linux and windows 7 to sql server.successfully

django 1.7 and python 2.7.8

I was successful with django-azure-pyodbc

The 3 other packages that I tried did not work.

On Friday, November 14, 2014 9:37:41 PM UTC-5, Michael Manfre wrote:
>
> A heads up to anyone using Django-mssql. The project has shifted from Hg 
> to Git (still on Bitbucket). For most people, this will have no impact. If 
> any of you had a dependency to a specific changeset, you will need to 
> update the reference to use Git instead of Hg.
>
> I've been using Git daily for a few months and I'm hoping this change will 
> make it easier for me to be more efficient with managing the pull requests 
> that have kindly been submitted. 
>
> Regards,
> Michael Manfre
>

-- 
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/7ee41436-4e72-474a-99a2-35e2a892e2c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Newbie question on serving static files from apache

2014-11-14 Thread pythonista
I am using django 1.7 and apache.

I do not understand the instructions on the django tutorial.

The files were delivered as expected in debug mode and locally from the 
django web server.


Can someone provide me with a simple example or link to a site.

Thanks

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


Problem implementing django-sslserver

2014-11-26 Thread pythonista


The application was working successfully on the Linux server.

I am trying to implement the ssl functionality and getting the  stack trace 
below after following the instructions

Any suggestions as to what is going on and how to fix this.

We are running the dev server with a separate Apache server acting as a 
proxy.

The comnmand line is

$ python manage.py runsslserver --certificate /path/to/certificate.crt --key 
/path/to/key.key  ip_adress:8020


Thanks

 

[26/Nov/2014 10:38:24] "GET /waitlist/ HTTP/1.1" 200 6341
[26/Nov/2014 11:30:50] code 400, message Bad HTTP/0.9 request type 
('\x16\x03\x01\x00C\x01\x00\x00?\x03\x01Tv\x0eJ\xb2\xecd\x1f\xf5)\xd3\x8a\x9a4\xa5\x8c\xd3U;\x04C')
Traceback (most recent call last):
  File "/opt/python-2.7.8/lib/python2.7/SocketServer.py", line 595, in 
process_request_thread
self.finish_request(request, client_address)
  File "/opt/python-2.7.8/lib/python2.7/SocketServer.py", line 334, in 
finish_request
self.RequestHandlerClass(request, client_address, self)
  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/servers/basehttp.py",
 
line 129, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "/opt/python-2.7.8/lib/python2.7/SocketServer.py", line 651, in 
__init__
self.handle()
  File "/opt/python-2.7.8/lib/python2.7/wsgiref/simple_server.py", line 
117, in handle
if not self.parse_request(): # An error code has been sent, just exit
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 281, in 
parse_request
"Bad HTTP/0.9 request type (%r)" % command)
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 368, in 
send_error
self.send_response(code, message)
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 385, in 
send_response
self.log_request(code)
  File "/opt/python-2.7.8/lib/python2.7/BaseHTTPServer.py", line 422, in 
log_request
self.requestline, str(code), str(size))
  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/servers/basehttp.py",
 
line 136, in log_message
msg = "[%s] %s\n" % (self.log_date_time_string(), format % args)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 16: 
ordinal not in range(128)


-- 
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/d265acfc-6db5-45b2-8a83-dae588f3a48a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django server and Apache serving static files

2014-12-08 Thread pythonista
My apache admin is having problems serving static files to the django app.


Apache is on its own server.

My admin says that he needs a relative path defined in Django in order to 
get Apache to serve the static files from that server for the Django App

Is it possible to define relative paths in the settings file to comply with 
the requirements of Apache?

And if it is possible can I still use the {%load staticfiles %}  variable.

If this is possible, what would the relevant settings file entries be?

Thanks

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


Django and SSL

2014-12-10 Thread pythonista
I am getting a request from the security infrastructure and I could use 
some advice/recommendation.

This is a 3 tier application.

Apache/Django/Sql Server

Apache is https and there is a proxy server between.

The security team is saying that the communication from Django should also 
be ssl encrypted in case the proxy server goes down.

1. Can Django be made hardened via ssl?
2. Doesn't Apache and the Proxy server provide sufficient security so that 
ssl / django is not required?

3. If the Proxy server goes down I can test some header responses to 
determine if the call is from a secure call and from the expected server
 If such security is required is that not sufficient?

Thanks in advance.

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


Re: I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread pythonista
I can actually help you here.

I had the same problem and tried 4 different modules.
The only module that works with sql server is 

https://github.com/michiya/django-pyodbc-azure


I am running it both on windows and linux, simultaneously.


The settings components are displayed on the web site.

Works like a charm

One dependency is pyodbc to be installed.



On Wednesday, December 10, 2014 4:22:44 AM UTC-5, Sugita Shinsuke wrote:
>
> Hi there.
>
> Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
> tried django_pyodbc. Any suggestion is appreciated.
>
> my PC of Environment is below.
>
> Database:
> SQL Server 2014 Express
>
> OS:
> Windows 7 Home Premium SP1
>
> I used the django module, django_pyodbc.
> And, I tried to run syncdb but I couldn't.
>
> My settings.py is below.
>
> DATABASES = {
>'default': {
>'ENGINE': "django_pyodbc",
>'HOST': "localhost",
>'USER': "djangouser",
>'PASSWORD': "x",
>'NAME': "db_test",
>'OPTIONS': {
> 'host_is_server': True,
> 'autocommit': True,
> 'unicode_results': True,
> 'extra_params': 'tds_version=8.0'
> },
>}
> }
>
> Things I tried and did not work:
> 1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
> 2,removed 'OPTIONS'.
>
>
> However, I tried the module pyodbc of pure python like below. It was fine.
>
> ---
> conn = pyodbc.connect('driver={SQL 
> Server};server=localhost;UID=djangouser;PWD=x;DATABASE=shannon_test;Trusted_Connection=yes')
> ---
>
> But, DB connection is not established without "Trusted_Connection=yes".
> At least I do not know any other way. Anyone who know this matter, please 
> help.
>
>
>
> The error message is here.
>
> 
>
> pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server 
> Driver][
> SQL 
> Server]\x82\xb1\x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\x
> b3\x82\xea\x82\xbd\x83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
> \x82\xf0\x8aJ\x8
> 2\xaf\x82\xdc\x82\xb9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94
> s\x82\xb5\x82\xdc\x82\xb5\x82\xbd\x81B (4060) (SQLDriverConnect); [01S00] 
> [Micro
> soft][ODBC SQL Server 
> Driver]\x90\xda\x91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x9
> 1\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x8
> 2\xf1\x81B (0); [42000] [Microsoft][ODBC SQL Server Driver][SQL 
> Server]\x82\xb1\
> x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\xb3\x82\xea\x82\xbd\x
> 83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
> \x82\xf0\x8aJ\x82\xaf\x82\xdc\x82\xb
> 9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94s\x82\xb5\x82\xdc\x8
> 2\xb5\x82\xbd\x81B (4060); [01S00] [Microsoft][ODBC SQL Server 
> Driver]\x90\xda\x
> 91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x91\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x
> 82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B (0)')
> 
>
>
>

-- 
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/75829654-59e0-4ba5-a824-8a61123387c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and SSL

2014-12-10 Thread pythonista
Is there a need for ssl if apache (https) and a proxy are between django 
and the outside world.

Doesn't the apache server/proxy provide a sufficient layer of security.
isn't it true that the data is being served through the server securely via 
https?

Thanks

On Wednesday, December 10, 2014 11:55:15 AM UTC-5, pythonista wrote:
>
> I am getting a request from the security infrastructure and I could use 
> some advice/recommendation.
>
> This is a 3 tier application.
>
> Apache/Django/Sql Server
>
> Apache is https and there is a proxy server between.
>
> The security team is saying that the communication from Django should also 
> be ssl encrypted in case the proxy server goes down.
>
> 1. Can Django be made hardened via ssl?
> 2. Doesn't Apache and the Proxy server provide sufficient security so that 
> ssl / django is not required?
>
> 3. If the Proxy server goes down I can test some header responses to 
> determine if the call is from a secure call and from the expected server
>  If such security is required is that not sufficient?
>
> Thanks in advance.
>

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


Database queries location

2014-12-18 Thread pythonista
I understand that functions can be placed in the models fille

However if I have complex queries that receive post input does the 


Query live in the model  the views or an external module

-- 
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/45f5d942-2ede-49bb-8ec1-d5a2486bd656%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database queries location

2014-12-20 Thread pythonista
Thank you for your response.  

Most of my data is complex raw sql.
I had placed it in the views and it is working as expected

I would like to migrate the raw sql to managers, 
Can you point me to one or more good examples of how the manager is coded 
and how the sql interacts with the views.

Thanks


On Friday, December 19, 2014 7:06:54 AM UTC-5, aRkadeFR wrote:
>
> Depend exactly on what to compute for your post data. 
>
> I would almost write no logic code in the views. 
>
> I split every application as follow: 
> - managers.py: All the logic as a table level (raw SQL, complex queries) 
> - models.py: All logic as a row level / object level (python computing 
> data) 
> - forms.py: All logic as forms data / processing / validation for 
> request data 
>
> Have a good one, 
>
> aRkadeFR 
>
> On 12/18/2014 10:12 PM, pythonista wrote: 
> > I understand that functions can be placed in the models fille 
> > 
> > However if I have complex queries that receive post input does the 
> > 
> > 
> > Query live in the model  the views or an external module 
> > 
>
>

-- 
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/949a0a58-bc51-4bbc-91bb-87e29b5b5f4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django url issues, append slash and case insensitvity

2014-12-23 Thread pythonista
I am having some issues with trailing slashes.

The application is working fine from my local machine whether I add a 
trailing slash or not.

It is not working as expected on the servers.  The link is being redirected 
to localhost for some reason.


I thought that SLASH_APPEND= True was on by default in the settings.py file.

1. I can add that to the settings file.
url(r'^waitlist/',
2.  I can addwaitlist/?' ( ?)
to each url.  

On my machine the url router goes to the correct page, but it now is 
missing the /
waitlist/add_account/

now becomes 

waitlistadd_account/(the middle /   is missing, but the code seems to 
be working.)

Any help would be appreciated.

While I am on a similar subject,

to make the request case insensitive, if I make the above call like this to 
make it case insensitive, is this the best way, are there any side effects 
of this approach?

url(r'^(?i)waitlist/?'

Thanks in advance.

We are using nginx, is there any way to code the case insensitivity piece 
in there?

Thanks

Bob

-- 
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/724c4041-24ba-4a04-b427-31fde9c83208%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database queries location

2014-12-23 Thread pythonista
Can this be used with a complex query in which multiple tables (classes) 
are being joined? 

I also have to pass multiple post values to the query.

Thanks for the example



On Monday, December 22, 2014 8:52:04 PM UTC-5, Collin Anderson wrote:
>
> Hi,
>
> There's a good example of creating a custom manager here:
> https://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers
>
> Collin
>
> On Saturday, December 20, 2014 8:28:57 AM UTC-6, pythonista wrote:
>>
>> Thank you for your response.  
>>
>> Most of my data is complex raw sql.
>> I had placed it in the views and it is working as expected
>>
>> I would like to migrate the raw sql to managers, 
>> Can you point me to one or more good examples of how the manager is coded 
>> and how the sql interacts with the views.
>>
>> Thanks
>>
>>
>> On Friday, December 19, 2014 7:06:54 AM UTC-5, aRkadeFR wrote:
>>>
>>> Depend exactly on what to compute for your post data. 
>>>
>>> I would almost write no logic code in the views. 
>>>
>>> I split every application as follow: 
>>> - managers.py: All the logic as a table level (raw SQL, complex queries) 
>>> - models.py: All logic as a row level / object level (python computing 
>>> data) 
>>> - forms.py: All logic as forms data / processing / validation for 
>>> request data 
>>>
>>> Have a good one, 
>>>
>>> aRkadeFR 
>>>
>>> On 12/18/2014 10:12 PM, pythonista wrote: 
>>> > I understand that functions can be placed in the models fille 
>>> > 
>>> > However if I have complex queries that receive post input does the 
>>> > 
>>> > 
>>> > Query live in the model  the views or an external module 
>>> > 
>>>
>>>

-- 
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/da462827-3f99-4438-bba5-94639f11e2a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to capture any incorrect typing of a url and pass it to a default page

2014-12-24 Thread pythonista
I want to code the urls.py such that if someone types in any garbage inn 
the browser the final line of the url router will grab the line and reroute 
it to some page(the home page) for example.

I added the following line of code to the bottom of the url  

url(r'^([a-zA-Z0-9\-\_]*)', views.my_default),   expecting that it would 
send it to my default view

So, it appears to be working and  not matching anything above that  url and 
falls all the way through, however I am getting any error

TypeError at /waitlist/dict

my_default() takes exactly 1 argument (2 given)



My view is very simple


def my_default_2(request):
context = RequestContext(request)
context_dict = {'boldmessage': "pass through from waitlist"}
return render_to_response('waitlist/home.html', context_dict, context)



So, it looks like it is getting to the view, but I am getting the error above.

Any suggestions as to why I am getting the argument error above.


Thanks



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


Problem migration to server with gunicorn and nginx

2015-01-02 Thread pythonista
The application is working as expected in my development region, but when 
the admin migrates it to the server and starts up gnicorn and nginx, I get 
the following errror.

I would appreciate any assistance.

The application was running the first time we migrated 2 weeks ago to QA.

Not sure if the admin changed anything on the server side during the past 2 
weeks.

Thanks in advance.



[2015-01-02 13:07:09 +] [20222] [DEBUG] GET /waitlist/

[2015-01-02 13:07:09 +] [20222] [ERROR] Error handling request

Traceback (most recent call last):

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/workers/sync.py",
 
line 93, in h  andle

self.handle_request(listener, req, client, addr)

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/workers/sync.py",
 
line 134, in   handle_request

respiter = self.wsgi(environ, resp.start_response)

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/handlers/wsgi.py",
 
line 187, in   __call__

response = self.get_response(request)

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/handlers/base.py",
 
line 199, in   get_response

response = self.handle_uncaught_exception(request, resolver, 
sys.exc_info())

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/handlers/base.py",
 
line 239, in   handle_uncaught_exception

if resolver.urlconf_module is None:

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/urlresolvers.py",
 
line 366, in   urlconf_module

self._urlconf_module = import_module(self.urlconf_name)

  File "/opt/python-2.7.8/lib/python2.7/importlib/__init__.py", line 37, in 
import_module

__import__(name)

  File "/opt/housing/housing/housing/urls.py", line 9, in 

url(r'^waitlist/', include('waitlist.urls')),

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/conf/urls/__init__.py",
 
line 28, in   include

urlconf_module = import_module(urlconf_module)

  File "/opt/python-2.7.8/lib/python2.7/importlib/__init__.py", line 37, in 
import_module

__import__(name)

  File "/opt/housing/housing/waitlist/urls.py", line 2, in 

from waitlist import views

  File "/opt/housing/housing/waitlist/waitlist/views.py", line 5, in 


from models import *

  File "/opt/housing/housing/waitlist/waitlist/models.py", line 7, in 


class Post(models.Model):

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/db/models/base.py",
 
line 285, in __n  ew__

new_class._meta.apps.register_model(new_class._meta.app_label, 
new_class)

  File 
"/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/apps/registry.py",
 
line 213, in regi  ster_model

(model_name, app_label, app_models[model_name], model))

RuntimeError: Conflicting 'post' models in application 'waitlist':  and .

[2015-01-02 14:07:21 +] [20214] [DEBUG] 3 workers

[2015-01-02 14:07:36 +] [20214] [DEBUG] 3 workers

[midware@itd-qa-wt-lap2 logs]$

-- 
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/7c3e431b-77fc-4d8d-8bd2-1ce6f902e5d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Best Practices for transferring email form data to web server

2015-08-28 Thread pythonista


I have created a form that works fine for GETS and POSTS through the 
browser.

I have embedded the form with a GET (action) in the email, and the data 
gets transferred to the server as expected.

The email POST looks like it needs a csrf token.
Is there anyway to generate this and embed it on the fly as hidden?

What are the best practices for capturing and submitting form data from 
emails.
POST or GET

In my case the data is not sensitive information.


Thanks in advance

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


Re: Best Practices for transferring email form data to web server

2015-08-31 Thread pythonista
That worked.

I was not aware of the csrf exempt directive.

My email form works the way that I want.

On Friday, August 28, 2015 at 5:22:46 PM UTC-4, pythonista wrote:
>
>
>
> I have created a form that works fine for GETS and POSTS through the 
> browser.
>
> I have embedded the form with a GET (action) in the email, and the data 
> gets transferred to the server as expected.
>
> The email POST looks like it needs a csrf token.
> Is there anyway to generate this and embed it on the fly as hidden?
>
> What are the best practices for capturing and submitting form data from 
> emails.
> POST or GET
>
> In my case the data is not sensitive information.
>
>
> Thanks in advance
>

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