Re: Where is django-admin?

2017-05-01 Thread Pelle Pälsänger
Yes, I have done that and made (myvenv) 
C:\Users\stig\djangogirls\myvenv\Scripts>django-admin.py startproject 
mysite . , but no djangogirls\mysite created.
My django-admin looks like below. Maybe something should be added to make 
it work?

#!c:\users\stig\djangogirls\myvenv\scripts\python.exe
from django.core import management

if __name__ == "__main__":
management.execute_from_command_line()



Den fredag 28 april 2017 kl. 15:12:15 UTC+2 skrev shahab emami:
>
> then you have to open your command line in the same path that 
> django-admin.py is.
>
>
> On Friday, April 28, 2017 at 3:39:04 PM UTC+4:30, Pelle Pälsänger wrote:
>>
>> Yes I know where django-admin.py is. I 
>> put C:\Users\stig\djangogirls\myvenv\Scripts in my path. 
>> BR,
>> Stig
>>
>>
>>
>> Den torsdag 27 april 2017 kl. 15:22:13 UTC+2 skrev Pelle Pälsänger:
>>>
>>> Hi!
>>>
>>> I try to learn how to create web apps with django on windows10. 
>>> I have downloaded django1.11 ($git clone 
>>> https://github.com/django/django.git) and installed it ($py -m pip 
>>> install Django==1.11).
>>> I follow 
>>> https://pythonprogramming.net/django-web-development-with-python-intro/
>>>
>>> Then I try to start a project with django-admin startproject mySite, but 
>>> django-admin is not recognized as a command. I search for django-admin but 
>>> I cannot find it. Tell me why? Where should I find it, to add it to path!?
>>>
>>> BR. Pelle
>>>
>>

-- 
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/6a9cafbf-af94-49df-b865-48a0246e6e4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generating HDF5 and downloading

2017-05-01 Thread Antonis Christofides
Hi,

Please show the full traceback.

Antonis Christofides
http://djangodeployment.com

On 2017-04-29 01:38, avill...@ucsc.edu wrote:
> Hi everybody, 
>
> I've successfully gotten a web app that takes user data, uses that to make a
> query, and the outputs a CSV file. However, what I'd really like is to output
> an HDF5 file. I googled around and there doesn't seem to be any documentation
> on outputting an HD5F file from a Django web app. I tried adapting the Django
> example of outputting a PDF
> (https://docs.djangoproject.com/en/1.10/howto/outputting-pdf/) like this,
>
>
> I'm making a website using the Django framework. I've successfully gotten a
> web app that takes user data, uses that to make a query, and the outputs a CSV
> file. However, what I'd really like is to output an HDF5 file. I googled
> around and there doesn't seem to be any documentation on outputting an HD5F
> file from a Django web app. I tried adapting the Django example of outputting
> a PDF (https://docs.djangoproject.com/en/1.10/howto/outputting-pdf/) like 
> this,
>
> |response
> =HttpResponse(content_type='application/hdf5')response['Content-Disposition']='attachment;
> filename="test.hdf5"'h
> =h5py.File(response)h.create_dataset('Name',data=test[0].name)|
>
>
> but I get the following error, 
>
> 'HttpResponse' object has no attribute 'encode'
>
>
>
> So I guess I'm misunderstanding how to use content_type in Django's
> HttpResponse. Does anybody have any experience with outputting HDF5 files form
> a Django web app or could help clarify how I might adapt the HttpResponse to
> work with HDF5?
>
>  
> -- 
> 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/44223100-ac75-4b12-818e-15c9b464bbab%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/55e76e15-4b85-68d2-dd6e-737f6e8c1b33%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: port 80 **** Hit EOF while fetching headers

2017-05-01 Thread Antonis Christofides
Hi,

With an average of 150 requests per second, it is likely that your server is
overloaded. You need to examine the available memory and CPU usage.

Regards,

A.

Antonis Christofides
http://djangodeployment.com

On 2017-05-01 22:53, zhenwuhe0...@gmail.com wrote:
>
> Hi, Experts:
>
> We built our system using apache + django and we have lots of clients sending
> updates to our backend server at around 1min interval. But we do have 9000
> around devices. From time to time, we are seeing port 80  Hit EOF while
> fetching headers in apache log or 500 error, could anybody tell me what does
> this mean and what maybe the possible reason to cause this? or any suggestion
> what I could do to isolate what cause this issue.
>
> 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/5072b5af-5f78-4b75-83af-70da26bff125%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/0c3a967a-07d0-13b8-debc-66a3913c3696%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: about tutorial "app reusable section" issue

2017-05-01 Thread 'Abraham Varricatt' via Django users
Hello Xuanbei,

You are most likely getting that erro because you still have 'polls' 
mentioned inside INSTALLED_APPS within your settings.py file. 

On a different note, can you link to the tutorial you are following? I 
don't recall the official django tutorial instructing to install polls via 
pip. Instead, the tutorial teaches you to build the polls app.

Yours,
Abraham V.


On Sunday, April 30, 2017 at 10:20:34 AM UTC-4, Xuanbei Lu wrote:
>
> Hi Django experts,
>
> I'm new to django. I followed up the tutorial and everything is right on 
> the way until the re-use app section. According to the tutorial, after 
> packaging and installing the polls app using pip, I removed the directory 
> 'polls' in 'mysite'. Then when I try to run "python manage.py runserver", 
> it reported error as "No module named 'polls'". I just do exactly the 
> same things as the tutorial said, could any one share me with some 
> experience about the root cause?
>
> thank you in advance!!
>
> xuanbei
>

-- 
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/e23ebfd4-16e4-4a46-a103-698d9e61db6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Make a separate table for a model without additional fields

2017-05-01 Thread Vijay Khemlani
Why do you need an additional model for automatic payments?

I don't know the whole project, but I would just add a field to the
Payment class



On 5/1/17, Victor Porton  wrote:
> I store into the DB payments received through PayPal. Every payment is
> either manual or automatic (automatic payments are done for the user by
> PayPal automatically, based on user's permission to pay in the future). I
> wish to distinguish manual and automatic payments in the DB. But in the
> following code both regular payments and automatic payments share the same
> table, so that they cannot be distinguished. I ask for an advice how to
> make them distinct in the DB. The best thing I invented insofar is to add
> `dummy = models.SmallIntegerField()` to AutomaticPayment class, to allocate
>
> a new table for it. Are there better ways?
>
> class Payment(models.Model):
> transaction = models.OneToOneField('BaseTransaction')
> email = models.EmailField(null=True)
>
> class AutomaticPayment(Payment):
> pass
>
> By the way, it is an open source project, so you will benefit from my work.
>
> --
> 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/2e6e83b6-616a-4fc8-9abc-32d2ce25e247%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/CALn3ei0ERr8kmX1keQ2sAo44qj8toZrPNDakNkxLAxSATAEWuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Make a separate table for a model without additional fields

2017-05-01 Thread Victor Porton
I store into the DB payments received through PayPal. Every payment is 
either manual or automatic (automatic payments are done for the user by 
PayPal automatically, based on user's permission to pay in the future). I 
wish to distinguish manual and automatic payments in the DB. But in the 
following code both regular payments and automatic payments share the same 
table, so that they cannot be distinguished. I ask for an advice how to 
make them distinct in the DB. The best thing I invented insofar is to add 
`dummy = models.SmallIntegerField()` to AutomaticPayment class, to allocate 
a new table for it. Are there better ways?

class Payment(models.Model):
transaction = models.OneToOneField('BaseTransaction')
email = models.EmailField(null=True)

class AutomaticPayment(Payment):
pass

By the way, it is an open source project, so you will benefit from my work.

-- 
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/2e6e83b6-616a-4fc8-9abc-32d2ce25e247%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django feedback

2017-05-01 Thread Mark Phillips
Can you successfully send an email from the command line on your server?
You need to be able to do that in order to send email from django.

Mark

On Mon, May 1, 2017 at 1:52 PM, Melvyn Sopacua 
wrote:

> On Monday 01 May 2017 13:47:10 goskoomer tarasenko wrote:
>
> > The third day I suffer with the form of feedback
>
>
>
> Did you configure the settings related to EMAIL_
> ?
>
> --
>
> Melvyn Sopacua
>
> --
> 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/1638308.yg1vNf3uZR%40devstation
> 
> .
>
> 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/CAEqej2OexNTxfvN0_P2jjgP7_2uu5x5sPdXV86QwtdQ3%3D6-ZLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels App Design

2017-05-01 Thread Ethan Knapp
Thanks Andrew! I'm glad I'm not the only guy out there with a similar 
problem. I'll have to look into the feasibility of the database approach, 
but I'm not sure if it will be efficient enough - I have some data points 
that require faster resolution than every second.

On Friday, April 28, 2017 at 6:23:41 PM UTC-6, Andrew Godwin wrote:
>
> Hi Ethan,
>
> Distributed collaboration is kind of a generally unsolved problem, so 
> there's no real best approach for what you have here. Having each 
> environment assigned to a single process (worker) definitely helps keep 
> things in shape, and if it's working for you, then I'd keep going with it.
>
> My personal approach would be to instead use a database and log every 
> change to an environment in an append-only format to that database, sending 
> signals on each change that prompts updates to be sent down to clients, 
> which can then be batched by querying the database based on revision number 
> (if the environments are small enough they can be stored on a single 
> server). This has the advantage that you can just "queue up" update 
> transmissions and send them less often (maybe once a second) rather than 
> every change, as you can just keep track of what the last revision each 
> client saw was and send them anything newer. I'm not quite sure if I'd use 
> a sorted set in Redis for this or just a postgres table (probably the 
> latter, with good indexes?)
>
> You might want to do some research into the mechanisms that power things 
> like Google Docs collaborative editing; this is a similar type of problem. 
> Certainly, using sessions for this kind of heavy lifting will be expensive 
> to run.
>
> Andrew
>
> On Fri, Apr 28, 2017 at 10:23 AM, Ethan Knapp  > wrote:
>
>> As background, I am developing a web app that implements Channels in what 
>> seems like an unusual way, so I want to do some validation and ask some 
>> opinions and suggestions. The application allows multiple users to work 
>> together in the same 3D environment (using Three.js on the client), being 
>> able to see each other and work together on the model.
>>
>> I have established that keeping some data regarding the group of users 
>> stored in active memory on the app server is necessary. My initial thought 
>> was to create a Session object that tied into a Channels Group, but even 
>> with a Redis session backend, I can see that becoming very inefficient to 
>> request and hydrate the session out of Redis for *every* message 
>> received from a client WebSocket (Is this assertion correct?). My current 
>> implementation uses a custom Worker that can be assigned multiple groups of 
>> users (each group hereafter called an Environment). An instance of an 
>> Environment is only ever handled by one Worker, while a Worker can handle 
>> multiple Environments. A consumer within a normal Django-Channels app 
>> accepts messages on *websocket.connect, websocket.receive, 
>> websocket.disconnect*, and forwards them to the appropriate worker (each 
>> worker is assigned a unique channel), where the worker decides which 
>> Environment the message was intended for, and passes it. The Environment 
>> may then do whatever it needs to, including return a reply message to send 
>> back to the client via WebSocket (directly to the interface server via 
>> reply_channel).
>>
>> My question is: "Is this the best design, or should I consider something 
>> else?" I am unsure of whether having one Channel per Worker is ideal, or if 
>> I should just give each Environment a unique channel (my idea here is that 
>> I only need to receive once per worker instead of n times). I also may need 
>> to give each Environment a tick loop beyond just responding to Channels 
>> events (likely, but undetermined) (honestly it's starting to feel more like 
>> a game/game server pair than a web app! [Considerations of a Java backend 
>> here?]). Also, does this fall within the use of Channels, or should I 
>> seriously consider using something like RabbitMQ directly, instead of 
>> possibly just using it as a Channels backend?
>>
>> Thanks in advance for any advice or thoughts!
>> Ethan
>>
>> -- 
>> 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/35e1bed1-c2ce-456f-8770-f9eca719dd50%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 us

Re: Django feedback

2017-05-01 Thread Melvyn Sopacua
On Monday 01 May 2017 13:47:10 goskoomer tarasenko 
wrote:
> The third day I suffer with the form of feedback

Did you configure the settings related to EMAIL_[1]?
-- 
Melvyn Sopacua


[1] 
https://docs.djangoproject.com/en/1.11/ref/settings/#email-backend

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


Django feedback

2017-05-01 Thread goskoomer tarasenko
The third day I suffer with the form of feedback, here is the link to the 
code, tell me where the error is. Although in pycharm it shows that the 
sending goes to the post office and the mail does not receive a message

from django.shortcuts import render
from django import forms
from django.http import HttpResponse
from django.core.mail import send_mail, BadHeaderError
import smtplib

def test_project(request):
return render(request, 'test/home.html', locals())
def contactView(request):
   if request.method == 'POST':
  form = ContactForm(request.POST)
  #Если форма заполнена корректно,



class ContactForm(forms.Form):
   subject = forms.CharField(max_length = 100)
   sender = forms.EmailField()
   message = forms.CharField(widget = forms.Textarea(attrs = {'class': 
'form-control'}))
   copy = forms.BooleanField(required = False)

def contactView(request):
   if request.method == 'POST':
  form = ContactForm(request.POST)
  #Если форма заполнена корректно, сохраняем все введённые пользователем 
значения
  if form.is_valid():
 subject = form.cleaned_data['subject']
 sender = form.cleaned_data['sender']
 message = form.cleaned_data['message']
 copy = form.cleaned_data['copy']

 recipients = ['goskoo...@gmail.com']
 #Если пользователь захотел получить копию себе, добавляем его в список 
получателей
 if copy:
recipients.append(sender)
 try:
send_mail(subject, message, 'goskoo...@gmail.com', recipients)
 except BadHeaderError: #Защита от уязвимости
return HttpResponse('Invalid header found')
 #Переходим на другую страницу, если сообщение отправлено
 return render(request, 'contact.html')
   else:
  #Заполняем форму
  form = ContactForm()
   #Отправляем форму на страницу
   return render(request, 'home.html', {'form': form})



{% load staticfiles %}




Contact Me







{% csrf_token %}
{{ form.non_field_errors }}


 Тема:
{{ form.subject.errors }}
{{ form.subject }}






Email Address
 {{ form.sender.errors }}
 {{ form.sender }}






Phone Number






Message
{{ form.message.errors }}
   {{ form.message }}








Send














-- 
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/f6baa158-2f5a-46c4-a0fc-76fa82a94258%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


port 80 **** Hit EOF while fetching headers

2017-05-01 Thread zhenwuhe0611

Hi, Experts:

We built our system using apache + django and we have lots of clients 
sending updates to our backend server at around 1min interval. But we do 
have 9000 around devices. From time to time, we are seeing port 80  Hit 
EOF while fetching headers in apache log or 500 error, could anybody tell 
me what does this mean and what maybe the possible reason to cause this? or 
any suggestion what I could do to isolate what cause this issue.

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/5072b5af-5f78-4b75-83af-70da26bff125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Sass verwenden

2017-05-01 Thread Jonas Niedermair
Ich habe vor einiger Zeit begonnen Django zu lernen. Bisher habe ich immer 
direkt CSS verwendet. Ich möchte jedoch Sass verwenden, weiß jedoch nicht 
wo ich die Sass Dateien in meinem Django Projekt speichern soll und wie ich 
die Sass Datein am besten in CSS konvertieren kann. 

Ich habe bereits versucht mit Pipeline die Sass Dateien in CSS zu 
konvertieren. Das hat auch funktioniert, aber wie schaffe ich es dass die 
CSS Dateien nicht nur im static Ordner des Projektordners sondern im static 
Ordner der jeweiligen App gespeichert werden ?

Ich hoffe ihr könnt mir weiterhelfen

-- 
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/933a2ef5-2a30-493f-be56-12e77a90a073%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error was: cannot import name 'GDALRaster in Window 8.1

2017-05-01 Thread Tim Graham
It looks like GDAL isn't installed on your system.

Looking at 
https://docs.djangoproject.com/en/stable/ref/contrib/gis/install/#spatial-database,
 
I believe it's a required dependency -- perhaps we should try to improve 
the error message.

On Sunday, April 30, 2017 at 10:20:01 AM UTC-4, Prashant Verma wrote:
>
> C:\User\.\Desktop\Geolocation>*python manage.py makemigrations*
> Traceback (most recent call last):
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\utils.py",
>  
> line 115, in load_backend
> return import_module('%s.base' % backend_name)
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\importlib\__init__.py",
>  
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 978, in _gcd_import
>   File "", line 961, in _find_and_load
>   File "", line 950, in 
> _find_and_load_unlocked
>   File "", line 655, in _load_unlocked
>   File "", line 677, in exec_module
>   File "", line 205, in 
> _call_with_frames_removed
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\gis\db\backends\postgis\base.py",
>  
> line 7, in 
> from .operations import PostGISOperations
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\gis\db\backends\postgis\operations.py",
>  
> line 7, in 
> from django.contrib.gis.gdal import GDALRaster
> ImportError: cannot import name 'GDALRaster'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\core\management\__init__.py",
>  
> line 363, in execute_from_command_line
> utility.execute()
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\core\management\__init__.py",
>  
> line 337, in execute
> django.setup()
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\__init__.py",
>  
> line 27, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\apps\registry.py",
>  
> line 108, in populate
> app_config.import_models()
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\apps\config.py",
>  
> line 202, in import_models
> self.models_module = import_module(models_module_name)
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\importlib\__init__.py",
>  
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 978, in _gcd_import
>   File "", line 961, in _find_and_load
>   File "", line 950, in 
> _find_and_load_unlocked
>   File "", line 655, in _load_unlocked
>   File "", line 677, in exec_module
>   File "", line 205, in 
> _call_with_frames_removed
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\auth\models.py",
>  
> line 4, in 
> from django.contrib.auth.base_user import AbstractBaseUser, 
> BaseUserManager
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\auth\base_user.py",
>  
> line 52, in 
> class AbstractBaseUser(models.Model):
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\base.py",
>  
> line 124, in __new__
> new_class.add_to_class('_meta', Options(meta, app_label))
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\base.py",
>  
> line 330, in add_to_class
> value.contribute_to_class(cls, name)
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\options.py",
>  
> line 214, in contribute_to_class
> self.db_table = truncate_name(self.db_table, 
> connection.ops.max_name_length())
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\__init__.py",
>  
> line 33, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\utils.py",
>  
> line 211, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File 
> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\utils.py",
>  
> line 134, in load_backend
> raise ImproperlyConfigured(error_msg)
> django.core.exceptions.ImproperlyConfigured: 
> 'django.contrib.gis.db.backends.postgis' isn't an available database 
> backend.
> Try using 'django.db.backends.XXX', where XXX is one of:
> 'mysql', 'oracle', 'postgresql', 'sqlite3'
> Error was: cannot import name 'GDALRaster'
>
>

-- 
You received this message because y

Different models in child and Parent Templates

2017-05-01 Thread chuck . horowitz
Please be more specific about your issue.  How are you rendering your 
templates?  Can you paste into a response your views.py and urls.py for the 
relevant apps?

-- 
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/d627fcc2-b94f-4105-9cf2-a095c75c4507%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django package boilerplate.

2017-05-01 Thread Andréas Kühne
If you opensource it and host the code on github - you can easily setup
travis ci for free.

https://docs.travis-ci.com/user/languages/python/

Med vänliga hälsningar,

Andréas

2017-05-01 17:18 GMT+02:00 Frederik Creemers :

> I've got a few utilities in my app that I think could be useful to share
> as open source projects, but I'm putting it off because I'd have to set up
> CI for multiple Python/Django versions and other boilerplate. Is there a
> boilerplate repository for sometHing like this out there that I can ust put
> my code into, and configure to run my tests?
>
> --
> 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/35989d42-1cd6-4f01-bdc3-25df534a9333%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/CAK4qSCfJU5NGRXokQAfOVoNB3UW%3DNXE0MyinNXB%3DW0hvuBO0Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch

2017-05-01 Thread Melvyn Sopacua
On Friday 28 April 2017 14:08:05 Will Holmes wrote:

> django.urls.exceptions.NoReverseMatch: Reverse for 
'delete_event' with
> arguments '('',)' 

This tells you that id is not handed to the template that 
renders the view containing this form. Otherwise, arguments 
would be '('123456',)'.

-- 
Melvyn Sopacua

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


Re: NoReverseMatch

2017-05-01 Thread Melvyn Sopacua
On Friday 28 April 2017 16:31:57 shahab emami wrote:

> your url must be like this:
> 
> url(r'^events/((?P\d+))/delete/$', views.delete_event, 
name=
> 'delete_event'),

No, it MUST not. That just changes the problem from args to 
kwargs.

-- 
Melvyn Sopacua

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


Django package boilerplate.

2017-05-01 Thread Frederik Creemers
I've got a few utilities in my app that I think could be useful to share as 
open source projects, but I'm putting it off because I'd have to set up CI 
for multiple Python/Django versions and other boilerplate. Is there a 
boilerplate repository for sometHing like this out there that I can ust put 
my code into, and configure to run my tests?

-- 
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/35989d42-1cd6-4f01-bdc3-25df534a9333%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Split an existing app up into multiple apps.

2017-05-01 Thread Frederik Creemers
Hi.

Is there a guide on how to split up an existing Django app into multiple 
apps?

When I created my project, I foolishly created an app called "common". 
Generic names like that attract all sorts of functionality, and now I think 
it'd be a good idea to split it up.

-- 
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/246aea76-d332-4ed0-a33f-a92a2891c070%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial | sqlmigrate command ending in error

2017-05-01 Thread Nikhil Reddy
Ok..Sorry about that. 

I haven't done any modifications to  polls/migrations/0001_initial.py or 
settings files that got created by default.  I've attached both files.
Please review.

Thanks,
NJ

On Sunday, 30 April 2017 19:30:28 UTC+5:30, Daniel Roseman wrote:
>
> You haven't given nearly enough information to help you. You need at least 
> to post the contents of your polls/migrations/0001_initial.py, and your 
> DATABASES settings.
> -- 
> 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/6005d7e0-9c5a-46d2-a90f-9dab05dfe0e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-20 12:25
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Choice',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('choice_text', models.CharField(max_length=200)),
('votes', models.IntegerField(default=0)),
],
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('question_text', models.CharField(max_length=200)),
('pub_date', models.DateTimeField(verbose_name='date published')),
],
),
migrations.AddField(
model_name='choice',
name='question',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Question'),
),
]
"""
Django settings for mysite project.

Generated by 'django-admin startproject' using Django 1.10.6.

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

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

import os

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


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '&ln@$f-g66pp0*i_dhc_qhxh+0_1@q3n4(o%mdm9#*kd*ktssl'

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

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'mysite.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'mysite.wsgi.application'


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

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


# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'd

Re: Django Tutorial | sqlmigrate command ending in error

2017-05-01 Thread Dilraj sachdev

By this limited information, just guessing could be a problem with path of 
sqlite db file

D

On Friday, 21 April 2017 14:10:43 UTC+1, Nikhil Reddy wrote:
>
> Hi,
>
> I am going through this tutorial 
> . When I execute 
> the command: "python manage.py sqlmigrate polls 0001" it is ending in below 
> error.
>
> Please help resolve the issue.
>
>
> *Error:*
>
> Traceback (most recent call last):
>   File "manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/__init__.py",
>  line 363, in execute_from_command_line
> utility.execute()
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/__init__.py",
>  line 355, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/base.py",
>  line 283, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/commands/sqlmigrate.py",
>  line 33, in execute
> return super(Command, self).execute(*args, **options)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/base.py",
>  line 330, in execute
> output = self.handle(*args, **options)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/commands/sqlmigrate.py",
>  line 62, in handle
> sql_statements = executor.collect_sql(plan)
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/db/migrations/executor.py",
>  line 219, in collect_sql
> with self.connection.schema_editor(collect_sql=True, 
> atomic=migration.atomic) as schema_editor:
>   File 
> "/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py",
>  line 25, in __enter__
> self._initial_pragma_fk = c.fetchone()[0]
> TypeError: 'NoneType' object has no attribute '__getitem__'
>
>
> *Versions:*
>
> Python 2.7.13
>
> Django 1.11
>
> sqlite3 2.6.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/119c18a1-4a14-4a5c-8a1c-0813cc874ccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Different models in child and Parent Templates

2017-05-01 Thread jithu s jacob
I am using parent template as base which has a side nav bar. the child 
template keeps changing with clicking of buttons.
 
My child template changes correctly with call to different views through 
the URLs.

Now I want to add some data from model i the parent template irrespective 
of the view/model  or URL being called in the child template.

is there any easy was to do this.

for now I am writing additional context variables for parent template for 
all the child views. But this is not feasible

-- 
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/1f158305-4841-49ff-b2c8-9e2352418283%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.