Re: TemplateDoesNotExist for django-registration (but it does)

2017-05-13 Thread farah_chaaban
Hello i have the same problem. please help me

-- 
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/2a204311-cd54-426d-8593-b9e14f1d1319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


what kind of question i can ask here?

2017-05-13 Thread shahab emami
hello

when i get a problem in my code i search for it in google for an hour if i 
couldn't find the answer then i ask my question here.
is this good?
I mean can i ask my programming questions here?
or this group is just for bugs and stuff like that?

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/7a438e5a-4625-4efd-97ea-65a754bd2e1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: what kind of question i can ask here?

2017-05-13 Thread ludovic coues
This group is for answering questions from users of django like yourself.
There is another group specifically for bugs and improvement

2017-05-13 14:49 GMT+02:00 shahab emami :
> hello
>
> when i get a problem in my code i search for it in google for an hour if i
> couldn't find the answer then i ask my question here.
> is this good?
> I mean can i ask my programming questions here?
> or this group is just for bugs and stuff like that?
>
> 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/7a438e5a-4625-4efd-97ea-65a754bd2e1f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 42

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


Need help in Django User Model customization and authentication

2017-05-13 Thread Ajat Prabha


Hello everyone,
I'm creating a payment gateway to make transactions on my college campus go 
cashless. It can be used to pay library dues, stationary charges, etc. The 
user will add money to a central account and then he/she can use that money 
virtually. I chose Django because of its security. But as I need 3 groups 
of users viz. Faculty, Student and Staff, I'm having trouble to implement 
this in the best possible way. I fix one thing, the other gets disturbed. 
I'm new to Django, so I don't have much experience. I'm comfortable with 
views, basic models, etc. But this User customization, I can't get it right.

I'm attaching a representational User model (any suggestions are welcome), 
please have a look. All the 3 groups will have certain fields common and 
certain fields specific to that group only like roll_number/employee_code 
and permission_sets(in case the system is later used for access to labs, 
etc.). The fields at below of the image will be common to all groups.



I also tried this 
 customization 
which 
worked but then I had issues in Django admin view where the password was 
stored in plain hashed value. I think it has something to do with 
reimplementing ReadOnlyPasswordHashWidget method declared in 
django.contrib.auth.forms but I'm not sure!

I chose Django in the first place for security reasons and I'm not able to 
get it right.
Can someone please help me out.

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/a98d6c25-68e0-49f6-acf1-1267e610281a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Aggregating a query while selecting more than grouped by ...

2017-05-13 Thread Bernd Wechner

I'm bamboozled by Django aggregation:

https://docs.djangoproject.com/en/1.11/topics/db/aggregation/

I'd like to add a little to the example they present to clarify my 
problem (keeping it in familiar territory with regards to the 
documentation):


from  django.db  import  models

class  Author(models.Model):
name  =  models.CharField(max_length=100)
age  =  models.IntegerField()  country=  models.ForeignKey('Country')   
class  Country(models.Model):

name  =  models.CharField(max_length=100)

class  Publisher(models.Model):
name  =  models.CharField(max_length=300)
num_awards  =  models.IntegerField()

class  Book(models.Model):
name  =  models.CharField(max_length=300)
pages  =  models.IntegerField()
price  =  models.DecimalField(max_digits=10,  decimal_places=2)
rating  =  models.FloatField()
authors  =  models.ManyToManyField(Author)
publisher  =  models.ForeignKey(Publisher)
pubdate  =  models.DateField()

class  Store(models.Model):
name  =  models.CharField(max_length=300)
books  =  models.ManyToManyField(Book)
registered_users  =  models.PositiveIntegerField()


I'd like to list the name and age of the (one) author in each country 
that published the last book before a given date.


Ostensibly the only option I have is:

LatestAuthors = 
Author.objects.filter(book_set__pubdate__lte=SOMEDATE).values('country').annotate(Max('book_set__pubdate'))


That seems to work generating a query that authors are selected Grouped 
By country and selecting the Maximum book pubdate ... but alas the 
queryset is not a set of author objects it is a set of dictionaries that 
only contain "country", I have no access to the authors name or age!


It seems the values() method is overloaded, and used to both select the 
values that are in the SELECT and the values that are in the GROUP BY 
clause of the generated query.


I would like select all the fields of Author but group by only Country.

So that I could for example list the name and age of the most recently 
published author in each country.


I've read the docs at length and the evidence seems to suggest such an 
overloading alas, and that I may need to write SQL!


But I would like to think my ignorance is great enough that a better 
solution exists, to select * on Author while group by Author.country.


If I leave the values clause out, I get multiple Authors listed per 
country (it is not grouped by country), but I get a set of authors back. 
If I add a second values() clause:


LatestAuthors = 
Author.objects.filter(book_set__pubdate__lte=SOMEDATE).values('country').annotate(Max('book_set__pubdate')).values()


Things get bizarre ... as in I see all the Author fields in the returned 
dictionaries but the group by reverts to id in Author not country. Grrr.


Regards,

Bernd.

--
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/ff4d317e-558c-3ea5-ae29-933af1df7ea4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help in Django User Model customization and authentication

2017-05-13 Thread Constantine Covtushenko
Hi Ajat,

It was not clear to me why you do not use 'Extending the existing User
model' approach, described here

.

For me it works very well in almost all cases.
And if you go that way then authentication/authorization based questions
should not bring any worries at all.

But may be I missed something.
If so, please provide us with more concrete questions.

Regards,
Constantine C.

On Sat, May 13, 2017 at 4:23 PM, Ajat Prabha 
wrote:

> Hello everyone,
> I'm creating a payment gateway to make transactions on my college campus
> go cashless. It can be used to pay library dues, stationary charges, etc.
> The user will add money to a central account and then he/she can use that
> money virtually. I chose Django because of its security. But as I need 3
> groups of users viz. Faculty, Student and Staff, I'm having trouble to
> implement this in the best possible way. I fix one thing, the other gets
> disturbed. I'm new to Django, so I don't have much experience. I'm
> comfortable with views, basic models, etc. But this User customization, I
> can't get it right.
>
> I'm attaching a representational User model (any suggestions are welcome),
> please have a look. All the 3 groups will have certain fields common and
> certain fields specific to that group only like roll_number/employee_code
> and permission_sets(in case the system is later used for access to labs,
> etc.). The fields at below of the image will be common to all groups.
>
>
> 
>
> I also tried this
>  customization 
> which
> worked but then I had issues in Django admin view where the password was
> stored in plain hashed value. I think it has something to do with
> reimplementing ReadOnlyPasswordHashWidget method declared in
> django.contrib.auth.forms but I'm not sure!
>
> I chose Django in the first place for security reasons and I'm not able to
> get it right.
> Can someone please help me out.
>
> 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/a98d6c25-68e0-49f6-acf1-1267e610281a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sincerely yours,
Constantine C

-- 
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/CAK52boU%3D339EOU2L33EAg-jeNPPE%3Dm%2Bp1_ouQH4kx0ivJVO_8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Channels: Multiple 'send' calls in the same consumer

2017-05-13 Thread Tristan Barry
Hi - I'm working with Django Channels (1.1.3) on a Django project and I 
have some questions about how to send multiple messages from the same 
consumer.

The idea is the consumer will receive a request to do some work, and will 
send incremental results back to user. I've attached a simplified example 
below with some questions. I'm hoping someone can steer me in the right 
direction.
 

Django Channels:

>
> def do_some_work(message):
> for i in range(3):
> time.sleep(2)
> message.reply_channel.send({"text": 'Finished work ' + str(i)})
>
> def ws_connect(message):
> message.reply_channel.send({"accept": True})
>
> channel_routing = [
> route('websocket.connect', ws_connect),
> route('websocket.receive', do_some_work, path=r'/todo')
> ]


Javascript (borrowed mostly from the docs):

socket = new WebSocket("ws://" + window.location.host + "/todo/");
> socket.onmessage = function(e) {
> console.log(e.data);
> }
> socket.onopen = function() {
> socket.send("hello world");
> }
> // Call onopen directly if socket is already open
> if (socket.readyState == WebSocket.OPEN) socket.onopen();



Expected results: Every two seconds the browser would receive a reply from 
the consumer saying 'Finished work x'. 

What I observe is a delay for ~6 seconds and then all results returned at 
the same time. Are the response on the reply channel blocked somehow? Is 
there I way I can yield, or release the message before doing the next 
increment of work?

I've also tried setting up a new consumer that *only* replies via a Group. 
So instead of *message.reply_channel.send, *I would 
*Channel('reply-channel').send({results: 
...})* and have a new consumer defined on channel_routing for the 
*'reply-channel'*. But the results are the same - all the 'work' is 
completed before the browser receives a response. 

Any hints on how to send multiple message in the same consumer?

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4bf7d2ce-9a13-4f85-9933-cb8496e1f59d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: View Function Signature?

2017-05-13 Thread Daniel Roseman
On Friday, 12 May 2017 15:11:55 UTC+1, nickeforos wrote:
>
> Thanks for the link. I understand these examples but still I would like to 
> see how a view function is defined.
>
> I also would like to see it in PyCharm. When I click on a view function in 
> PyCharm I only see:
>
> def myview_function(request)
> Inferred type: (request: Any) -> HttpResponse
>
> I would expect to see something like this:
> view_function(request, *args, **kwargs)
>
> I've also looked in django's source but I cannot locate it.
>


But this isn't how Python works. You don't need a defined signature or 
prototype for a class of functions. A view is simply called with the 
request and any parameters passed from the URL, that's all there is to it.
--
DR.

-- 
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/ec6a2b04-dc19-4a72-aac6-74b20dd3e730%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Aggregating a query while selecting more than grouped by ...

2017-05-13 Thread Todor Velichkov
This is a typical *greatest-per-group* problem, there is even a tag 
 for that 
in SO:
And if you search for questions in this area related to Django 
 
you will probably get: here 

 
or here 

.
My approach to this problem, is to use two queries via prefetch_related.
In your case it would be something like this:

countries = Country.objects.prefetch_related(
Prefetch('author_set',
queryset=(Author.objects
.filter(book_set__pubdate__lte=SOMEDATE)
.annotate(last_publish=Max('book_set__pubdate'))
.order_by('-last_publish')
),
to_attr='authors'
)
)

#usage
for country in countries:
#get the first author in authors or None if empty
top_author = next(iter(country.authors), None)


the problem with this approach is that the memory footprint could get very 
big if you have lots of objects per group. In my cases I was always able to 
filter them down to several objects only, so it was not an issue. 

However, thanks to the new staff that come with Django 1.11, now its 
actually possible to build a real greatest-per-group query with the ORM.
This can be done using the new Subquery 

 
and OuterRef 

 
classess. In your case it must be something like this:

authors = Author.objects.filter(
book__pubdate=Subquery(
(Author.objects
.filter(country=OuterRef('country'))
.values('country')
.annotate(max_date=Max('book_set__pubdate'))
.values('max_date')[:1]
)
)
)

But be careful with this approach, because if you have more than one 
maximum from a group, you get all in of them in return.

PS. I've just recently just found out the 2nd approach, its not very clear 
from the docs that it possible, maybe we can/need document it? This is a 
common problem and may be useful to people.



On Saturday, May 13, 2017 at 6:35:32 PM UTC+3, Bernd Wechner wrote:
>
> I'm bamboozled by Django aggregation:
>
> https://docs.djangoproject.com/en/1.11/topics/db/aggregation/
>
> I'd like to add a little to the example they present to clarify my problem 
> (keeping it in familiar territory with regards to the documentation):
>
> from django.db import models
> class Author(models.Model):
> name = models.CharField(max_length=100)
> age = models.IntegerField()country = models.ForeignKey('Country') 
> class Country(models.Model):
> name = models.CharField(max_length=100)
> class Publisher(models.Model):
> name = models.CharField(max_length=300)
> num_awards = models.IntegerField()
> class Book(models.Model):
> name = models.CharField(max_length=300)
> pages = models.IntegerField()
> price = models.DecimalField(max_digits=10, decimal_places=2)
> rating = models.FloatField()
> authors = models.ManyToManyField(Author)
> publisher = models.ForeignKey(Publisher)
> pubdate = models.DateField()
> class Store(models.Model):
> name = models.CharField(max_length=300)
> books = models.ManyToManyField(Book)
> registered_users = models.PositiveIntegerField()
>
>
> I'd like to list the name and age of the (one) author in each country that 
> published the last book before a given date. 
>
> Ostensibly the only option I have is:
>
> LatestAuthors = 
> Author.objects.filter(book_set__pubdate__lte=SOMEDATE).values('country').annotate(Max('book_set__pubdate'))
>
> That seems to work generating a query that authors are selected Grouped By 
> country and selecting the Maximum book pubdate ... but alas the queryset is 
> not a set of author objects it is a set of dictionaries that only contain 
> "country", I have no access to the authors name or age!
>
> It seems the values() method is overloaded, and used to both select the 
> values that are in the SELECT and the values that are in the GROUP BY 
> clause of the generated query.
>
> I would like select all the fields of Author but group by only Country.
>
> So that I could for example list the name and age of the most recently 
> published author in each country.
>
> I've read the docs at length and the evidence seems to suggest such an 
> overloading alas, and that I may need to write SQL!
>
> But I would like to think my ignorance is great enough that a better 
> solution exists, to select * on Author while group by Author.country.
>
> If I leave the values clause out, I get multiple Authors listed per 
> country (it is not grouped by country), but I get a set of au

django install

2017-05-13 Thread Dwaine Zeringue
pip install Django in interpreter (via windows command prompt) continuously 
results in syntax errors, specifically, file line 1 pip install django 
""

Could anyone guide me in installing a python/Django environment on windows 

-- 
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/d59b939d-d5dd-4c12-b5e2-ef5a3002de93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels: Multiple 'send' calls in the same consumer

2017-05-13 Thread Andrew Godwin
Hi Tristan,

All messages sent from a consumer are delayed for sending until the
consumer exits to keep things atomic - long-running consumers is bad for
performance, as they'll hog an entire thread (they run synchronously) and
so you'll quickly run out of threads/processes as you'll end up using one
per connection.

Instead, you should do your task and exit out of the consumer as quickly as
possible to free the worker space for something else to run. To achieve
repeated execution with delays, you can either look at the delay server (
http://channels.readthedocs.io/en/stable/delay.html) or write your own
consumer code that talks to channels that uses an asynchronous framework
(asyncio, twisted)

Andrew

On Sat, May 13, 2017 at 11:29 AM, Tristan Barry 
wrote:

> Hi - I'm working with Django Channels (1.1.3) on a Django project and I
> have some questions about how to send multiple messages from the same
> consumer.
>
> The idea is the consumer will receive a request to do some work, and will
> send incremental results back to user. I've attached a simplified example
> below with some questions. I'm hoping someone can steer me in the right
> direction.
>
>
> Django Channels:
>
>>
>> def do_some_work(message):
>> for i in range(3):
>> time.sleep(2)
>> message.reply_channel.send({"text": 'Finished work ' + str(i)})
>>
>> def ws_connect(message):
>> message.reply_channel.send({"accept": True})
>>
>> channel_routing = [
>> route('websocket.connect', ws_connect),
>> route('websocket.receive', do_some_work, path=r'/todo')
>> ]
>
>
> Javascript (borrowed mostly from the docs):
>
> socket = new WebSocket("ws://" + window.location.host + "/todo/");
>> socket.onmessage = function(e) {
>> console.log(e.data);
>> }
>> socket.onopen = function() {
>> socket.send("hello world");
>> }
>> // Call onopen directly if socket is already open
>> if (socket.readyState == WebSocket.OPEN) socket.onopen();
>
>
>
> Expected results: Every two seconds the browser would receive a reply from
> the consumer saying 'Finished work x'.
>
> What I observe is a delay for ~6 seconds and then all results returned at
> the same time. Are the response on the reply channel blocked somehow? Is
> there I way I can yield, or release the message before doing the next
> increment of work?
>
> I've also tried setting up a new consumer that *only* replies via a
> Group. So instead of *message.reply_channel.send, *I would 
> *Channel('reply-channel').send({results:
> ...})* and have a new consumer defined on channel_routing for the
> *'reply-channel'*. But the results are the same - all the 'work' is
> completed before the browser receives a response.
>
> Any hints on how to send multiple message in the same consumer?
>
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/4bf7d2ce-9a13-4f85-9933-cb8496e1f59d%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/CAFwN1uox6xjZ6M_QaORCoNn0sQnCvTq-yCbzp4nfXGxK68xvHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: what kind of question i can ask here?

2017-05-13 Thread shahab emami
thanks
every time that i wanted to ask question i was worried .
i thought  maybe this is simple question and i don't have to ask this in 
this professional group 

On Saturday, May 13, 2017 at 5:19:14 PM UTC+4:30, shahab emami wrote:
>
> hello
>
> when i get a problem in my code i search for it in google for an hour if i 
> couldn't find the answer then i ask my question here.
> is this good?
> I mean can i ask my programming questions here?
> or this group is just for bugs and stuff like that?
>
> 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/f947a0bd-94fe-4b90-9300-0a017f723a1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django install

2017-05-13 Thread Mike Dewhirst

On 14/05/2017 10:15 AM, Dwaine Zeringue wrote:
pip install Django in interpreter (via windows command prompt) 
continuously results in syntax errors, specifically, file line 1 pip 
install django ""


I have written a couple of batch files for creating a new Python/Django 
environment on Windows 8.1 and pasted them in a single Pastebin 
https://pastebin.com/fAkTRM5i


First: _cheq.bat

You need to edit this on lines:
40 - change from 35 to 36 if using Python 3.6
47 - change "py_dir" to be the Python directory (mine are both in the 
root of C:)

49 - change "env" to the name of your environments parent dir
51 - change "batdir" to your batchfile directory and make sure it is on 
the Windows path

108 to 111 - change to suit your install requirements
113 - change if you changed 40
114 & 115 need to be downloaded ahead of time or commented out
119 & 120 ditto if using Python 2.7

_cheq.bat will create the virtual environment and write out the 
requirements files ready for pip in the second batch file to install 
everything


Execute _cheq.bat in a non-privileged ordinary command prompt with two 
arguments being the  and 


Second: _cheq_req.bat

This must be executed with the same two arguments you gave _cheq.bat. It 
will read the requirements created by _cheq.bat and install whatever is 
listed there.


I put an app named "common" into this batch file so you can remove that 
or edit it as you like.


Good luck

Mike



Could anyone guide me in installing a python/Django environment on 
windows

--
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/d59b939d-d5dd-4c12-b5e2-ef5a3002de93%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/608764bf-9f20-028f-a9a3-c12bfff0f382%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: django install

2017-05-13 Thread Mike Dewhirst

On 14/05/2017 3:39 PM, Mike Dewhirst wrote:

On 14/05/2017 10:15 AM, Dwaine Zeringue wrote:
pip install Django in interpreter (via windows command prompt) 
continuously results in syntax errors, specifically, file line 1 pip 
install django ""


I have written a couple of batch files for creating a new 
Python/Django environment on Windows 8.1 and pasted them in a single 
Pastebin https://pastebin.com/fAkTRM5i


Ignore the first batch file in that pastebin. The second (_cheq_req.bat) 
one is good.


Here is the replacement for the first one ...

https://pastebin.com/dnQCbYG4

I edited a couple of lines to make it match my instructions below ;)

Cheers

Mike



First: _cheq.bat

You need to edit this on lines:
40 - change from 35 to 36 if using Python 3.6
47 - change "py_dir" to be the Python directory (mine are both in the 
root of C:)

49 - change "env" to the name of your environments parent dir
51 - change "batdir" to your batchfile directory and make sure it is 
on the Windows path

108 to 111 - change to suit your install requirements
113 - change if you changed 40
114 & 115 need to be downloaded ahead of time or commented out
119 & 120 ditto if using Python 2.7

_cheq.bat will create the virtual environment and write out the 
requirements files ready for pip in the second batch file to install 
everything


Execute _cheq.bat in a non-privileged ordinary command prompt with two 
arguments being the  and 


Second: _cheq_req.bat

This must be executed with the same two arguments you gave _cheq.bat. 
It will read the requirements created by _cheq.bat and install 
whatever is listed there.


I put an app named "common" into this batch file so you can remove 
that or edit it as you like.


Good luck

Mike



Could anyone guide me in installing a python/Django environment on 
windows

--
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/d59b939d-d5dd-4c12-b5e2-ef5a3002de93%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/40e760c4-0531-0d55-e122-1f7e24280772%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.