Re: Django session question.

2013-12-25 Thread Daniel Roseman
Did you Google "Django sessions" before posting? Or even look on the Django 
documentation index for any page entitled "sessions", such as this one:
https://docs.djangoproject.com/en/1.6/topics/http/sessions/
?
--
DR.


On Tuesday, 24 December 2013 22:30:08 UTC, Chen Xu wrote:
>
> I am working on a voting website, basically i want to be able to track the 
> votes that come from the same person, or the same session, I am wondering 
> does Django have some kinda built in session implementation that I can use 
> to track people 's actions in the same session?
>
> Thanks in advance
>
> -- 
> ⚡ Chen Xu ⚡ 
>

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


django-pybbm poll

2013-12-25 Thread Hervé Edorh
hi,
I am using pybbm app like forum in my django application.When i want to 
create new topic, it asks me to write in poll form, i want to remove poll 
form. 

how can i remove it?

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


Re: Need Direction for Web App

2013-12-25 Thread Tom Lockhart

On 2013-12-24, at 4:55 PM, zobcl...@gmail.com wrote:

> I would like to create a web app / interface to manipulate and maintain my 
> server's dhcpd.conf file. 
> Background in Short:
> I was asked a few years back to build a wifi network for approximately 500 
> users with unlimited devices. With no money (barely any money). Done. 
> The only requirement/restriction is we use MAC address filtering. So I have a 
> server, serving dhcp leases. I have to manually input each MAC address with a 
> hostname and group. This is a terrible pain. Especially for the amount of 
> users I have with unlimited devices. Christmas time is horrible because they 
> all come in wanting new devices registered. 
> I do have, at least, a web form through google which updates an excel sheet 
> in google docs, which I then access, copy the MAC address, then using my 
> server gui, add the new MAC to the dhcpd.conf file and restart the server. 
> What I've done & What my hope is:
> I have started the Django tutorial. I have dabbled with python. I am an 
> enthusiast in training. I have very little to no experience. I can learn. 
> Fast. I am just running into branches of "things to learn" and it's starting 
> to be a little overwhelming. 
> I hope to do the lion's share of creating a web app that will do the 
> following:
> 
> 1. Register a user using sqlite3 database I have already created for all 
> users. 
> 2. Authenticate a user
> 3. Provide a display of registered devices for user to either delete or not 
> delete
> 4. Provide a form to register a new device(s)
> 5. submit request, append to dhcpd.conf & restart dhcp server 

I would use one of the Django CMS apps as a starting point (I've had good 
experiences with Mezzanine and I'm sure other ones would work). For example, 
Mezzanine out of the box can give you a blog for a home page (so you can post, 
say, status updates), user authentication, and other pieces you may not use 
right away but are available when you want them. You can also put these 
together individually from Django components and other available apps, but 
afaict that is almost guaranteed to be a bit more work.

Finish working through the Django tutorial, since that will introduce you to 
the building blocks.

Start your project by defining the schema in your new app with your own 
models.py underneath your new project. That will almost immediately give you an 
admin interface to play with your schema.

Think about using Postgres for the database.

You should be able to export your current spreadsheet and then perhaps read it 
into a python program and out into your database. Or you might be able to 
import it directly into a single table then use raw SQL to push the data around 
into the schema you need. You mentioned that you already have database content 
for users in sqlite; not sure what that schema looks like but although Django 
has enough hooks to map most existing schemas to the Django ORM, you might find 
it cleaner and more maintainable to define your schema in Django and then 
convert your existing tables over to it (they are likely to be very similar, 
and you may be able to do it with some raw SQL).

You will find that asking very specific questions on this mailing list will be 
more likely to get a response, so as you go along feel free to do so. Search 
first for the answer though; you will find a lot of questions have already been 
answered and come up in google.

hth

 - Tom

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


Re: Can't Install on Windows 8.1

2013-12-25 Thread Malik Rumi
Ok, everything went smoothly and beautifully as promised. I got successful 
install messages for pip, distribute, virtualenv and django. So first, 
thank you both very much. 

However, I seem to be stuck again. I am not sure how to get from my new 
virtualenv to django, and windows seems just as confused. When I tried 
startproject, windows suddenly wanted to know if I wanted to keep using 
python to open .py files, or use notepad or some other program? I said 
python, and then it hiccuped, like it was restarting Explorer, and the 
command line went back to the prompt with no evidence it executed the 
startproject command. I looked in the directory, but saw nothing to 
indicate there was a project started. Of course, never having worked with 
either django or virtualenv before, I could have missed it. So I tried 
again.

As before, a dialog window opened asking me what program I wanted to use. 
While I was taking a screenshot to save for these notes, the dialog went 
away and the cmd line reported back that access was denied. 

Then I tried get_version and was told there was no module named django, 
even though just a few lines earlier I was told django was successfully 
installed.

Here is that last portion from my command line window:

*C:\Program Files\Ampps\python\Scripts>project_sl1\Scripts\activate*

*(project_sl1) C:\Program Files\Ampps\python\Scripts>pip install django*

*Downloading/unpacking django*

*  Downloading Django-1.6.1.tar.gz (6.6MB): 6.6MB downloaded*

*  Running setup.py egg_info for package django*

*warning: no previously-included files matching '__pycache__' found *

*under dir*

*ectory '*'*

*warning: no previously-included files matching '*.py[co]' found *

*under direct*

*ory '*'*

*Installing collected packages: django*

*  Running setup.py install for django*

*warning: no previously-included files matching '__pycache__' found *

*under dir*

*ectory '*'*

*warning: no previously-included files matching '*.py[co]' found *

*under direct*

*ory '*'*

*Successfully installed django*

*Cleaning up...*


*(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *


*startproject*

* project_sl1*


*(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *


*startproject*

* project_sl1*

*Access is denied.*


*(project_sl1) C:\Program Files\Ampps\python\Scripts>*

Just to be clear, I do want to get past this but I also want to understand 
what is going on, so if you can do both, that would be great. Do I need to 
change directories? Try opening a django project thrui the django gui? 
Where / how would I do that? Everything I have done so far has been thru 
the windows command line. 
Thanx.
- -

On Tuesday, December 24, 2013 11:48:22 AM UTC-6, Malik Rumi wrote:
>
>  Boy, the speedy responses on this thread are great! I can't wait to get 
> home from work so I can put this advice into practice. And now you know 
> what I want for Christmas 😄 - a working installation of django and python 
> to play with. 
>  --
> From: Tom Lockhart 
> Sent: ‎12/‎24/‎2013 9:15 AM
> To: django-users@googlegroups.com
> Subject: Re: Can't Install on Windows 8.1
>
>
>  On 2013-12-24, at 6:56 AM, Malik Rumi  wrote:
>
>  Thank you. One more question before I dive in: I already have python 
> installed. Are you suggesting I remove it and start over?
>
>
> No. What you will find is that virtualenv will pick up whatever python it 
> finds and package it in a new self-contained area. At that point you will 
> have full control over what additional things get installed. But it needs a 
> python installation somewhere else to get started.
>
> If you have put a bunch of packages into your native python installation 
> and are not sure what you have, you may want to re-install just to get a 
> clean basic installation. But I haven't had to do that and would not bother 
> unless you see other issues.
>
> hth
>
> - Tom
>
>  
> On Tuesday, December 24, 2013 8:04:08 AM UTC-6, Timothy W. Cook wrote: 
>>
>>   Since it appears that you are not too familiar with Python, this may 
>> help:
>> http://www.youtube.com/watch?v=d_W02OwHa38
>>
>> Using a virtual environment and pip will a long way to solving many of 
>> your issues.   It is considered best practice 'for a reason'. 
>>
>> https://zignar.net/2012/06/17/install-python-on-windows/
>>
>> Then, install django and other requirements inside your virtualenv.
>>
>>
>>
>> HTH,
>> Tim
>>
>>
>>
>>
>> On Tue, Dec 24, 2013 at 11:35 AM, Malik Rumi  wrote:
>>
>>> Hello. This is my first post. The attached Word document tracks 
>>> everything I have done this morning to get this to work.  
>>>
>>> Your insights, guidance, and assistance is greatly appreciated. 
>>>
>>> -- 
>>> 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...@googlegroup

referencing models before syncdb

2013-12-25 Thread vinayak11118
I have an actions.py file which defines custom actions for the admin page 
for one of my models. It uses an intermediary page (like the default delete 
action) and hence has a corresponding form which is also declared in the 
same file.

For some reason, I had drop by database (development) and now when I try to 
run syncdb, it gives me the following error:


Traceback (most recent call last):
  File "/home/vinayak/pyCharm/helpers/pycharm/django_manage.py", line 23, 
in 
run_module(manage_file, None, '__main__', True)
  File "/usr/lib/python2.7/runpy.py", line 176, in run_module
fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
  File "/home/vinayak/zenatix/customuser/manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 399, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 242, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 284, in execute
self.validate()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 310, in validate
num_errors = get_validation_errors(s, app)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", 
line 34, in get_validation_errors
for (app_name, error) in get_app_errors().items():
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
196, in get_app_errors
self._populate()
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
75, in _populate
self.load_app(app_name, True)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
99, in load_app
models = import_module('%s.models' % app_name)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/models.py", 
line 63, in 
patch_root_urlconf()
  File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/models.py", 
line 51, in patch_root_urlconf
reverse('djdt:render_panel')
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
480, in reverse
app_list = resolver.app_dict[ns]
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
310, in app_dict
self._populate()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
262, in _populate
for pattern in reversed(self.url_patterns):
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
346, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
341, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File "/home/vinayak/zenatix/customuser/customuser/urls.py", line 6, in 

admin.autodiscover()
  File 
"/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py", 
line 29, in autodiscover
import_module('%s.admin' % app)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File "/home/vinayak/zenatix/customuser/iiitd/admin.py", line 3, in 

from actions import grant_read_permission
  File "/home/vinayak/zenatix/customuser/iiitd/actions.py", line 13, in 

class SelectUserForm(forms.Form):
  File "/home/vinayak/zenatix/customuser/iiitd/actions.py", line 16, in 
SelectUserForm
clientObj = ClientInfo.objects.all()[:1].get()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", 
line 301, in get
num = len(clone)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", 
line 77, in __len__
self._fetch_all()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", 
line 854, in _fetch_all
self._result_cache = list(self.iterator())
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", 
line 220, in iterator
for row in compiler.results_iter():
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", 
line 710, in results_iter
for rows in self.execute_sql(MULTI):
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler

Re: Need Direction for Web App

2013-12-25 Thread zobcloud
Thank you for your response. I will start where you suggested.

On Tuesday, December 24, 2013 7:55:37 PM UTC-5, zobc...@gmail.com wrote:
>
> I would like to create a web app / interface to manipulate and maintain my 
> server's dhcpd.conf file. 
> *Background in Short:*
> I was asked a few years back to build a wifi network for approximately 500 
> users with unlimited devices. With no money (barely any money). Done. 
> The only requirement/restriction is we use MAC address filtering. So I 
> have a server, serving dhcp leases. I have to manually input each MAC 
> address with a hostname and group. This is a terrible pain. Especially for 
> the amount of users I have with unlimited devices. Christmas time is 
> horrible because they all come in wanting new devices registered. 
> I do have, at least, a web form through google which updates an excel 
> sheet in google docs, which I then access, copy the MAC address, then using 
> my server gui, add the new MAC to the dhcpd.conf file and restart the 
> server. 
> *What I've done & What my hope is:*
> I have started the Django tutorial. I have dabbled with python. I am an 
> enthusiast in training. I have very little to no experience. I can learn. 
> Fast. I am just running into branches of "things to learn" and it's 
> starting to be a little overwhelming. 
> I hope to do the lion's share of creating a web app that will do the 
> following:
>
> 1. Register a user using sqlite3 database I have already created for all 
> users. 
> 2. Authenticate a user
> 3. Provide a display of registered devices for user to either delete or 
> not delete
> 4. Provide a form to register a new device(s)
> 5. submit request, append to dhcpd.conf & restart dhcp server 
>
> There is minutia I am not including in this *cry for help*. 
>
> This app would help me gain some distance from this monumental task. 
>
> Am I in the right place? Is there some special soul out there who wants to 
> help a fella out? 
>
> Many thanks to all who have read this.
>
> Mike Roberts
>

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


Django ModelForms - testing forms with model that have M2M inline instance using an intermediate model

2013-12-25 Thread luke lukes
I have invoice/estimates django app, I need to write tests for it. Since 
I'm a beginner with this, testing forms results hard for me.
This is the code - for models, form  and admin:

# MODELS 
class Invoice(models.Model):
subject = models.ForeignKey(
Subject,
verbose_name= _("Subject")
)
date = models.DateField(default=date.today())
tasks = models.ManyToManyField(
Task,
through='TaskCount',
)
discount = models.DecimalField(
max_digits=10, 
decimal_places=2, 
default=0
)
tip1 = models.BooleanField();
tip2 = models.BooleanField();
tax_a = models.BooleanField();
notes = models.CharField(max_length=500, blank=True)
expire = models.DateField(null=True, blank=True)
invoicenumber = models.IntegerField("Invoice number")
subtotal = models.DecimalField(max_digits=10, decimal_places=2,)
amount = models.DecimalField(max_digits=10, decimal_places=2, 
default=0)
adi_start_date = models.DateField(null=True, blank=True)
adi_end_date = models.DateField(null=True, blank=True)


class People(models.Model):
first_name = models.CharField(
"First name",max_length=50, blank=True
)
last_name = models.CharField(
"Last name",max_length=50, blank=True
)

 # other fields
def __unicode__(self):
return u"%s %s" % (self.first_name, self.last_name)

# model for inlines
class TaskCount(models.Model):
count_items = models.PositiveIntegerField("Qty", default=1)
task = models.ForeignKey(
'Task',
null=False)
estimate = models.ForeignKey(
'Estimate', 
null=True, 
blank=True
)
invoice = models.ForeignKey(
'Invoice',
related_name='task_count',
null=True,
blank=True
)

def __unicode__(self):
return u"%s" % (str(self.task.price))

class Task(models.Model):
label = models.CharField(
"Task name",
max_length=150
)
price = models.DecimalField(
"Price per session", 
max_digits=10, 
decimal_places=2,
default=0
)
is_adi = models.BooleanField(
default=False,
help_text=_("")
)



# FORMS

class InvoiceAdminForm(forms.ModelForm):
class Meta:
model = Invoice

def __init__(self, *args, **kwargs):
super(InvoiceAdminForm, self).__init__(*args, **kwargs)


# ADMIN

# inline
class TaskCountInline(admin.TabularInline):
model = TaskCount
extra = 0
fields = ('num_items', 'task')

def __init__(self, *args, **kwargs):
super(TaskCountInline, self).__init__(*args, **kwargs)

...

class InvoiceAdmin(admin.ModelAdmin):
list_display = ('subject', 'date', 'amount',
'discount', 'invoicenumber','get_pdf',
'edit_item', 'delete_item')
list_display_links = ('edit_item',)
filter_horizontal = ('tasks',)
search_fields = ['subject__first_name','subject__last_name']
actions = ['create_pdf']
inlines = (TaskCountInline,)
form = InvoiceAdminForm

fieldsets = (
 # fieldsets ovverride
)

formfield_overrides = {
models.CharField: {'widget': forms.Textarea},
}

def get_pdf(self, obj):
opts = self.model._meta
return '' \
   '' \
   '' % {
   'reverse_url':reverse(
   'admin:%s_%s_pdf' % (
opts.app_label, 
opts.object_name.lower()),
args=(obj.id,)
),
}
get_pdf.short_description = _("PDF")
get_pdf.allow_tags = True

def change_view(self, request, object_id, form_url='', 
extra_context=None):
...


def get_urls(self):
urls = super(InvoiceAdmin, self).get_urls()
info = self.model._meta.app_label, self.model._meta.module_name
extra_urls = patterns('',
url(r'^(?P\d+)/pdf/$',
self.admin_site.admin_view(self.pdf_view),
name='%s_%s_pdf' % info),
)
return extra_urls+urls

def pdf_view(self, request, object_id, extra_context=None):
"""
view for generating PDF objects
"""



def get_form(self, request, obj=None, **kwargs):
form = super(InvoiceAdmin, self).get_form(request, obj, 
**kwargs)
form.base_fields['invoicenumber'].initial 
=self.__get_last_invoice_nr_plus_one()

return form

def __get_last_invoice_nr_plus_one(self):
...


I'm trying to test th

Re: Can't Install on Windows 8.1

2013-12-25 Thread Timothy W. Cook
It has been 4 hours so just so you don't think you are being ignored.  :-)

Basically, this is why I haven't used Windows since Win98.  It wants to
take control of everything and guess at what I want.  I wish you luck in
solving your Windows issues.

It is okay for end-user apps like running a browser but I would never use
it for development.  I know that there are pepople here taht do and maybe
they can help.

Cheers,
Tim



On Wed, Dec 25, 2013 at 2:20 PM, Malik Rumi  wrote:

> Ok, everything went smoothly and beautifully as promised. I got successful
> install messages for pip, distribute, virtualenv and django. So first,
> thank you both very much.
>
> However, I seem to be stuck again. I am not sure how to get from my new
> virtualenv to django, and windows seems just as confused. When I tried
> startproject, windows suddenly wanted to know if I wanted to keep using
> python to open .py files, or use notepad or some other program? I said
> python, and then it hiccuped, like it was restarting Explorer, and the
> command line went back to the prompt with no evidence it executed the
> startproject command. I looked in the directory, but saw nothing to
> indicate there was a project started. Of course, never having worked with
> either django or virtualenv before, I could have missed it. So I tried
> again.
>
>  As before, a dialog window opened asking me what program I wanted to
> use. While I was taking a screenshot to save for these notes, the dialog
> went away and the cmd line reported back that access was denied.
>
> Then I tried get_version and was told there was no module named django,
> even though just a few lines earlier I was told django was successfully
> installed.
>
> Here is that last portion from my command line window:
>
> *C:\Program Files\Ampps\python\Scripts>project_sl1\Scripts\activate*
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>pip install django*
>
> *Downloading/unpacking django*
>
> *  Downloading Django-1.6.1.tar.gz (6.6MB): 6.6MB downloaded*
>
> *  Running setup.py egg_info for package django*
>
> *warning: no previously-included files matching '__pycache__' found *
>
> *under dir*
>
> *ectory '*'*
>
> *warning: no previously-included files matching '*.py[co]' found *
>
> *under direct*
>
> *ory '*'*
>
> *Installing collected packages: django*
>
> *  Running setup.py install for django*
>
> *warning: no previously-included files matching '__pycache__' found *
>
> *under dir*
>
> *ectory '*'*
>
> *warning: no previously-included files matching '*.py[co]' found *
>
> *under direct*
>
> *ory '*'*
>
> *Successfully installed django*
>
> *Cleaning up...*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *
>
>
> *startproject*
>
> * project_sl1*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *
>
>
> *startproject*
>
> * project_sl1*
>
> *Access is denied.*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>*
>
> Just to be clear, I do want to get past this but I also want to understand
> what is going on, so if you can do both, that would be great. Do I need to
> change directories? Try opening a django project thrui the django gui?
> Where / how would I do that? Everything I have done so far has been thru
> the windows command line.
> Thanx.
> - -
>
> On Tuesday, December 24, 2013 11:48:22 AM UTC-6, Malik Rumi wrote:
>>
>>  Boy, the speedy responses on this thread are great! I can't wait to get
>> home from work so I can put this advice into practice. And now you know
>> what I want for Christmas 😄 - a working installation of django and python
>> to play with.
>>  --
>> From: Tom Lockhart 
>> Sent: ‎12/‎24/‎2013 9:15 AM
>> To: django-users@googlegroups.com
>> Subject: Re: Can't Install on Windows 8.1
>>
>>
>>  On 2013-12-24, at 6:56 AM, Malik Rumi  wrote:
>>
>>  Thank you. One more question before I dive in: I already have python
>> installed. Are you suggesting I remove it and start over?
>>
>>
>> No. What you will find is that virtualenv will pick up whatever python it
>> finds and package it in a new self-contained area. At that point you will
>> have full control over what additional things get installed. But it needs a
>> python installation somewhere else to get started.
>>
>> If you have put a bunch of packages into your native python installation
>> and are not sure what you have, you may want to re-install just to get a
>> clean basic installation. But I haven't had to do that and would not bother
>> unless you see other issues.
>>
>> hth
>>
>> - Tom
>>
>>
>> On Tuesday, December 24, 2013 8:04:08 AM UTC-6, Timothy W. Cook wrote:
>>>
>>>   Since it appears that you are not too familiar with Python, this may
>>> help:
>>> http://www.youtube.com/watch?v=d_W02OwHa38
>>>
>>> Using a virtual environment and pip will a long way to solving many of
>>> your issues.   It is considered best practice 'for a reason'.
>>>
>>> https://zignar.net/2012/0

Re: Can't Install on Windows 8.1

2013-12-25 Thread Mike Dewhirst

On 26/12/2013 3:20am, Malik Rumi wrote:

Ok, everything went smoothly and beautifully as promised. I got
successful install messages for pip, distribute, virtualenv and django.
So first, thank you both very much.

However, I seem to be stuck again. I am not sure how to get from my new
virtualenv to django, and windows seems just as confused. When I tried
startproject, windows suddenly wanted to know if I wanted to keep using
python to open .py files, or use notepad or some other program? I said
python, and then it hiccuped, like it was restarting Explorer, and the
command line went back to the prompt with no evidence it executed the
startproject command. I looked in the directory, but saw nothing to
indicate there was a project started. Of course, never having worked
with either django or virtualenv before,


I use Windows 7 (and XP) and have not looked at Windows 8.

Windows 7 is designed for end-user operations rather than development. 
If you are developing, Microsoft expects you will be using Visual Studio 
or a competing IDE which respects the location choices made by VS.


The C:\Program files\ directory is "protected". I'm not sure what that 
means other than end-users seeing the dialog boxes you report.


I installed Python outside C:\Program files. I created a C:\usr\bin for 
that. Doing so solves the "protected" problem. My first recommendation 
is to re-install Python where you can see it.


Secondly, create your own "home" directory and avoid having anything to 
do with "My documents" for development. You can put shortcuts into "My 
documents" which will take you to whatever directories take your fancy.


The objective is to stop Windows trying to help you.

Thirdly, while Virtualenv is brilliant and solves many problems, they 
are future problems. On Windows, you cannot use VirtualenvWrapper 
because no-one has ported it to Windows. VirtualenvWrapper smoothes out 
all the Virtualenv drudgery and on Linux makes it a no-brainer. Just 
install it and start using it from the beginning as you undoubtedly 
would in future. So my recommendation is to avoid Virtualenv while you 
are a beginner and plan to implement it when you need it.


My fourth recommendation is to acquire a Linux development machine and 
plan to relocate development to it as soon as you need Virtualenv.


hth

Mike

I could have missed it. So I

tried again.

As before, a dialog window opened asking me what program I wanted to
use. While I was taking a screenshot to save for these notes, the dialog
went away and the cmd line reported back that access was denied.

Then I tried get_version and was told there was no module named django,
even though just a few lines earlier I was told django was successfully
installed.

Here is that last portion from my command line window:

/C:\Program Files\Ampps\python\Scripts>project_sl1\Scripts\activate/

/(project_sl1) C:\Program Files\Ampps\python\Scripts>pip install django/

/Downloading/unpacking django/

/  Downloading Django-1.6.1.tar.gz (6.6MB): 6.6MB downloaded/

/  Running setup.py egg_info for package django/

/warning: no previously-included files matching '__pycache__'
found /

/under dir/

/ectory '*'/

/warning: no previously-included files matching '*.py[co]' found /

/under direct/

/ory '*'/

/Installing collected packages: django/

/  Running setup.py install for django/

/warning: no previously-included files matching '__pycache__'
found /

/under dir/

/ectory '*'/

/warning: no previously-included files matching '*.py[co]' found /

/under direct/

/ory '*'/

/Successfully installed django/

/Cleaning up.../

/
/

/(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py /

/
/

/startproject/

/ project_sl1/

/
/

/(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py /

/
/

/startproject/

/ project_sl1/

/Access is denied./

/
/

/(project_sl1) C:\Program Files\Ampps\python\Scripts>/

Just to be clear, I do want to get past this but I also want to
understand what is going on, so if you can do both, that would be great.
Do I need to change directories? Try opening a django project thrui the
django gui? Where / how would I do that? Everything I have done so far
has been thru the windows command line.

Thanx.
- -

On Tuesday, December 24, 2013 11:48:22 AM UTC-6, Malik Rumi wrote:

Boy, the speedy responses on this thread are great! I can't wait to
get home from work so I can put this advice into practice. And now
you know what I want for Christmas 😄 - a working installation of
django and python to play with.

From: Tom Lockhart 
Sent: ‎12/‎24/‎2013 9:15 AM
To: django-users@googlegroups.com 
   

What to learn first?

2013-12-25 Thread sahil13082
Hi,

I wanted to ask that what should I learn first = wxPython or Django?(Being 
a beginner in python)

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


Re: Can't Install on Windows 8.1

2013-12-25 Thread Felipe Bessa Coelho
2013/12/25 Malik Rumi 

> Ok, everything went smoothly and beautifully as promised. I got successful
> install messages for pip, distribute, virtualenv and django. So first,
> thank you both very much.
>
> However, I seem to be stuck again. I am not sure how to get from my new
> virtualenv to django, and windows seems just as confused. When I tried
> startproject, windows suddenly wanted to know if I wanted to keep using
> python to open .py files, or use notepad or some other program? I said
> python, and then it hiccuped, like it was restarting Explorer, and the
> command line went back to the prompt with no evidence it executed the
> startproject command. I looked in the directory, but saw nothing to
> indicate there was a project started. Of course, never having worked with
> either django or virtualenv before, I could have missed it. So I tried
> again.
>
>  As before, a dialog window opened asking me what program I wanted to
> use. While I was taking a screenshot to save for these notes, the dialog
> went away and the cmd line reported back that access was denied.
>
> Then I tried get_version and was told there was no module named django,
> even though just a few lines earlier I was told django was successfully
> installed.
>
> Here is that last portion from my command line window:
>
> *C:\Program Files\Ampps\python\Scripts>project_sl1\Scripts\activate*
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>pip install django*
>
> *Downloading/unpacking django*
>
> *  Downloading Django-1.6.1.tar.gz (6.6MB): 6.6MB downloaded*
>
> *  Running setup.py egg_info for package django*
>
> *warning: no previously-included files matching '__pycache__' found *
>
> *under dir*
>
> *ectory '*'*
>
> *warning: no previously-included files matching '*.py[co]' found *
>
> *under direct*
>
> *ory '*'*
>
> *Installing collected packages: django*
>
> *  Running setup.py install for django*
>
> *warning: no previously-included files matching '__pycache__' found *
>
> *under dir*
>
> *ectory '*'*
>
> *warning: no previously-included files matching '*.py[co]' found *
>
> *under direct*
>
> *ory '*'*
>
> *Successfully installed django*
>
> *Cleaning up...*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *
>
>
> *startproject*
>
> * project_sl1*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>django-admin.py *
>
>
> *startproject*
>
> * project_sl1*
>
> *Access is denied.*
>
>
> *(project_sl1) C:\Program Files\Ampps\python\Scripts>*
>
> Just to be clear, I do want to get past this but I also want to understand
> what is going on, so if you can do both, that would be great. Do I need to
> change directories? Try opening a django project thrui the django gui?
> Where / how would I do that? Everything I have done so far has been thru
> the windows command line.
> Thanx.
> - -
>


Instead of trying to  execute django-admin.py directly, explicitly tell the
prompt that you want to use python:

python C:\Path\To\django-admin.py startproject project_sl1

If you have problems with that, try specifying the python interpreter
directly as well:

C:\Path\To\Virtualenv\Scripts\python.exe C:\Path\To\django-admin.py
startproject project_sl1

Also, it might not be an issue right now, but for your own good, make sure
everything related to your project (which includes: the Python
installation, your virtualenv and the project itself) does not contain any
spaces in the pathnames, it might not be an issue right now, but you'll be
glad you did this later.

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


Re: What to learn first?

2013-12-25 Thread Tim Chase
On 2013-12-25 11:34, sahil13...@iiitd.ac.in wrote:
> I wanted to ask that what should I learn first = wxPython or
> Django?(Being a beginner in python)

What do you want to develop:  desktop applications or web
applications?  Django is predominantly for web applications, while
wx/qt/tk is primarily used for desktop applications.

-tkc



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


Re: What to learn first?

2013-12-25 Thread Mark Moss
Since you are a newbee, just learn the basics of python first. And then 
jump to Django. At that point, learn any new python stuff as needed.


- Mark
*Instant Django Hosting . No 
setup needed. Just start using!*

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


Re: Need Direction for Web App

2013-12-25 Thread Doug Ballance
I was waiting on Christmas dinner, and had an hour to kill so  I threw 
together a quick, incomplete skeleton app.  Maybe it can be of use to get 
you started on the django side.  It relies on the django-macaddress  
package, but is otherwise standalone.  It's very basic - the less there is 
of it, the easier to follow for someone new to django/python.  To make it 
functional you'd need to edit the alter_dhcp_conf() method to do the heavy 
lifting of securely updating your dhcpd conf and making the daemon reload.  
That method will run any time a device is added or removed.

https://github.com/dballanc/dhcp-example-skel

Good luck, and welcome to the community.


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