Re: rest API create a signed_cookies including my token

2018-12-17 Thread Andréas Kühne
Hi,

I wouldn't use session based backends at all - because then you will need
to do session based login instead of using the token. This is not a
standard way of doing rest requests at least.

What I would do is just save the token in localstorage on the client. This
is the way we do it for handling long based requests. Also then you will
need to be able to refresh the token when the token expires (which you
should do anyway).

This would solve all of your problems (including mobile app - you just
store the token in the app).

You can see this approach here:
https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0

Check under the header "Storing JWT token".

It doesn't need to be a JWT token - the principal is that same regardless
of how you generate the token.

Regards,

Andréas


Den sön 16 dec. 2018 kl 20:18 skrev cyril moreau :

> Hi,
>
> I am looking for information/help about storing my token in a cookie in a
> safe way.
>
> Backend : Django rest framework - Frontend Reacjs
>
> I am using django-rest-framework-social-oauth2
>  to get
> a token (from different provider). and make request to the API (it works)
>
> But everytime i refresh the page the user get logged out as the reactjs
> does not keep the token in a cookie and the user has to login again.
>
> i would like to keep it in a cookie to let the user make requests even if
> he closes the browser.
>
> I also want to secure it with csrf protection.
>
> I have spent a lot of time looking for a solution and today i have found 
> django.contrib.sessions.backends.signed_cookies
> or django.contrib.sessions.backends.db
>
> The one that interest me is the
> django.contrib.sessions.backends.signed_cookies
>
> 1) I would like to know if a middleware exists to generate the signed
> cookie or if i have to create it?
>
2) This signed cookie will it be used by the sessionAuthentication backend
> or should I develop a piece of code that will get the token from the signed
> cookie -> authenticate the token -> allow the user to execute his request ?
>
> 3) where the signed cookie data is stored (database?) and how can i get
> them?
>
> 4) Is it OK to put the token in the cookie?
>
>
>
> I would like to implement an API that can authenticate web browser or
> mobile app
>
>
> 5) I want to be able to use the token to authenticate from the browser to
> my website (cookie to avoid that the user has to login again and again)
>
> 6) I want to use this api for a mobile app as well? so creating a cookie,
> does it create a conflict during the mobile app authentication?
>
>
> Thank you for your 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f8f0f7e7-0556-4277-95ea-347552277ca5%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcC_-ipwehRNKW6KUzLVi4VzU2SACPbmvmm1BPK6M8Z%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: rest API create a signed_cookies including my token

2018-12-17 Thread cyril moreau
Hi,

I thought also about storing the token in the local storage, but according 
to my research it is not safe because it is open to xss attack and  the 
token will be accessible from any browser's tab using javascript.
Is localstorage widely used to store the token even if it is not safe ?

That is why i thought to use cookies and csrf protection for the web-based 
app.
If you have a safe solution with tokens only, it will take it.

Thank you
Cyril


Le lundi 17 décembre 2018 09:53:03 UTC+1, Andréas Kühne a écrit :
>
> Hi,
>
> I wouldn't use session based backends at all - because then you will need 
> to do session based login instead of using the token. This is not a 
> standard way of doing rest requests at least.
>
> What I would do is just save the token in localstorage on the client. This 
> is the way we do it for handling long based requests. Also then you will 
> need to be able to refresh the token when the token expires (which you 
> should do anyway).
>
> This would solve all of your problems (including mobile app - you just 
> store the token in the app). 
>
> You can see this approach here:
>
> https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0
>
> Check under the header "Storing JWT token". 
>
> It doesn't need to be a JWT token - the principal is that same regardless 
> of how you generate the token.
>
> Regards,
>
> Andréas
>
>
> Den sön 16 dec. 2018 kl 20:18 skrev cyril moreau  >:
>
>> Hi,
>>
>> I am looking for information/help about storing my token in a cookie in a 
>> safe way.
>>
>> Backend : Django rest framework - Frontend Reacjs
>>
>> I am using django-rest-framework-social-oauth2 
>>  to 
>> get a token (from different provider). and make request to the API (it 
>> works)
>>
>> But everytime i refresh the page the user get logged out as the reactjs 
>> does not keep the token in a cookie and the user has to login again. 
>>
>> i would like to keep it in a cookie to let the user make requests even if 
>> he closes the browser.
>>
>> I also want to secure it with csrf protection.
>>
>> I have spent a lot of time looking for a solution and today i have found 
>> django.contrib.sessions.backends.signed_cookies 
>> or django.contrib.sessions.backends.db
>>
>> The one that interest me is the 
>> django.contrib.sessions.backends.signed_cookies 
>>
>> 1) I would like to know if a middleware exists to generate the signed 
>> cookie or if i have to create it?
>>
> 2) This signed cookie will it be used by the sessionAuthentication backend 
>> or should I develop a piece of code that will get the token from the signed 
>> cookie -> authenticate the token -> allow the user to execute his request ?
>>
>> 3) where the signed cookie data is stored (database?) and how can i get 
>> them?
>>
>> 4) Is it OK to put the token in the cookie?
>>
>>
>>
>> I would like to implement an API that can authenticate web browser or 
>> mobile app
>>
>>
>> 5) I want to be able to use the token to authenticate from the browser 
>> to my website (cookie to avoid that the user has to login again and again)
>>
>> 6) I want to use this api for a mobile app as well? so creating a cookie, 
>> does it create a conflict during the mobile app authentication?
>>
>>
>> Thank you for your 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...@googlegroups.com .
>> To post to this group, send email to django...@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/f8f0f7e7-0556-4277-95ea-347552277ca5%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2bdb1ed4-a857-4050-9061-56fdd6af6a14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2018-12-17 Thread Daniel Hepper
Check out this repository:
https://github.com/consideratecode/django-tutorial-step-by-step

It's not updated for Django 2.1 yet, but the differences should not matter
in your case.

Hope that helps,
Daniel

On Sun, Dec 16, 2018 at 8:18 PM Sarthak Khandelwal 
wrote:

> can you send your file structure after this step?
> I am having a similar problem, after adding views to url according to the
> tutorial in the documentation, when I was trying to run the server i was
> having a similar to your problem.
> If anyone has completed this step please share the file structure to
> confirm if I am doing something wrong.
>
> and yes I am not doing this error.
>
> On Friday, October 18, 2013 at 2:04:28 AM UTC+5:30,
> michael@farecompare.com wrote:
>>
>> Oh my gosh ... I did. LOL. Thanks. I'm an idiot.
>>
> --
> 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/e2a3e21b-6f32-4f67-8689-4f9a380f0b7b%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHEnUVWeCXGeLj-7O%2BrMztP%3Dp6PTaO%2BMtm2m8KpAV-jG70i_BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password reset from address

2018-12-17 Thread Larry Martell
Thanks for the reply, Andréas, but I just found this in the docs,
which I had missed before:

https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-DEFAULT_FROM_EMAIL

On Fri, Dec 14, 2018 at 3:51 PM Andréas Kühne
 wrote:
>
> Hi,
>
> Check the views for password reset in the django.contrib.auth package. You 
> can add the form_email by creating a class that inherits the 
> PasswordResetView and sets the from_email property on that view.
>
> Regards,
>
> Andréas
>
>
> Den fre 14 dec. 2018 kl 19:02 skrev Larry Martell :
>>
>> Is there a way to set the from address used in the password reset email?

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


Re: rest API create a signed_cookies including my token

2018-12-17 Thread Andréas Kühne
The only way to get the localstorage is if you get malicious code on your
own page. The localstorage is specific for your site - it even is different
if you have http and https for the same site.

The way it could be exploited would be if you include js on your site (some
third party thing) that scrapes the localstorage variables.

Regards,

Andréas


Den mån 17 dec. 2018 kl 11:24 skrev cyril moreau :

> Hi,
>
> I thought also about storing the token in the local storage, but according
> to my research it is not safe because it is open to xss attack and  the
> token will be accessible from any browser's tab using javascript.
> Is localstorage widely used to store the token even if it is not safe ?
>
> That is why i thought to use cookies and csrf protection for the web-based
> app.
> If you have a safe solution with tokens only, it will take it.
>
> Thank you
> Cyril
>
>
> Le lundi 17 décembre 2018 09:53:03 UTC+1, Andréas Kühne a écrit :
>>
>> Hi,
>>
>> I wouldn't use session based backends at all - because then you will need
>> to do session based login instead of using the token. This is not a
>> standard way of doing rest requests at least.
>>
>> What I would do is just save the token in localstorage on the client.
>> This is the way we do it for handling long based requests. Also then you
>> will need to be able to refresh the token when the token expires (which you
>> should do anyway).
>>
>> This would solve all of your problems (including mobile app - you just
>> store the token in the app).
>>
>> You can see this approach here:
>>
>> https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0
>>
>> Check under the header "Storing JWT token".
>>
>> It doesn't need to be a JWT token - the principal is that same regardless
>> of how you generate the token.
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den sön 16 dec. 2018 kl 20:18 skrev cyril moreau :
>>
>>> Hi,
>>>
>>> I am looking for information/help about storing my token in a cookie in
>>> a safe way.
>>>
>>> Backend : Django rest framework - Frontend Reacjs
>>>
>>> I am using django-rest-framework-social-oauth2
>>>  to
>>> get a token (from different provider). and make request to the API (it
>>> works)
>>>
>>> But everytime i refresh the page the user get logged out as the reactjs
>>> does not keep the token in a cookie and the user has to login again.
>>>
>>> i would like to keep it in a cookie to let the user make requests even
>>> if he closes the browser.
>>>
>>> I also want to secure it with csrf protection.
>>>
>>> I have spent a lot of time looking for a solution and today i have found 
>>> django.contrib.sessions.backends.signed_cookies
>>> or django.contrib.sessions.backends.db
>>>
>>> The one that interest me is the
>>> django.contrib.sessions.backends.signed_cookies
>>>
>>> 1) I would like to know if a middleware exists to generate the signed
>>> cookie or if i have to create it?
>>>
>> 2) This signed cookie will it be used by the sessionAuthentication
>>> backend or should I develop a piece of code that will get the token from
>>> the signed cookie -> authenticate the token -> allow the user to execute
>>> his request ?
>>>
>>> 3) where the signed cookie data is stored (database?) and how can i get
>>> them?
>>>
>>> 4) Is it OK to put the token in the cookie?
>>>
>>>
>>>
>>> I would like to implement an API that can authenticate web browser or
>>> mobile app
>>>
>>>
>>> 5) I want to be able to use the token to authenticate from the browser
>>> to my website (cookie to avoid that the user has to login again and again)
>>>
>>> 6) I want to use this api for a mobile app as well? so creating a
>>> cookie, does it create a conflict during the mobile app authentication?
>>>
>>>
>>> Thank you for your 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/f8f0f7e7-0556-4277-95ea-347552277ca5%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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https

Re: Password reset from address

2018-12-17 Thread Andréas Kühne
Hi,

Yes - but that sets the from email on ALL emails that don't specifically
define any other - if that's what you are after - that would work :-)

Regards,

Andréas


Den mån 17 dec. 2018 kl 16:28 skrev Larry Martell :

> Thanks for the reply, Andréas, but I just found this in the docs,
> which I had missed before:
>
>
> https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-DEFAULT_FROM_EMAIL
>
> On Fri, Dec 14, 2018 at 3:51 PM Andréas Kühne
>  wrote:
> >
> > Hi,
> >
> > Check the views for password reset in the django.contrib.auth package.
> You can add the form_email by creating a class that inherits the
> PasswordResetView and sets the from_email property on that view.
> >
> > Regards,
> >
> > Andréas
> >
> >
> > Den fre 14 dec. 2018 kl 19:02 skrev Larry Martell <
> larry.mart...@gmail.com>:
> >>
> >> Is there a way to set the from address used in the password reset email?
>
> --
> 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/CACwCsY4O1X-oubo5v5t%2B6QDWxEduGaxhWUbgyirRiOrMao9z4A%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Enterprise web application with admin interface

2018-12-17 Thread Mario Daniel Carugno
Hi everyone !

My question is simple:

*Is possible (or good) to build an enterprise web application using only 
> the admin interface ?*


I've heard that the admin interface is very customizable/extensible, so it 
sounds like a great idea.

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b9acd47-b6ce-4d67-a001-593151636355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error of channels

2018-12-17 Thread cn . lujianxin
I had an error while build a chatroom useing django-channels:

I tried follow the official website: https://channels.readthedocs.io

but while i build a room to chat with many people, an error occered:

Exception inside application: Reader at end of file
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/sessions.py",
 
line 179, in __call__
return await self.inner(receive, self.send)
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/middleware.py",
 
line 41, in coroutine_call
await inner_instance(receive, send)
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/consumer.py",
 
line 59, in __call__
[receive, self.channel_receive], self.dispatch
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/utils.py",
 
line 52, in await_many_dispatch
await dispatch(result)
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/consumer.py",
 
line 73, in dispatch
await handler(message)
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/generic/websocket.py",
 
line 196, in websocket_receive
await self.receive(text_data=message["text"])
  File "/home/lujianxin/Files/PycharmProjects/demo/chat/consumers.py", line 
44, in receive
'message': message
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels_redis/core.py",
 
line 611, in group_send
key, min=0, max=int(time.time()) - self.group_expiry
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/aioredis/commands/sorted_set.py",
 
line 268, in zremrangebyscore
return self.execute(b'ZREMRANGEBYSCORE', key, min, max)
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/aioredis/commands/__init__.py",
 
line 51, in execute
return self._pool_or_conn.execute(command, *args, **kwargs)
  File 
"/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/aioredis/connection.py",
 
line 319, in execute
raise ConnectionClosedError(msg)
  Reader at end of file
WebSocket DISCONNECT /ws/chat/ljx/ [192.168.2.126:41154]

if i just build a echo server for one connection, it works ok, but while i 
use channels and group_send, it worked ok when i send one or two message, 
all of memeber of the room received message, while i send more the problem 
raising, i promissed that i followed the lesson and my settings, 
environment is ok, but what caused this error?

-- 
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/210770a5-b587-486d-840c-56e3deab160a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: No query results on heroku, but working on local development server

2018-12-17 Thread Ketan Varia
Hi Mathew,

I am still learner of django but I had faced similar issue while deploying
my code to heroku.  I followed below steps.

- local server installed postgres database and updated settings.py
- taken local backup of database
 pg_dump -U postgres  --no-owner --no-acl -f   **
- Deploy your code to heroku
- heroku run python manage.py migrate
- heroku run python manage.py createsuperuser
- restore data
 heroku pg:psql --app **  <  **

Regards,
Ketan

On Mon, Dec 17, 2018 at 12:48 AM Joel Mathew  wrote:

>
> 0down votefavorite
> 
>
> I just started using heroku today. I was testing a web application, and
> got different results on using django app from local development server and
> heroku. I had imported to the database by running the django development
> webserver. Since the postgredb uses the amazonaws url, I assumed that this
> data would be available to the production server on heroku.
>
> From my local django webserver, the following search yields correct
> results:
>
> from django.db.models import CharFieldfrom django.db.models.functions import 
> LowerCharField.register_lookup(Lower, "lower")import logging
> logger = logging.getLogger('testlogger')
> logger.info('This is a simple log message')
> items_set = []if request.method == 'POST':
> print(request.POST.get)
> form = CGHSMetaForm(request.POST)
> name = request.POST.get('name').lower()
> items_set = CGHSRates.objects.filter(
> name__lower__contains=name).order_by('name')
> print(items_set)
> logger.info(items_set)else:
> form = CGHSMetaForm()
> return render(
> request, 'app/cghs_search.html', {
> 'rnd_num': randomnumber(),
> 'form': form,
> 'items': items_set,
> })
>
> I get the following results:
>
> CodeNameRate1098After Mastectomy (Reconstruction)MammoplastyRs 
> 13800.0364Local mastectomy-simpleRs 14548.0251MastoidectomyRs 17193.0
>
> On heroku, however, I receive an empty result.
>
> The database is the default heroku database, a postgre db, defined by the
> following settings in settings.py:
>
> import dj_database_url
> DATABASES = {'default': 
> dj_database_url.config(default='postgres://kpnbcpyqtxxjqu:2c86exffsdff0d789e7f3b29d70sfsfsffs7be197sffsfsffb...@ec2-53-22-46-10.compute-1.amazonaws.com:5432/dful1l3ra7nknn')}
>
> Why does the same database when accessed on different servers yield
> different results? What should I be checking?
>
> --
> 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/CAA%3Diw__mSiZvrTZTrraLB4jq-kiFvm7Qkr0B6D%2Bffa2w4J-rkg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Attribute Error: 'None Type' object has no attribute 'split'

2018-12-17 Thread Richard Balwane
Using reverse to shortcut URLs, addressing compatibilities of sorts
although am running the following;

dj-database-url==0.5.0

Django==2.1.4

django-crispy-forms==1.7.2

gunicorn==19.9.0

mysqlclient==1.3.14

Pillow==5.3.0

psycopg2==2.7.6.1

pytz==2018.7

My problem is that now my "detail" isn't working.

What do I have to do, please, to get the details working?

**Link in template:


{% for obj in object_list %}
 {{ obj }} 
{{ obj.name }} {{ obj.location }} {{ obj.category }} {{
obj.timestamp }} {{ obj.updated }} 
{% endfor %}


*URL in App:

from django.conf.urls import url

from restaurants.views import (
# restaurant_createview,
# restaurant_listview,
RestaurantListView,
RestaurantDetailView,
RestaurantCreateView

)

app_name = 'restaurants'

urlpatterns = [
url(r'$', RestaurantListView.as_view(), name='list'),
url(r'^create/$', RestaurantCreateView.as_view(), name='create'), #
RestaurantCreateView.as_view()),
url(r'^(?P[\w-]+)/$', RestaurantDetailView.as_view(),
name='detail'),
]

*Main URLs

from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import TemplateView

from django.contrib.auth.views import LoginView



from restaurants.views import (
restaurant_createview,
restaurant_listview,
RestaurantListView,
RestaurantDetailView,
RestaurantCreateView

)

urlpatterns = [
url('admin/', admin.site.urls),
url(r'^$', TemplateView.as_view(template_name = 'home.html'),
name='home'),
url(r'^login/$', LoginView.as_view(), name='login'),
url('restaurants/', include('restaurants.urls',
namespace='restaurants')),
url(r'^about/$', TemplateView.as_view(template_name = 'about.html'),
name='about'),
url(r'^contact/$', TemplateView.as_view(template_name =
'contact.html'), name='contact'),
]


**Model

from django.conf import settings
from django.db import models
from django.db.models.signals import pre_save, post_save
from django.urls import reverse


from .utils import unique_slug_generator
from .validators import validate_category


User = settings.AUTH_USER_MODEL


class RestaurantLocation(models.Model):
owner  = models.ForeignKey(User, on_delete=models.CASCADE) #
class_instance.model_set.all # check out - Django Models Unleashed
JOINCFE.com
name   = models.CharField(max_length=120)
location   = models.CharField(max_length=120, null=True, blank=True)
category   = models.CharField(max_length=120, null=True, blank=True,
validators=[validate_category])
timestamp  = models.DateTimeField(auto_now_add=True)
updated= models.DateTimeField(auto_now=True)
slug   = models.SlugField(null=True, blank=True)

def __str__(self):
return self.name

def get_absolute_url(self): #get_absolute_url
#return f"/restaurants/{self.slug}" Removed in order to use reverse
- url resolvers
return reverse('restaurants:detail', kwargs={'slug': self.slug})
#changed from restaurants-detailto us the restaurants namespace

@property
def title(self):
return self.name #object.title

def rl_pre_save_receiver(sender, instance, *args, **kwargs):
instance.category = instance.category.capitalize()
if not instance.slug:
instance.slug = unique_slug_generator(instance)

#def rl_post_save_receiver(sender, instance, created, *args, **kwargs):
# print('saved')
# print(instance.timestamp)
# if not instance.slug:
# instance.slug = unique_slug_generator(instance)
#instance.save()

pre_save.connect(rl_pre_save_receiver, sender=RestaurantLocation)
#pre_save.connect(rl_post_save_receiver, sender=RestaurantLocation)


**Views


from django.contrib.auth.decorators import login_required # login
decorator, forces u to login before u see form!
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.views import View
from django.views.generic import TemplateView, ListView, DetailView,
CreateView

from .forms import RestaurantCreateForm, RestaurantLocationCreateForm
from .models import RestaurantLocation

# Create your views here.
# class based view

@login_required()
def restaurant_createview(request):
form = RestaurantLocationCreateForm(request.POST or None)
errors = None
if form.is_valid():
# form.save() --- This is done by default in this FBV
if request.user.is_authenticated:
instance = form.save(commit=False)
# customise
# like a pre_save
instance.owner = request.user #  User is of AnonymousUser
classif not logged in
instance.save()
# like a post_save
return HttpResponseRedirect("/restaurants/")
else:
return HttpResponseRed

Re: Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2018-12-17 Thread BALA KRISHNAN
you can change this url from your app

from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
from rest_framework import routers

from user_profile.views import UserViewSet

router = routers.DefaultRouter()
router.register(r'user', UserViewSet,)

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

# This is used for user reset password
url(r'^', include('django.contrib.auth.urls')),
url(r'^rest-auth/', include('rest_auth.urls')),
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
url(r'^account/', include('allauth.urls')),
url(r'^api/',  include(router.urls)),
]


On Mon, 17 Dec 2018 at 16:37, Daniel Hepper  wrote:

> Check out this repository:
> https://github.com/consideratecode/django-tutorial-step-by-step
>
> It's not updated for Django 2.1 yet, but the differences should not matter
> in your case.
>
> Hope that helps,
> Daniel
>
> On Sun, Dec 16, 2018 at 8:18 PM Sarthak Khandelwal 
> wrote:
>
>> can you send your file structure after this step?
>> I am having a similar problem, after adding views to url according to the
>> tutorial in the documentation, when I was trying to run the server i was
>> having a similar to your problem.
>> If anyone has completed this step please share the file structure to
>> confirm if I am doing something wrong.
>>
>> and yes I am not doing this error.
>>
>> On Friday, October 18, 2013 at 2:04:28 AM UTC+5:30,
>> michael@farecompare.com wrote:
>>>
>>> Oh my gosh ... I did. LOL. Thanks. I'm an idiot.
>>>
>> --
>> 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/e2a3e21b-6f32-4f67-8689-4f9a380f0b7b%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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHEnUVWeCXGeLj-7O%2BrMztP%3Dp6PTaO%2BMtm2m8KpAV-jG70i_BA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Error of channels

2018-12-17 Thread Andrew Godwin
I've seen a lot of people have a similar error but I'm never sure what
causes it - that said, I generally advise them to check their Redis logs to
see if Redis is OK, as that could cause this?

Andrew

On Mon, Dec 17, 2018 at 11:36 AM  wrote:

> I had an error while build a chatroom useing django-channels:
>
> I tried follow the official website: https://channels.readthedocs.io
>
> but while i build a room to chat with many people, an error occered:
>
> Exception inside application: Reader at end of file
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/sessions.py",
> line 179, in __call__
> return await self.inner(receive, self.send)
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/middleware.py",
> line 41, in coroutine_call
> await inner_instance(receive, send)
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/consumer.py",
> line 59, in __call__
> [receive, self.channel_receive], self.dispatch
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/utils.py",
> line 52, in await_many_dispatch
> await dispatch(result)
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/consumer.py",
> line 73, in dispatch
> await handler(message)
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels/generic/websocket.py",
> line 196, in websocket_receive
> await self.receive(text_data=message["text"])
>   File "/home/lujianxin/Files/PycharmProjects/demo/chat/consumers.py",
> line 44, in receive
> 'message': message
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/channels_redis/core.py",
> line 611, in group_send
> key, min=0, max=int(time.time()) - self.group_expiry
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/aioredis/commands/sorted_set.py",
> line 268, in zremrangebyscore
> return self.execute(b'ZREMRANGEBYSCORE', key, min, max)
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/aioredis/commands/__init__.py",
> line 51, in execute
> return self._pool_or_conn.execute(command, *args, **kwargs)
>   File
> "/home/lujianxin/VirtualEnvs/demo/lib/python3.7/site-packages/aioredis/connection.py",
> line 319, in execute
> raise ConnectionClosedError(msg)
>   Reader at end of file
> WebSocket DISCONNECT /ws/chat/ljx/ [192.168.2.126:41154]
>
> if i just build a echo server for one connection, it works ok, but while i
> use channels and group_send, it worked ok when i send one or two message,
> all of memeber of the room received message, while i send more the problem
> raising, i promissed that i followed the lesson and my settings,
> environment is ok, but what caused this error?
>
> --
> 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/210770a5-b587-486d-840c-56e3deab160a%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1urnOyULa1o0GBEqfoRT_8YnUPR3y6umwuiL8goNS80u7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2018-12-17 Thread Aakash Choudhary
Share the code I'll debug the error

On Mon, 17 Dec 2018, 00:47 Sarthak Khandelwal  can you send your file structure after this step?
> I am having a similar problem, after adding views to url according to the
> tutorial in the documentation, when I was trying to run the server i was
> having a similar to your problem.
> If anyone has completed this step please share the file structure to
> confirm if I am doing something wrong.
>
> and yes I am not doing this error.
>
> On Friday, October 18, 2013 at 2:04:28 AM UTC+5:30,
> michael@farecompare.com wrote:
>>
>> Oh my gosh ... I did. LOL. Thanks. I'm an idiot.
>>
> --
> 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/e2a3e21b-6f32-4f67-8689-4f9a380f0b7b%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOB_Bqpsy5kP9_bp0qO1MceUh9NRPBidByjBxpCwG-N0KifSAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: rest API create a signed_cookies including my token

2018-12-17 Thread cyril moreau
I have read different posts or article that warn people about storing 
session data in the local storage. OWASP 

 or http://cryto.net/~joepie91/blog/2016/06/13/stop-using-jwt-for-sessions/

That is why i would like to create a session cookie

Local Storage
   
   - Also known as Offline Storage, Web Storage. Underlying storage 
   mechanism may vary from one user agent to the next. In other words, any 
   authentication your application requires can be bypassed by a user with 
   local privileges to the machine on which the data is stored. Therefore, 
   it's recommended not to store any sensitive information in local storage.
   - Use the object sessionStorage instead of localStorage if persistent 
   storage is not needed. sessionStorage object is available only to that 
   window/tab until the window is closed.
   - A single Cross Site Scripting 
    can be used 
   to steal all the data in these objects, so again it's recommended not to 
   store sensitive information in local storage.
   - A single Cross Site Scripting 
    can be used 
   to load malicious data into these objects too, so don't consider objects in 
   these to be trusted.
   - Pay extra attention to “localStorage.getItem” and “setItem” calls 
   implemented in HTML5 page. It helps in detecting when developers build 
   solutions that put sensitive information in local storage, which is a bad 
   practice.
   - Do not store session identifiers in local storage as the data is 
   always accesible by JavaScript. Cookies can mitigate this risk using the 
   httpOnly flag.
   - There is no way to restrict the visibility of an object to a specific 
   path like with the attribute path of HTTP Cookies, every object is shared 
   within an origin and protected with the Same Origin Policy. Avoid host 
   multiple applications on the same o



Regards,

Le lundi 17 décembre 2018 19:02:07 UTC+1, Andréas Kühne a écrit :
>
> The only way to get the localstorage is if you get malicious code on your 
> own page. The localstorage is specific for your site - it even is different 
> if you have http and https for the same site.
>
> The way it could be exploited would be if you include js on your site 
> (some third party thing) that scrapes the localstorage variables.
>
> Regards,
>
> Andréas
>
>
> Den mån 17 dec. 2018 kl 11:24 skrev cyril moreau  >:
>
>> Hi,
>>
>> I thought also about storing the token in the local storage, but 
>> according to my research it is not safe because it is open to xss attack 
>> and  the token will be accessible from any browser's tab using javascript.
>> Is localstorage widely used to store the token even if it is not safe ?
>>
>> That is why i thought to use cookies and csrf protection for the 
>> web-based app.
>> If you have a safe solution with tokens only, it will take it.
>>
>> Thank you
>> Cyril
>>
>>
>> Le lundi 17 décembre 2018 09:53:03 UTC+1, Andréas Kühne a écrit :
>>>
>>> Hi,
>>>
>>> I wouldn't use session based backends at all - because then you will 
>>> need to do session based login instead of using the token. This is not a 
>>> standard way of doing rest requests at least.
>>>
>>> What I would do is just save the token in localstorage on the client. 
>>> This is the way we do it for handling long based requests. Also then you 
>>> will need to be able to refresh the token when the token expires (which you 
>>> should do anyway).
>>>
>>> This would solve all of your problems (including mobile app - you just 
>>> store the token in the app). 
>>>
>>> You can see this approach here:
>>>
>>> https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0
>>>
>>> Check under the header "Storing JWT token". 
>>>
>>> It doesn't need to be a JWT token - the principal is that same 
>>> regardless of how you generate the token.
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>>
>>> Den sön 16 dec. 2018 kl 20:18 skrev cyril moreau :
>>>
 Hi,

 I am looking for information/help about storing my token in a cookie in 
 a safe way.

 Backend : Django rest framework - Frontend Reacjs

 I am using django-rest-framework-social-oauth2 
  to 
 get a token (from different provider). and make request to the API (it 
 works)

 But everytime i refresh the page the user get logged out as the reactjs 
 does not keep the token in a cookie and the user has to login again. 

 i would like to keep it in a cookie to let the user make requests even 
 if he closes the browser.

 I also want to secure it with csrf protection.

 I have spent a lot of time looking for a solution and today i have 
 found django.contrib.sessions.backends.signed_cookies or 
 django.contrib.sessions.backends.db

>

how to use sessionauthentication with a custom Model user and define _auth_user_id

2018-12-17 Thread cyril moreau
Hi,

I am trying to use the sessionauthentication with a custom user Model but 
it fails and i dont know why.
My custom Model is :user/user.py
from django.db import models
from django.core.mail import send_mail
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.base_user import AbstractBaseUser
from django.utils.translation import ugettext_lazy as _

from .userManager import UserManager


class User(AbstractBaseUser, PermissionsMixin):
   email = models.EmailField(_('email address'), unique=True)
   password = models.CharField(_('password'), max_length=255, blank=False)
   first_name = models.CharField(_('first name'), max_length=30, blank=True)
   last_name = models.CharField(_('last name'), max_length=30, blank=True)
   date_joined = models.DateTimeField(_('date joined'), auto_now_add=True)
   is_active = models.BooleanField(_('active'), default=True)
   is_staff = models.BooleanField(_('staff status'), default=False)
   avatar = models.CharField(_('avatar'), max_length=30, blank=True, null=
True) 
#models.ImageField(upload_to='avatars/', null=True, blank=True)

objects = UserManager()

USERNAME_FIELD = 'email'
   REQUIRED_FIELDS = []

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


my setting.py :
AUTH_USER_MODEL = 'user.User'
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'user.middleware.CustomAuthentication', # <--- set the path to the function

'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]


I have created a custom middleware customAuthentication to see what does 
not work during the authentication.

class CustomAuthentication(MiddlewareMixin):

def process_request(self,request):
if 'id' in request.session:
logger.error(' process request middleware session[id] {}'
.format(request.session['id']))
user=get_user(request)
logger.error( 'process request middleware User {}'.format(user))

I get the result : 
process request middleware session[id]  2
process request middleware User AnonymousUser

The session has the good ID but when I do get_user(request) this function 
does not found the user.

I was thinking that the issue might be the  SESSION_KEY = '_auth_user_id' 
parameter.

How can I define my model and the _auth_user_id parameter?

Does someone know where can come from this issue? and how can i use 
sessionauthentication with a custom User model?

Thank you








-- 
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/8f69373e-638b-4413-88b1-6770a099f7c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django on IIS

2018-12-17 Thread Larry Martell
Anyone have any experience setting up a Django app to work with IIS? I
have inherited what I was told is a working system, but it's not
working. Before I post details of my issues and questions I wanted to
see if anyone here has successfully got a Django app to run with IIS.

-- 
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/CACwCsY7bk-c7Za-PGUbaEkftA8Xxqd%2BaCUPkaQryW-1kXX0_nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django on IIS

2018-12-17 Thread Alex Heyden
I have recently, and it was equal parts misery and pain. FastCGI via
wfastcgi, as outlined at
http://blog.mattwoodward.com/2016/07/running-django-application-on-windows.html

I also had to downgrade from Python 3.7 to Python 3.6

I wouldn't really consider myself an expert on the subject. All I can say
is that it is possible.

On Mon, Dec 17, 2018 at 5:19 PM Larry Martell 
wrote:

> Anyone have any experience setting up a Django app to work with IIS? I
> have inherited what I was told is a working system, but it's not
> working. Before I post details of my issues and questions I wanted to
> see if anyone here has successfully got a Django app to run with IIS.
>
> --
> 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/CACwCsY7bk-c7Za-PGUbaEkftA8Xxqd%2BaCUPkaQryW-1kXX0_nQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Django on IIS

2018-12-17 Thread Mike Dewhirst

On 18/12/2018 2:16 PM, Alex Heyden wrote:
I have recently, and it was equal parts misery and pain. FastCGI via 
wfastcgi, as outlined at 
http://blog.mattwoodward.com/2016/07/running-django-application-on-windows.html


I also had to downgrade from Python 3.7 to Python 3.6

I wouldn't really consider myself an expert on the subject. All I can 
say is that it is possible.


I once had to implement a web service on a Windows server and eventually 
installed Apache. That worked brilliantly although it wasn't a heavy 
duty application. Django works well on Windows so Apache is a fallback 
if IIS doesn't cut it for you.





On Mon, Dec 17, 2018 at 5:19 PM Larry Martell > wrote:


Anyone have any experience setting up a Django app to work with IIS? I
have inherited what I was told is a working system, but it's not
working. Before I post details of my issues and questions I wanted to
see if anyone here has successfully got a Django app to run with IIS.

-- 
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/CACwCsY7bk-c7Za-PGUbaEkftA8Xxqd%2BaCUPkaQryW-1kXX0_nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Bv0ZYVWO5bFTx%3D6im_dLWwPWz1FoDcFVDN9GXREj%3Dp49f2FcA%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


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