Scanning Uploaded Files

2020-04-13 Thread 'Aaron Wilson' via Django users
What is the recommended method to scan uploaded files for viruses? I see a 
lot of information about pyclamd which appears to be unmaintained. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1c972078-dde2-4c02-9678-84129b3f96ef%40googlegroups.com.


New User Authentication Guide (:

2019-08-06 Thread Aaron Harris
Hi all, pretty excited about our new guide to Django User authentication on 
the Kite Blog .
Nice to have a reference if authentication maybe isn't your *favorite* part 
of webdev.
https://kite.com/blog/python/django-authentication/

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a2ad325c-6874-4cab-ba2f-e6dc257e3516%40googlegroups.com.


Why does SelectDateWidget ignore empty_label when field is required?

2019-06-28 Thread Aaron Scruggs
Greetings,

I have a ModelForm with a required date field that I am using 
SelectDateWidget with. I would like to default the select fields to empty 
placeholder values and force the user to pick a specific date, rather than 
defaulting to the first possible one. However when I pass empty_label to 
the widget the values are ignored, since the field is required. I could 
probably sub-class SelectDateWidget and change it to get the behavior I'm 
looking for, but after looking at the code and documentation it's clear 
that the current behavior is a deliberate choice. My question is: Why are 
placeholders ignored when the date field is required?

My use case doesn't seem that unusual so I'm guessing there's a strong 
reason why it's not supported. I'd love to know what that reason is before 
I go making a mess of things. Any help is much appreciated.

Thanks,

Aaron

-- 
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/45527443-3dcf-4b4e-a66e-5e6aef426de1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Project Setup Checklist. Found this helpful...

2019-04-25 Thread Aaron Harris
Just curious how your project setup compares here and other resources you 
might suggest. Thanks!!

*Easily Install Django: A Quick Guide*

*Installation*
Assuming you have Python setup with pip – installation is simple. This will 
install Django along with a useful command that will help you get a project 
started quickly.

pip install django
The following command creates the project directory foo/ and creates a 
basic project structure and some initial files.

django-admin startproject foo
Let’s quickly go over each file we created:

Manage.py is the command-line utility that Django provides. It comes with a 
number of commands that are supported out of the box, some of which we’ll 
see later. Some Django applications that you may install later on will add 
commands accessible through this utility, and ultimately you’ll be able to 
add your own as needed.

foo/settings.py is n initial example of a Django settings file that should 
contain all the configuration for your application. If you take a look, you 
will see the default values that set your application up for running in a 
local development environment.

foo/urls.py is the default location for your URL configuration. Essentially 
this provides Django with the rules of how to route requests your 
application receives.

foo/wsgi.py is where the actual WSGI application lives. When running Django 
in production, you’ll want to use a server like uwsgi or green unicorn, 
whose servers interface with the application that resides in this file.

Now that we’ve created the project, let’s take it for a spin. To run the 
built-in development server, run:

./manage.py runserver
You should see some output indicating the settings used and where the 
server is available. Note that by default, it makes the server available at 
http://127.0.0.1:8000. If you go to that address, a default page will load, 
letting you know that you have successfully installed Django. As the page 
indicates, the only reason you’re seeing that page is because the default 
configuration provided in the settings.py file has DEBUG = True. Otherwise, 
trying to reach that page would give you a 404 as your URL configuration in 
urls.py doesn’t route that path to anything within your application.

‍
It's not that long but a bit too much for this post*. The rest is here 
:*

-- 
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/eef47143-bcf3-4f3d-8642-af8e04eee408%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Intregration Of on form submit user recive a sms in his phone

2018-07-31 Thread Aaron Jack
I use this company:

https://www.reach-interactive.com/

On Tuesday, 31 July 2018 14:32:02 UTC+1, im...@wsegames.com wrote:
>
> How to impement this feature Intregration Of on form submit user recive a 
> sms in his phone.
>

-- 
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/e818b28e-a933-4f5e-8759-4978e77e0605%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Form disappears after click submit

2018-05-13 Thread aaron newberry
I have a form I am using for a drop down that I would like to stay on the 
page after submit is clicked. The problem is it disappears after submit. I 
would like the form drop down to still display after submit. I what it is 
after submit the form class isnt called again. How do I call the form class 
again?


urls.py
urlpatterns = [
url(
regex=r'ventris/$',
view=views.ventrisselfservice,
name='ventris'
),
url(r'^ventrisselfservice', views.ventrisselfservice, name='ventris'),
# url(r'^cran', views.cranselect, name='cranselect'),
url(r'^ventrisviplookup', views.ventrisviplookup, 
name='ventrisviplookup'),
url(r'^cran', views.CranSelect.as_view(), name='cranselect'),

view.py
def ventrisviplookup(request):
cran = request.GET['cran']
lb1, lb2 = cran_lb_lookup(cran)
# print(lb1, lb2)
ventris_vip1 = vip_full_configs(session, lb1)
ventris_vip2 = vip_full_configs(session, lb2)
# print('vip out', ventris_vip1)
return render(request, 'cranselect.html', {'cran': cran,
 'lb1': lb1, 'lb2': lb2, 'ventris_vip1': ventris_vip1, 
'ventris_vip2': ventris_vip2})


class CranSelect(FormView):
model = CranSelect
form_class = CranForm
template_name = 'cranselect.html'

def get(self, request, *args, **kwargs):
form = self.form_class(request.GET or None)
if form.is_valid():
return self.form_valid(form)
return self.render_to_response(self.get_context_data(form=form))

forms.py

class CranForm(forms.ModelForm):
class Meta:
model = CranSelect
fields = ['cran']


template that calls the form




Please select the CRAN area 
were you want to configure a Ventris VIP.




{% for field in form %}




{% endfor %}







template that displays the form

{% block content %}

Ventris VIP Lookup 


{% include "cranselect_form.html" %}



{% if ventris_vip1 == "NoVIP" %}

No VIPs in selected CRAN: {{cran}}

{{lb1}} no vip
{{lb2}} no vip

{% else %}




-- 
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/0f24969e-9b16-43e5-8cfb-650b58f779d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Hi, a little help here.

2017-12-14 Thread Aaron
I wasn't sure where to ask this question and then I found this place. I've 
got a MacBook running mac OS High Sierra.  I've been trying to install 
Django for a while. Whenever I try, I get an error that says "Command 
"python setup.py egg_info" failed with error code 1 in 
/private/var/folders/8y/lq4gsyx97_q171qrh2q18z0hgn/T/pip-build-cZ0Fno/django/"
 
in terminal. I'm not sure what to do. 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/a202cdff-dc2e-416d-9462-3b7cfe11d46b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DoesNotExist behavior in db.models query.py

2017-10-23 Thread 'Aaron C. de Bruyn' via Django users
The difference between .filter() and .get() is definitely 'by-design'.

When you filter through a list of objects, you could end up with zero,
one, or many objects returned.

When you call .get(), you are basically saying "I want to get exactly
*one* record".  If the record is not found, it is considered an error.

One additional difference is that .filter() returns a list of zero or
more objects whereas .get() returns the object you requested or it
throws an error.

You can catch the error calling .get() like so:

try:
   Person.objects.get(pk=123)
except Person.DoesNotExist:
  print("That person did not exist")


-A

On Mon, Oct 23, 2017 at 3:14 PM,   wrote:
> Replying to myself here: as is often the case, the problem lies with my own
> source code.
> I was calling
> MODELNAME.objects.get(modelfieldname1='foo',modelfieldname2='bar')
>
>
> which raises the 500 when no such record exists.
>
> Turns out that calling
> MODELNAME.objects.filter(modelfieldname1='foo',modelfieldname2='bar')
>
>
> behaves politely when finding no matching record and returns a 0 length
> QuerySet array. So with calling filter I can then just test on length of
> result and make my behavior omit a 400 and some helpful information to
> client side about the nature of the 400 error.
>
> Separately, this does raise the question of should get() and filter() behave
> similarly or is there a reason that filter() allows empty result sets but
> get() does not?
>
> Thanks,
> Steve
>
> On Monday, October 23, 2017 at 2:49:28 PM UTC-7, st...@fitcode.com wrote:
>>
>> I have been tripping over the following exception
>> DoesNotExist: INSERT_YOUR_MODEL_NAME_HERE matching query does not exist.
>>
>> The error is source in django 1.11.2 in db.models query.py file, in the
>> get(self, *args, **kwargs) function, line 378 to be exact
>> ...
>> raise self.model.DoesNotExist(...)
>> ...
>> This throws a 500 error and I would like my code not to throw a 500 error
>> in this situation, rather a customized message more along a 4xx error e.g.
>> {"message": "record matching identifier A and identifier B not found in
>> database"}
>> rather than a 500 error.
>>
>> It seems to me that my only choice right now is to subclass QuerySet and
>> write my own version of the get(self, *args, **kwargs) method. Is that my
>> only choice or is there a django parameter I can set so that 0 matching
>> results does not return a 500?
>>
>> Or do I need to intercept the 500 error somewhere else.
>>
>> Sorry, am a bit of a newbie to django internals, all help and advice is
>> appreciated.
>>
>> Thanks,
>> Steve
>
> --
> 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/67bd9382-0ac1-49c6-8b26-1827b91a852c%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/CAEE%2BrGoCXNf%2Bqs5jL6RLZN7VyPDAuWQFW7sPBTtwYWKPB%2BoGLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Heroku Git Error

2017-10-02 Thread Aaron Weisberg
Hi everyone,

It's a miracle I've gotten this far with the amount of knowledge that I 
don't have with coding, hosting, django, heroku, git etc.  However, I've 
been using a heroku server to serve my website for the last couple of 
months and I've been able to do so without any issues.

However, last week I was away from my office and i tried to make some 
changes to my site via a new machine, which I knew was a bad idea.  I 
committed one change, never pushed it using "git push heroku master" and 
then deleted the change using git reset


Now that I'm back in my office at my original machine, I'm having all sorts 
of issues and I cannot commit any changes or even hookup with git on the 
same page.

When I try to push to heroku master I get:
![rejected] master --> master (non-fast forward)
error: failed to push some refs to 'https://git.heroku...
Updates were rejectred because the tip of your current batch is behind its 
remote counterpart.  Integrate the remote changes (e.g. git pull) before 
pushing again

okay- well that's all well and good, but I can't perform git pull, git 
fetch or anything along those lines either.

I get:

Permission denied (publickey) fatal could not read from repository
Please make sure you have the correct access rights and the repository 
exists

Please help!

Thanks,

Aaron

-- 
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/1ada81a0-3138-489d-b7b9-74b8c83e600a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrations

2017-03-10 Thread 'Aaron C. de Bruyn' via Django users
Nope.

-A

On Fri, Mar 10, 2017 at 12:17 PM, Matthew Pava  wrote:
> Does anyone else get a migraine when working migrations?
>
> --
> 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/41f9ad6271964c208f3726a4fa28bfff%40ISS1.ISS.LOCAL.
> 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/CAEE%2BrGoBUEDbn%2BcVx6nscnAhrh7b%2Bd22eMt33d69Ce3d1M77Jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: video tutorial dating site

2017-01-31 Thread 'Aaron C. de Bruyn' via Django users
One of the first results when Googling 'Django video tutorials' is
this: https://www.quora.com/Are-there-any-good-Django-video-tutorials

There are many links provided there.

-A

On Tue, Jan 31, 2017 at 5:28 PM,   wrote:
> am new using python(django) i built an app lately but i want to build a
> dating site using django. I will be comfortable with video tutorials. Any
> help please???
>
> --
> 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/2818f361-d0d0-46bb-bd5d-02d643f45232%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/CAEE%2BrGrq8_tnhy2NWTz9Y6wVM_5f1k1bBXTDX%3Dp1s-WVi5TrJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Security issue

2016-12-05 Thread 'Aaron C. de Bruyn' via Django users
It's a little un-clear how you are setting up your Django deployment,
but the 'dev server' shouldn't be exposed directly to the internet.

Have you read through the deployment guides?

https://docs.djangoproject.com/en/1.10/howto/deployment/

-A

On Sun, Dec 4, 2016 at 11:43 PM, deepak gupta  wrote:
> Hi All,
>
> When ever we are opening a public IP on our server (CentOS and our
> application developed on Django 1.9.7, Angular 1.5).
> Inbound port is enabled on 8080, there is no port configuration for outbound
> traffic.
> We found once we enable public IP, it start generating huge outbound HTTP
> traffic, event though nobody access the server.
>
> do anyone has idea about any similar security issues/fix. what could be the
> possible cause and how to trace the issue?
>
> Thanks,
> Deepak
>
> --
> 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/CAP%3DkbM3jPjgZbL7nUJRdbD7sLFmh9fPnfRewAAZn%3DP74h9xcJw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: transferring data between Postgres databases

2016-10-23 Thread 'Aaron C. de Bruyn' via Django users
If you're talking about migrating data using tools outside of django,
I've used SQLWorkbench[0] in the past.
I currently use it to selectively sync a handful of tables out of a
~900 table database *in* to my Django app.

[0] - http://www.sql-workbench.net/

-A

On Sun, Oct 23, 2016 at 9:04 PM, Mike Dewhirst  wrote:
> I have a user who has done a lot of work (instead of playing) in the staging
> server and now wants to get that work into the production database.
>
> I'm about to research selective dump and load capabilities of Postgres but
> in the meantime can anyone suggest any shortcuts?
>
> Thanks
>
> Mike
>
> --
> 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/4ba85f65-b90c-c786-d112-96168cfbd9ca%40dewhirst.com.au.
> 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/CAEE%2BrGrf2cEjCJEVuAxmz9FBPukzpBaAzR7RsBZ8iQ24ZpNWZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template iterating through two dictionaries/variables

2016-08-30 Thread Aaron Weisberg
This is why i ask this group.

Everyone helped out, but  Nate's link pushed me in the right direction.

Sometimes I don't even know what to ask stack overflow, but the google 
group always helps out.

Thanks

On Tuesday, August 30, 2016 at 11:28:37 AM UTC-5, Nate Granatir wrote:
>
> You could also just join the dicts before passing them to the template. It 
> looks like it's relatively straightforward (scores is just a list that 
> contains dicts of a 'Number' and a 'score', right?) Then you could turn 
> scores into a dict, assuming Numbers are unique:
>
> scores_new = {score['Number']:score['score'] for score in scores}
>
> And then update the persons dict to include the score:
> for person in persons:
> person.update({'score': scores_new.get(person['Number'])})
>
> Then in your persons list in the template you'll just need to display 
> person.score.
>
> If you want to get really fancy (if, say, there's more than just a score 
> you need to pull from the dicts in scores) you can see how to merge two 
> lists of dicts on a common key here:
>
> http://stackoverflow.com/questions/5501810/join-two-lists-of-dictionaries-on-a-single-key
>

-- 
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/49018a13-680a-4b6d-8d1e-be5c5444c2d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template iterating through two dictionaries/variables

2016-08-29 Thread Aaron Weisberg
I hate to be thick but could you explain to me how to load the filters and
also how the template should look with the updated function?  Solving this
will unlock a ton of functionality for my app.

Thanks,

Aaron

On Aug 29, 2016 12:34 PM, "Asad Jibran Ahmed" <surfer...@gmail.com> wrote:

> No problem. The most probable reason why you're getting the invalid filter
> error is because you forgot to load the filters.
>
> Your explanation of the workflow is correct, with one small correction.
> The template will handoff the search for the correct *Score* to the
> filter function. Whatever the filter function returns will then be inserted
> in place of the {scores|from_player:person} part in your template. One
> way of getting the correct score would be to loop over the items in your
> scores dictionary, and find the one where the identification numbers match.
> One suggestion, instead of returning a dictionary from your filter
> function, you should return the value you want to display. So maybe your
> filter can look something like:
> def get_score_for_person(scores, person):
>  for s in scores:
>   if s['Number'] == p.Number:
>return s['Score']
>
>
> And you're right, maybe you can rename the filter to be
> get_score_for_person if that is more clear for your application.
>
> On Monday, August 29, 2016 at 8:12:56 PM UTC+4, Aaron Weisberg wrote:
>>
>> Thanks Asad. Is that why I'm getting errors saying invalid filter name?
>>
>> Also I'm having a difficult time thinking my way through the workflow.
>> I'm defining a new function that requires scores(my URL based dictionary)
>> and person (my database dictionary). The function then asks to return the
>> scores of the corresponding game number. Then the template is looking for
>> the correct value in the scores dictionary that has the same Number
>> identification as the existing person.Number?
>>
>> I think what is confusing me is the use of "player" in ludovics example
>>
>> Thanks
>>
>> Aaron
>>
>> On Aug 29, 2016 11:53 AM, "Asad Jibran Ahmed" <surf...@gmail.com> wrote:
>>
>>> No need to change the context, since the variable names the example here
>>> uses are the same as your existing context. It should work as long as you
>>> remember to {% load APPNAME %} your filters in the template first.
>>> ​
>>>
>>> Asad Jibran Ahmed <surf...@gmail.com>
>>> http://blog.asadjb.com
>>>
>>> On Mon, Aug 29, 2016 at 6:50 PM, Aaron Weisberg <aaron.m@gmail.com>
>>> wrote:
>>>
>>>> Thanks ludovic,
>>>>
>>>> I'm trying to write that python code presently- would I have to also
>>>> change the context?  how would that look?
>>>>
>>>> Thanks
>>>>
>>>> On Fri, Aug 26, 2016 at 10:40 AM, ludovic coues <cou...@gmail.com>
>>>> wrote:
>>>>
>>>>> You could write a filter [1]. It would be used like {{
>>>>> scores|from_player:person }} and look like that:
>>>>>
>>>>> def from_player (scores, player):
>>>>> return scores[player.Number]
>>>>>
>>>>> You might want to adjust to your actual code, check that you got the
>>>>> right arguments and that kind of things.
>>>>>
>>>>> [1] https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/
>>>>>
>>>>> 2016-08-26 15:50 GMT+02:00 Aaron Weisberg <aaron.m@gmail.com>:
>>>>> > I didn't really know how to label this question, but I think it's an
>>>>> > interesting concept and I haven't seen a resolution anywhere else.
>>>>> >
>>>>> > I currently have two different dictionaries as context for a
>>>>> template:
>>>>> >
>>>>> > Enter code here...context ={
>>>>> >  'person':person,
>>>>> >  'scores':scores,
>>>>> >}
>>>>> >
>>>>> >
>>>>> > Each of these dictionaries has a common key (person.Number),
>>>>> > (scores.Number), however the person dictionary is based off of a
>>>>> model in my
>>>>> > django database, while scores comes from a json feed that I parse
>>>>> through:
>>>>> >
>>>>> > I currently run through a table in a template that looks like this:
>>>>> >

Re: Django template iterating through two dictionaries/variables

2016-08-29 Thread Aaron Weisberg
Thanks Asad. Is that why I'm getting errors saying invalid filter name?

Also I'm having a difficult time thinking my way through the workflow. I'm
defining a new function that requires scores(my URL based dictionary) and
person (my database dictionary). The function then asks to return the
scores of the corresponding game number. Then the template is looking for
the correct value in the scores dictionary that has the same Number
identification as the existing person.Number?

I think what is confusing me is the use of "player" in ludovics example

Thanks

Aaron

On Aug 29, 2016 11:53 AM, "Asad Jibran Ahmed" <surfer...@gmail.com> wrote:

> No need to change the context, since the variable names the example here
> uses are the same as your existing context. It should work as long as you
> remember to {% load APPNAME %} your filters in the template first.
> ​
>
> Asad Jibran Ahmed <surfer...@gmail.com>
> http://blog.asadjb.com
>
> On Mon, Aug 29, 2016 at 6:50 PM, Aaron Weisberg <
> aaron.m.weisb...@gmail.com> wrote:
>
>> Thanks ludovic,
>>
>> I'm trying to write that python code presently- would I have to also
>> change the context?  how would that look?
>>
>> Thanks
>>
>> On Fri, Aug 26, 2016 at 10:40 AM, ludovic coues <cou...@gmail.com> wrote:
>>
>>> You could write a filter [1]. It would be used like {{
>>> scores|from_player:person }} and look like that:
>>>
>>> def from_player (scores, player):
>>> return scores[player.Number]
>>>
>>> You might want to adjust to your actual code, check that you got the
>>> right arguments and that kind of things.
>>>
>>> [1] https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/
>>>
>>> 2016-08-26 15:50 GMT+02:00 Aaron Weisberg <aaron.m.weisb...@gmail.com>:
>>> > I didn't really know how to label this question, but I think it's an
>>> > interesting concept and I haven't seen a resolution anywhere else.
>>> >
>>> > I currently have two different dictionaries as context for a template:
>>> >
>>> > Enter code here...context ={
>>> >  'person':person,
>>> >  'scores':scores,
>>> >}
>>> >
>>> >
>>> > Each of these dictionaries has a common key (person.Number),
>>> > (scores.Number), however the person dictionary is based off of a model
>>> in my
>>> > django database, while scores comes from a json feed that I parse
>>> through:
>>> >
>>> > I currently run through a table in a template that looks like this:
>>> >
>>> > Enter code here...
>>> >   
>>> >   
>>> >   Person
>>> > Person Number
>>> > First Name
>>> > Last Name 
>>> >  City 
>>> >  Score
>>> >   
>>> >   
>>> >   
>>> >{% for person in persons %}
>>> >   
>>> >   {{ person.Number }}
>>> >   {{ person.firstName }}
>>> >
>>>  {{
>>> > person.lastName }}
>>> >
>>>  {{
>>> > person.city }}
>>> >
>>> > ??'''scores.score1 goes here'''
>>> >
>>> >  {% endfor %}
>>> >
>>> >   
>>> >
>>> > What I'm trying to figure out to do is figure out how to get that final
>>> > detail loaded into the table where we would find the score specific to
>>> that
>>> > person.Number.  In other words how to go through my scores dictionary
>>> in
>>> > this template and find the corresponding score1 using the
>>> person.Number from
>>> > the other dictionary as the value.
>>> >
>>> >
>>> > Let me know if you have any ideas.
>>> >
>>> > 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

Re: Django template iterating through two dictionaries/variables

2016-08-29 Thread Aaron Weisberg
Thanks ludovic,

I'm trying to write that python code presently- would I have to also change
the context?  how would that look?

Thanks

On Fri, Aug 26, 2016 at 10:40 AM, ludovic coues <cou...@gmail.com> wrote:

> You could write a filter [1]. It would be used like {{
> scores|from_player:person }} and look like that:
>
> def from_player (scores, player):
> return scores[player.Number]
>
> You might want to adjust to your actual code, check that you got the
> right arguments and that kind of things.
>
> [1] https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/
>
> 2016-08-26 15:50 GMT+02:00 Aaron Weisberg <aaron.m.weisb...@gmail.com>:
> > I didn't really know how to label this question, but I think it's an
> > interesting concept and I haven't seen a resolution anywhere else.
> >
> > I currently have two different dictionaries as context for a template:
> >
> > Enter code here...context ={
> >  'person':person,
> >  'scores':scores,
> >}
> >
> >
> > Each of these dictionaries has a common key (person.Number),
> > (scores.Number), however the person dictionary is based off of a model
> in my
> > django database, while scores comes from a json feed that I parse
> through:
> >
> > I currently run through a table in a template that looks like this:
> >
> > Enter code here...
> >   
> >   
> >   Person
> > Person Number
> > First Name
> > Last Name 
> >  City 
> >  Score
> >   
> >   
> >   
> >{% for person in persons %}
> >   
> >   {{ person.Number }}
> >   {{ person.firstName }}
> >
>  {{
> > person.lastName }}
> >
>  {{
> > person.city }}
> >
> > ??'''scores.score1 goes here'''
> >
> >  {% endfor %}
> >
> >   
> >
> > What I'm trying to figure out to do is figure out how to get that final
> > detail loaded into the table where we would find the score specific to
> that
> > person.Number.  In other words how to go through my scores dictionary in
> > this template and find the corresponding score1 using the person.Number
> from
> > the other dictionary as the value.
> >
> >
> > Let me know if you have any ideas.
> >
> > 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/d05c8fc4-
> 706b-422b-bc11-b656f1950dea%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/UlgghbsoqYI/unsubscribe.
> To unsubscribe from this group and all its topics, 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%2BTatGSwstRkfEDpZdeB6yMv2Bobia
> Q_Zb3CEL7ZXr5kE-g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: How to set up a form from an existing view

2016-08-27 Thread Aaron Weisberg
Thanks ludovic

I'll try that. I have a very basic form question. What attribute gets
posted in the .POST? Is that value? In input?

Secondly, the default value in the function, is that a type like text or
integer or is it just a place holder like "Chicago" or "2"

Thanks

On Aug 26, 2016 11:33 AM, "ludovic coues" <cou...@gmail.com> wrote:

> First, your html is invalid. You can't put a whole form in a link. Nor
> a button. You can remove the  element and put the shiny class on
> the input[type=submit]
>
> About your input[type=submit], I have some doubts about cross brother
> compatibility of what you are trying to achieve. It would be either to
> add an input[type=hidden] which the value {{games.roadTeam}}. This
> will prevent you some headache if your code don't work under IE or Fx
> or chrome or whatnot.
>
> About your question,
> you can use the request argument, like this:
>
> if request.method == "POST":
> request.POST.get("variable", "default_value")
>
> If you want to do something more complex than simply find which team
> is chosen, you should create a form class. This will simplify data
> handling.
>
> That being said, you are on a good start :)
>
> 2016-08-26 16:00 GMT+02:00 Aaron Weisberg <aaron.m.weisb...@gmail.com>:
> > Good morning,
> >
> > I have been working on an app displaying some analytics and I want to
> > incorporate some user feedback and I am having trouble figuring out how:
> >
> > I have a detail view:
> >
> > Enter code here...
> >
> > #views.py
> > def detail(request, game_id):
> > games = Game.objects.get(pk=game_id)
> > context = {
> > 'games':games}
> > return render(request,'myapp/detail.html',context)
> >
> > Very simple with no form activity as of yet.
> >
> > My template currently shows a comparison between two properties set up
> like:
> >
> > #detail.html
> >
> > 
> > 
> > 
> > 
> > 
> > {{ games.roadTeam }}
> > {{ games.roadTeamWins}} -
> {{
> > games.roadTeamLosses}}
> >
> >
> > 
> > 
> > {{games.homeTeam }}
> > {{ games.HomeTeamWins}} -
> {{
> > games.HomeTeamLosses}}
> >
> >
> > 
> >
> >
> > I would like to work backwards and turn this template into a form.
> Would I
> > be able to make it a form by adding a third div to each one of these
> that is
> > a button which sends the value of the variable back to the view?  and
> then
> > how would I be able to process that in the view?
> > Enter code here...
> >
> > 
> >  method="post">{%
> > csrf_token %}
> > 
> >  > style="width 100%">
> > 
> >
> > I am not an expert when it comes to forms, so your assistance would be
> > greatly appreciated.
> >
> > 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/0569cc00-
> 30c1-4b14-b521-107e37149340%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/2pxh8Pmrfrg/unsubscribe.
> To unsubscribe from this group and all its topics, 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%2BTZtE_QP3uq473HkW%2BRmYNtPrHV3XO%2B09PubC4sp5k-
> H0A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


How to set up a form from an existing view

2016-08-26 Thread Aaron Weisberg
Good morning,

I have been working on an app displaying some analytics and I want to 
incorporate some user feedback and I am having trouble figuring out how:

I have a detail view:

Enter code here...

#views.py
def detail(request, game_id):
games = Game.objects.get(pk=game_id)
context = {
'games':games}
return render(request,'myapp/detail.html',context)

Very simple with no form activity as of yet.

My template currently shows a comparison between two properties set up like:

#detail.html






{{ games.roadTeam }}
{{ games.roadTeamWins}} - {{ 
games.roadTeamLosses}} 
 
   


{{games.homeTeam }}
{{ games.HomeTeamWins}} - {{ 
games.HomeTeamLosses}}
 




I would like to work backwards and turn this template into a form.  Would I 
be able to make it a form by adding a third div to each one of these that 
is a button which sends the value of the variable back to the view?  and 
then how would I be able to process that in the view?
Enter code here...


{% csrf_token %}




I am not an expert when it comes to forms, so your assistance would be 
greatly appreciated.

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/0569cc00-30c1-4b14-b521-107e37149340%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django template iterating through two dictionaries/variables

2016-08-26 Thread Aaron Weisberg
I didn't really know how to label this question, but I think it's an 
interesting concept and I haven't seen a resolution anywhere else.

I currently have two different dictionaries as context for a template:

Enter code here...context ={
 'person':person,
 'scores':scores,
   }


Each of these dictionaries has a common key (person.Number), 
(scores.Number), however the person dictionary is based off of a model in 
my django database, while scores comes from a json feed that I parse 
through:

I currently run through a table in a template that looks like this:

Enter code here...
  
  
  Person
Person Number
First Name
Last Name 
 City  
 Score 
  
  
  
   {% for person in persons %}
  
  {{ person.Number }}
  {{ person.firstName }}
  
{{ person.lastName }}
  
{{ person.city }}
  
??'''scores.score1 goes here'''
 
 {% endfor %}

  

What I'm trying to figure out to do is figure out how to get that final 
detail loaded into the table where we would find the score specific to that 
person.Number.  In other words how to go through my scores dictionary in 
this template and find the corresponding score1 using the person.Number 
from the other dictionary as the value.


Let me know if you have any ideas.

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/d05c8fc4-706b-422b-bc11-b656f1950dea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python dictionaries saved to models

2016-08-18 Thread Aaron Weisberg
Nevermind- the good folks at Django didn't add:

from django.apps import apps in order to pull off this data migration

On Thursday, August 18, 2016 at 8:40:26 AM UTC-5, Aaron Weisberg wrote:
>
> Thanks.  
>
> However, when I write the function and try to run the data migration I run 
> into this error:
>
> Enter code here...NameError: name apps is not defined
>
> That is coming from this line in the migration:
>
> Players = apps.get_model("team","Players")
>
> This is a copy/paste from the documentation.  Is there a typo?
>
> Thanks.
>
>
> On Thursday, August 18, 2016 at 7:48:58 AM UTC-5, Tim Graham wrote:
>>
>> Right, or even in a standalone script if a migration is more than you 
>> need: 
>> https://docs.djangoproject.com/en/stable/topics/settings/#calling-django-setup-is-required-for-standalone-django-usage
>>
>> On Thursday, August 18, 2016 at 2:14:39 AM UTC-4, Todor Velichkov wrote:
>>>
>>> Maybe a data migration 
>>> <https://docs.djangoproject.com/en/1.9/topics/migrations/#data-migrations> 
>>> is what you are looking for.
>>>
>>> On Thursday, August 18, 2016 at 8:38:33 AM UTC+3, Aaron Weisberg wrote:
>>>>
>>>> Great- thanks Tim.
>>>>
>>>> I understand the Python, but what I guess where I'm fuzzy is where to 
>>>> exactly put that code.  
>>>>
>>>> Do I put it in the models.py? class.py?  and how do I execute?
>>>>
>>>> That is the final piece of the puzzle for me.  
>>>>
>>>> Thanks so much.
>>>>
>>>> Aaron
>>>>
>>>> On Wednesday, August 17, 2016 at 3:48:18 PM UTC-5, Tim Graham wrote:
>>>>>
>>>>> You need to transform your data dictionary so that the keys match the 
>>>>> models field names and then you can use:
>>>>>
>>>>> players_data = [{'number': 1, ...}, {...}]
>>>>>
>>>>> for data in players_data:
>>>>> Player.objects.bulk_create(**data)
>>>>>
>>>>> (or something similar with bulk_create())
>>>>>
>>>>>
>>>>> https://docs.djangoproject.com/en/stable/ref/models/querysets/#bulk-create
>>>>>
>>>>> On Wednesday, August 17, 2016 at 1:42:04 PM UTC-4, Aaron Weisberg 
>>>>> wrote:
>>>>>>
>>>>>> Hi everyone,
>>>>>>
>>>>>> I have several dictionaries that I would like to import into my 
>>>>>> django project database, but I can't figure out exactly how.
>>>>>>
>>>>>> I have tried to implement through fixtures, through views and through 
>>>>>> loaddata, but I must be doing something wrong at every turn- so if 
>>>>>> someone 
>>>>>> could suggest a workflow, it would really help me a lot!
>>>>>>
>>>>>> My data is currently in a list of dictionaries called data:
>>>>>>
>>>>>> Enter code here...data = [{'pos': 'position', 'player': 'name', 'ht': 
>>>>>> 'height', 'wt': 175, 'birth': 'September 9, 1967', 'college': 
>>>>>> 'university', 'number': 10, 'exp': 1},
>>>>>>
>>>>>>
>>>>>> each dictionary within that list is a "player" who I'd like to input 
>>>>>> his data into my model "Players"
>>>>>>
>>>>>> Enter code here...
>>>>>> #models.py
>>>>>> class Player(models.Model):
>>>>>>
>>>>>> number = models.CharField(max_length=2)
>>>>>> player = models.CharField(max_length=50)
>>>>>> position = models.CharField(max_length=2)
>>>>>> height = models.CharField(max_length=50)
>>>>>> weight = models.CharField(max_length=50)
>>>>>> birth = models.DateField()
>>>>>> exp = models.CharField(max_length=50)
>>>>>> college = models.CharField(max_length=50)
>>>>>> def __str__(self):
>>>>>> return self.player
>>>>>>
>>>>>>
>>>>>> There are about 500 players in that list of dictionaries above that I 
>>>>>> would like to insert into this model.
>>>>>>
>>>>>> 1) Can i run a function in the model above to insert the data into 
>>>>>> its appropriate field?  If so, how do 

Re: Python dictionaries saved to models

2016-08-18 Thread Aaron Weisberg
Thanks.  

However, when I write the function and try to run the data migration I run 
into this error:

Enter code here...NameError: name apps is not defined

That is coming from this line in the migration:

Players = apps.get_model("team","Players")

This is a copy/paste from the documentation.  Is there a typo?

Thanks.


On Thursday, August 18, 2016 at 7:48:58 AM UTC-5, Tim Graham wrote:
>
> Right, or even in a standalone script if a migration is more than you 
> need: 
> https://docs.djangoproject.com/en/stable/topics/settings/#calling-django-setup-is-required-for-standalone-django-usage
>
> On Thursday, August 18, 2016 at 2:14:39 AM UTC-4, Todor Velichkov wrote:
>>
>> Maybe a data migration 
>> <https://docs.djangoproject.com/en/1.9/topics/migrations/#data-migrations> 
>> is what you are looking for.
>>
>> On Thursday, August 18, 2016 at 8:38:33 AM UTC+3, Aaron Weisberg wrote:
>>>
>>> Great- thanks Tim.
>>>
>>> I understand the Python, but what I guess where I'm fuzzy is where to 
>>> exactly put that code.  
>>>
>>> Do I put it in the models.py? class.py?  and how do I execute?
>>>
>>> That is the final piece of the puzzle for me.  
>>>
>>> Thanks so much.
>>>
>>> Aaron
>>>
>>> On Wednesday, August 17, 2016 at 3:48:18 PM UTC-5, Tim Graham wrote:
>>>>
>>>> You need to transform your data dictionary so that the keys match the 
>>>> models field names and then you can use:
>>>>
>>>> players_data = [{'number': 1, ...}, {...}]
>>>>
>>>> for data in players_data:
>>>> Player.objects.bulk_create(**data)
>>>>
>>>> (or something similar with bulk_create())
>>>>
>>>>
>>>> https://docs.djangoproject.com/en/stable/ref/models/querysets/#bulk-create
>>>>
>>>> On Wednesday, August 17, 2016 at 1:42:04 PM UTC-4, Aaron Weisberg wrote:
>>>>>
>>>>> Hi everyone,
>>>>>
>>>>> I have several dictionaries that I would like to import into my django 
>>>>> project database, but I can't figure out exactly how.
>>>>>
>>>>> I have tried to implement through fixtures, through views and through 
>>>>> loaddata, but I must be doing something wrong at every turn- so if 
>>>>> someone 
>>>>> could suggest a workflow, it would really help me a lot!
>>>>>
>>>>> My data is currently in a list of dictionaries called data:
>>>>>
>>>>> Enter code here...data = [{'pos': 'position', 'player': 'name', 'ht': 
>>>>> 'height', 'wt': 175, 'birth': 'September 9, 1967', 'college': 
>>>>> 'university', 'number': 10, 'exp': 1},
>>>>>
>>>>>
>>>>> each dictionary within that list is a "player" who I'd like to input 
>>>>> his data into my model "Players"
>>>>>
>>>>> Enter code here...
>>>>> #models.py
>>>>> class Player(models.Model):
>>>>>
>>>>> number = models.CharField(max_length=2)
>>>>> player = models.CharField(max_length=50)
>>>>> position = models.CharField(max_length=2)
>>>>> height = models.CharField(max_length=50)
>>>>> weight = models.CharField(max_length=50)
>>>>> birth = models.DateField()
>>>>> exp = models.CharField(max_length=50)
>>>>> college = models.CharField(max_length=50)
>>>>> def __str__(self):
>>>>> return self.player
>>>>>
>>>>>
>>>>> There are about 500 players in that list of dictionaries above that I 
>>>>> would like to insert into this model.
>>>>>
>>>>> 1) Can i run a function in the model above to insert the data into its 
>>>>> appropriate field?  If so, how do I execute that function?
>>>>> 2) If it's a view that I need to execute-  do I just put the function 
>>>>> in views.py?  How then is the dictionary imported into the database?
>>>>>
>>>>> or... How would you go about getting that data into your database? 
>>>>>  Please note that the data is coming from a url that might change from 
>>>>> time 
>>>>> to time.  But I think once i get the first iteration of data into these 
>>>>> models I can figure out how to update.  But the only way I can figure out 
>>>>> is to create them one by one in the shell or create a form and input them 
>>>>> one by one.
>>>>>
>>>>> If you have a solution, please share and be as detailed as possible 
>>>>> since I am a complete beginner with django.
>>>>>
>>>>> Peace and love,
>>>>>
>>>>> Aaron
>>>>>
>>>>>

-- 
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/56a0c926-853b-42ba-ae25-9fa24d6f3bd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python dictionaries saved to models

2016-08-17 Thread Aaron Weisberg
Great- thanks Tim.

I understand the Python, but what I guess where I'm fuzzy is where to 
exactly put that code.  

Do I put it in the models.py? class.py?  and how do I execute?

That is the final piece of the puzzle for me.  

Thanks so much.

Aaron

On Wednesday, August 17, 2016 at 3:48:18 PM UTC-5, Tim Graham wrote:
>
> You need to transform your data dictionary so that the keys match the 
> models field names and then you can use:
>
> players_data = [{'number': 1, ...}, {...}]
>
> for data in players_data:
> Player.objects.bulk_create(**data)
>
> (or something similar with bulk_create())
>
> https://docs.djangoproject.com/en/stable/ref/models/querysets/#bulk-create
>
> On Wednesday, August 17, 2016 at 1:42:04 PM UTC-4, Aaron Weisberg wrote:
>>
>> Hi everyone,
>>
>> I have several dictionaries that I would like to import into my django 
>> project database, but I can't figure out exactly how.
>>
>> I have tried to implement through fixtures, through views and through 
>> loaddata, but I must be doing something wrong at every turn- so if someone 
>> could suggest a workflow, it would really help me a lot!
>>
>> My data is currently in a list of dictionaries called data:
>>
>> Enter code here...data = [{'pos': 'position', 'player': 'name', 'ht': 
>> 'height', 'wt': 175, 'birth': 'September 9, 1967', 'college': 
>> 'university', 'number': 10, 'exp': 1},
>>
>>
>> each dictionary within that list is a "player" who I'd like to input his 
>> data into my model "Players"
>>
>> Enter code here...
>> #models.py
>> class Player(models.Model):
>>
>> number = models.CharField(max_length=2)
>> player = models.CharField(max_length=50)
>> position = models.CharField(max_length=2)
>> height = models.CharField(max_length=50)
>> weight = models.CharField(max_length=50)
>> birth = models.DateField()
>> exp = models.CharField(max_length=50)
>> college = models.CharField(max_length=50)
>> def __str__(self):
>> return self.player
>>
>>
>> There are about 500 players in that list of dictionaries above that I 
>> would like to insert into this model.
>>
>> 1) Can i run a function in the model above to insert the data into its 
>> appropriate field?  If so, how do I execute that function?
>> 2) If it's a view that I need to execute-  do I just put the function in 
>> views.py?  How then is the dictionary imported into the database?
>>
>> or... How would you go about getting that data into your database? 
>>  Please note that the data is coming from a url that might change from time 
>> to time.  But I think once i get the first iteration of data into these 
>> models I can figure out how to update.  But the only way I can figure out 
>> is to create them one by one in the shell or create a form and input them 
>> one by one.
>>
>> If you have a solution, please share and be as detailed as possible since 
>> I am a complete beginner with django.
>>
>> Peace and love,
>>
>> Aaron
>>
>>

-- 
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/44dbbe95-c5ae-4282-8e70-d9e5795720e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Python dictionaries saved to models

2016-08-17 Thread Aaron Weisberg
Hi everyone,

I have several dictionaries that I would like to import into my django 
project database, but I can't figure out exactly how.

I have tried to implement through fixtures, through views and through 
loaddata, but I must be doing something wrong at every turn- so if someone 
could suggest a workflow, it would really help me a lot!

My data is currently in a list of dictionaries called data:

Enter code here...data = [{'pos': 'position', 'player': 'name', 'ht': 
'height', 'wt': 175, 'birth': 'September 9, 1967', 'college': 'university', 
'number': 10, 'exp': 1},


each dictionary within that list is a "player" who I'd like to input his 
data into my model "Players"

Enter code here...
#models.py
class Player(models.Model):

number = models.CharField(max_length=2)
player = models.CharField(max_length=50)
position = models.CharField(max_length=2)
height = models.CharField(max_length=50)
weight = models.CharField(max_length=50)
birth = models.DateField()
exp = models.CharField(max_length=50)
college = models.CharField(max_length=50)
def __str__(self):
return self.player


There are about 500 players in that list of dictionaries above that I would 
like to insert into this model.

1) Can i run a function in the model above to insert the data into its 
appropriate field?  If so, how do I execute that function?
2) If it's a view that I need to execute-  do I just put the function in 
views.py?  How then is the dictionary imported into the database?

or... How would you go about getting that data into your database?  Please 
note that the data is coming from a url that might change from time to 
time.  But I think once i get the first iteration of data into these models 
I can figure out how to update.  But the only way I can figure out is to 
create them one by one in the shell or create a form and input them one by 
one.

If you have a solution, please share and be as detailed as possible since I 
am a complete beginner with django.    

Peace and love,

Aaron

-- 
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/83fa4e0a-c2b7-4c11-a78e-bd58c5df18b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-Dashing

2016-05-06 Thread Aaron C. de Bruyn
Can you provide us with a little more detail?  What isn't working?  What
error messages are you getting?

I haven't touched it in about a year.  You might also consider getting
support by going here: https://github.com/talpor/django-dashing/issues/new

-A

On Fri, May 6, 2016 at 12:51 PM, Foridur Kayes Shawon <
shawon.ka...@gmail.com> wrote:

> I am trying to work with django-dashing but some thing is going wrong.
> Please give me some direction that would actually 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/6718af5d-1f9e-4550-86fc-443bbc6be6a4%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/CAEE%2BrGpz17C0KBSyCS0uoyvAZ2V7bzBQ0_dt3umCZjjrZL%3Drsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing data before committing to data base, wait for approval of admin

2016-05-04 Thread Aaron Cannon
I'd probably just keep a seperate table for all the edits, with a
foreign key pointing back to the record to be updated.  Seems like the
simplest layout to me, unless there's some complicating factor I'm
overlooking.

It would have a field for each field that edits can be suggested for,
a foreign key pointing to the person who suggested the edit, and
perhaps a flag for approved, rejected, or pending.  You might also
want to allow the data fields to be blankable and nullable, so you can
distinguish between a field where no edit was suggested, and one that
was suggested to be emptied, provided that there's a way for the user
to make that distinction in the user interface.

Not sure if this is what you were looking for or not.

Aaron

On 5/4/16, Mark <mark.p.p...@gmail.com> wrote:
>
>
> I'm building a mobile app using Ionic framework, so the front end is
> essentially a single page AngularJS app. I'm using Django Rest framework as
>
> the backend.
>
> In the application, an employee should be able to suggest updates, deletes,
>
> or additions to database models. In my schema, there is a "Contact person"
> model (which has fields like first_name, last_name, phone_number, etc.), a
> "GPS Address model" (which has fields like street_name, street_num, city,
> etc.) and an overarching "Delivery stop" model to which virtually all of
> the other models relate.
>
>
> What I need to implement is a system whereby an employee can suggest an
> edit to an existing object, say a Contact (id: 45, first_name: 'John',
> phone_number: "435-") which has a FK relationship to a Delivery Stop
> (id: 20, title: "Stop and Shop", notes: "closes at 0600"). The employee
> wants to update the phone number to "435-0001". But the update shouldn't be
>
> committed to the database until a manager has reviewed the update and
> approved, or edited the update then approved.
>
>
> I have a few ideas about how I might do this, but none of them seem as easy
>
> as I think it could be. Does anyone have any suggestions about best
> practices in this situation?
>
> The application will also include a special manager interface where they
> can few all suggested updates/edits and approve/reject them. The client
> side essentially functions with the Delivery Stop as the primary object,
> which shows all related items in a tabbed interface (Contacts, Gps
> addresses, etc.) And each time an edit is suggested by an employee, the
> appropriate manager will receive an email notification.
>
>
> Any suggestions are much 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+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/99fecded-f6f7-4d3a-8876-44e83a3ce007%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/CAERFoOhMpe9knkOebze743cNFWs-X3GNH2kq9WV1jLJ50-FORA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Querying a model with a ForeignKey

2016-05-03 Thread Aaron Cannon
I fear doing this efficiently is beyond my limited abilities.  Will
look forward to other answers you might get.

Good luck.

Aaron

On 5/3/16, ofeyofey <shanegib...@gmail.com> wrote:
> Aaron thanks for looking at this.
> I understand what you did now, and that is great.
> But I actually realised that the views I showed are not the correct ones
> and the view I want to do this in called 'init' actually has no id.
> So How might I get one instance of each topic where if there is more than
> one instance I get the latest one only?
>
> Here is the view i should have posted.
>
> def init(request):
> # tModel = reversed(TopicModel.objects.all())
> # pModel = reversed(PostModel.objects.all())
> pModel =
> reversed(PostModel.objects.filter(topicid_id=pk).order_by('-pub_date')[0])
> # context = {'tModel': tModel, 'pModel': pModel}
> context = {'pModel': pModel}
> return render(request, 'forum.html', context)
>
> Thanks again,
>
>
> On Tuesday, 3 May 2016 18:43:53 UTC+1, ofeyofey wrote:
>>
>> I have two tables in a sqlite3 DB, PostModel and TopicModel. The PostModel
>>
>> has fields id, post, author, pub_date and topicid. This last fields
>> topicid
>> has a foreignkey to the other table Postmodel. PostModel has the fields
>> id,
>> topic.
>> There is a one-to-many relation from the TopicModel to the PostModel. So a
>>
>> Topic can have many posts but a post can only have one topic.
>> I would like to create query the PostModel to get the latest post for each
>>
>> topicid.
>> So something like, SELECT PostModel.topicid WHERE date_pub is the latest.
>>
>> But i would like to use the Django Query API not SQL.
>> My models look like this,
>>
>> class TopicModel(models.Model):
>> topic = models.CharField(max_length=300)
>> extra = models.CharField(max_length=100)
>>
>> def __str__(self):  # __unicode__ on Python 2
>> return self.topic
>>
>> class PostModel(models.Model):
>> post = HTMLField(blank=True)
>> pub_date = models.DateTimeField('date published')
>> author = models.CharField(max_length=30)
>> topicid = models.ForeignKey(TopicModel, related_name = 'topicThing')
>>
>> def __str__(self):  # __unicode__ on Python 2
>> return self.post
>>
>> Here is the view
>>
>> def thread(request, id):
>> if request.method == "POST":
>> print 'we are inside POST'
>> pk = id
>> tform = get_object_or_404(TopicModel, pk=id)
>> Pform = PostForm(request.POST)
>> if Pform.is_valid():
>> # tform = Tform.save(commit=False)
>> pform = Pform.save(commit=False)
>> pform.topicid = tform
>> # pform.topicid = pk
>> pform.author = request.user
>> pform.pub_date = timezone.now()
>> pform.save()
>> # return redirect('post_detail', pk=post.pk)
>> return redirect('thread', id)
>> else:
>> pk=id
>> pModel = reversed(PostModel.objects.all().filter(topicid_id=pk))
>> postform = PostForm()
>> return render(request, 'thread.html', {'pModel': pModel, 'postform' :
>>
>> postform})
>>
>> 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/a0a43100-4172-4054-aaf2-0302a8a13cbe%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/CAERFoOizm8XcqnQqtKv6SZjn3GuZHGd%2BZHjnL9gu2hcFvob4cA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Querying a model with a ForeignKey

2016-05-03 Thread Aaron Cannon
Does

pModel = PostModel.objects.filter(topicid_id=pk).order_by('-pub_date')[0]

work for you?

Also, I believe it would be more conventional if you named your
topicid field simply topic, your post field as body, and your topic
field as name.

Luck.

Aaron

On 5/3/16, ofeyofey <shanegib...@gmail.com> wrote:
> I have two tables in a sqlite3 DB, PostModel and TopicModel. The PostModel
> has fields id, post, author, pub_date and topicid. This last fields topicid
>
> has a foreignkey to the other table Postmodel. PostModel has the fields id,
>
> topic.
> There is a one-to-many relation from the TopicModel to the PostModel. So a
> Topic can have many posts but a post can only have one topic.
> I would like to create query the PostModel to get the latest post for each
> topicid.
> So something like, SELECT PostModel.topicid WHERE date_pub is the latest.
> But i would like to use the Django Query API not SQL.
> My models look like this,
>
> class TopicModel(models.Model):
> topic = models.CharField(max_length=300)
> extra = models.CharField(max_length=100)
>
> def __str__(self):  # __unicode__ on Python 2
> return self.topic
>
> class PostModel(models.Model):
> post = HTMLField(blank=True)
> pub_date = models.DateTimeField('date published')
> author = models.CharField(max_length=30)
> topicid = models.ForeignKey(TopicModel, related_name = 'topicThing')
>
> def __str__(self):  # __unicode__ on Python 2
> return self.post
>
> Here is the view
>
> def thread(request, id):
> if request.method == "POST":
> print 'we are inside POST'
> pk = id
> tform = get_object_or_404(TopicModel, pk=id)
> Pform = PostForm(request.POST)
> if Pform.is_valid():
> # tform = Tform.save(commit=False)
> pform = Pform.save(commit=False)
> pform.topicid = tform
> # pform.topicid = pk
> pform.author = request.user
> pform.pub_date = timezone.now()
> pform.save()
> # return redirect('post_detail', pk=post.pk)
> return redirect('thread', id)
> else:
> pk=id
> pModel = reversed(PostModel.objects.all().filter(topicid_id=pk))
> postform = PostForm()
> return render(request, 'thread.html', {'pModel': pModel, 'postform' :
> postform})
>
> 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/8dc3a17e-850e-4b5f-91d3-1909c45f97a8%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/CAERFoOh_yYMqNrnKu4SwQs0VGYXKvJJ9cX8QEj2SfwFaWsXU-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Complex content type

2016-05-02 Thread Aaron Cannon
To your Answer class, you could just add a field like:

question = models.ForeignKey(Question, on_delete=models.CASCADE)

It may be as simple as that.

Does that help?

Aaron

On 5/2/16, ludovic coues <cou...@gmail.com> wrote:
> There is such example in the django girls tutorial I linked earlier.
>
> 2016-05-02 15:48 GMT+02:00 Said Akhmedbayev <said@gmail.com>:
>> Ludovic, would you be so kind to help me and put together some example
>> code
>> of what I should  place in the forms.py and the views.py? I would greatly
>> appreciate.
>>
>> On Monday, May 2, 2016 at 4:25:13 PM UTC+6, ludovic coues wrote:
>>>
>>> You might want to add a foreign key in the answer model pointing to
>>> the question.
>>> Then in the view to show the form, create an answer object with it's
>>> question FK assigned to the question and create a form from that
>>> answer. In the view processing the form, you should get that object
>>> back, with the question and the text filled. Complete it with the
>>> user, as shown in the django girls tutorial and save your answer.
>>>
>>>
>>>
>>> 2016-05-02 11:57 GMT+02:00 Said Akhmedbayev <said...@gmail.com>:
>>> > Thank you ludovic and sorry for not being able to clearly explain what
>>> > I
>>> > want to do :-(. You are right, I want to show a user a simple django
>>> > form,
>>> > but I cannot figure out how to save an individual answer alone with
>>> > its
>>> > correspondence question's id and user's id
>>> >
>>> > So my table for "Answer" model will look like:
>>> >
>>> > user_id   question_id answer
>>> >  0101 text of an answer
>>> >  0102 text of an answer
>>> >  0201 text of an answer
>>> >  0202 text of an answer
>>> >  0301 text of an answer
>>> >  0302 text of an answer
>>> >
>>> >
>>> >
>>> >
>>> > On Monday, May 2, 2016 at 3:25:06 PM UTC+6, ludovic coues wrote:
>>> >>
>>> >> I have some trouble trying to understand what you means by "content
>>> >> type".
>>> >> That terms refer to the content of a file. For exemple, text/plain
>>> >> for
>>> >> plain
>>> >> text file or image/png for an image encoded as png.
>>> >> What you show look like a standard form. If you need basic pointer on
>>> >> how
>>> >> to use a form, saving it's data along with current logged-in user,
>>> >> you
>>> >> might
>>> >> want to have a look at the django girls tutorial. Specifically,
>>> >> http://tutorial.djangogirls.org/en/django_forms/ is about django
>>> >> forms.
>>> >>
>>> >> 2016-05-02 8:23 GMT+02:00 Said Akhmedbayev <said...@gmail.com>:
>>> >>>
>>> >>> Avraham, I understand that the content type is not any special or
>>> >>> complex
>>> >>> for you. Probably, I should wrote "complex content type for me".
>>> >>> Anyways,
>>> >>> can you provide any instructions for how can make this kind of
>>> >>> content
>>> >>> type?
>>> >
>>> > --
>>> > 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/fdbc2c01-2059-406d-93fe-762d9fdc4a73%40googlegroups.com.
>>> >
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>>
>>> Cordialement, Coues Ludovic
>>> +336 148 743 42
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>&g

Re: Is it good idea to transition from MS Access to a webapp? And if so, is Django a good tool to do it?

2016-05-01 Thread Aaron Cannon
On the other hand, if you don't anticipate hundreds of users, then a
cheaper option like Digital Ocean may meet your needs better.  There
minimal servers start at $5/month.

Don't get me wrong, I love Aws, and I use it all the time.  It just
sounded like your needs were modest, so thought that might be a better
fit.

Aws may have a bit better stability than DO in the long run, but for
the apps I run there, uptime has not posed a problem so far.

Good luck with your app, and have fun.  I know I certainly have with
this framework.

Aaron

On 4/29/16, Fred Stluka <f...@bristle.com> wrote:
> Patrik,
>
> I host the servers of all my clients at AWS (Amazon Web Services).
>
> I'd suggest you start by running the DB server (MySQL, PostgreSQL
> or whatever) on the same Linux server as the Web server (Apache,
> nginx or whatever).  Have the Web server handle all the static files
> (HTML., JS, CSS, image) and forward the Django requests via WSGI
> or uWSGI to the Django server on the same Linux server.  You can
> do it all with one AWS EC2 micro instance, which is free for the
> first year, and only $0.02/hour ($15/month) after that.
>
> As your needs grow, you can scale vertically by converting your
> micro instance to a small, medium, large, XL, XXL, etc.  And/or
> you can scale horizontally, by moving the DB server to it's own
> EC2 Linux server or to the AWS RDS service.  And by using AWS
> ELB, Autoscale, ElasticBeanstalk, etc., to manage farms of web
> servers and DB servers, allocating and terminating servers as
> needed to handle the load.  It's a one-line change in the Django
> settings file to point Django to the IP address of an RDBMS on a
> different server.
>
> Or turn the entire ops business over to AWS and just use their
> AWS Lambda service to serve the HTTP requests.  I haven't yet
> done that with Django, so you'd have to look into how well it
> works.
>
> For security reasons, configure Django to use a non-root user
> at the DB server, ideally one with as few privileges as possible.
> And make sure that the DB server is running as a non-root Linux
> user.  It everything accesses everything as root, you have a big
> security risk.  If someone DID succeed in hacking your Django
> app, and became able to get it to execute arbitrary SQL calls,
> they could make an SQL call that causes the DB server to make a
> system call (as root), that could run arbitrary code on your Linux
> server.  So, lock it down at each level, just in case.
>
> For more info about AWS, see:
> - http://bristle.com/Tips/CloudComputing.htm
> - http://bristle.com/Talks/CloudComputing/current/
>
> For direct printer access from a web app, see:
> - http://google.com/search?q=direct+printer+access+from+a+web+app
> Lots of hits, so I'm thinking it must be possible.
>
> --Fred
> 
> Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> 
> On 4/29/16 2:40 PM, Patrik Mjartan wrote:
>>
>> Sorry, I miss-clicked post button and so I will reply twice now.
>>
>> Another important (rather obvious to you I guess) question would be - what
>> is the usual structure of the servers?
>>
>> What I mean is - I assume we don't want to have the actual DB on the same
>> server as where we host the website.
>>
>> Is it usually such that Web server is hosted by some hosting company (so
>> they can make sure it's up 24/7) while DB server is on the premises of the
>> company (ie. the one for which I work for) such that data can be retrieved
>> faster? Although I guess that doesn't make too much sense either, as the
>> data has to be retrieved by web-server first in order to be presented to
>> the user...
>>
>> Overall I'm quite sure that the company I work for would prefer paying
>> some hosting companies to host everything so they don't have to spend
>> money on (potentially) expensive hardware. Is this the standard approach?
>>
>> I'm a total newbie in this area so would appreciate some help ^_^.
>>
>>
>> On Friday, April 29, 2016 at 7:33:58 PM UTC+1, Patrik Mjartan wrote:
>>>
>>> Thank you very much for the reply!
>>>
>>> I went through the tutorial a few days ago and loved it.
>>>
>>> One, very important, question that I forgot to ask - one of the biggest
>>> advantages on having an actual desktop front-end app is having a direct
>>> access to media, such as printers. Hence a simple button click in the app
>>> would result in s

Re: New to Django (stuck at the end of the tutorial)

2016-04-30 Thread Aaron Poncé
Just a related/unrelated sidenote.. I'm also new to Django and I found an 
amazing tutorial series on youtube... Just wanted to share it with you: 

https://youtu.be/FNQxxpM1yOs?list=PLQVvvaa0QuDeA05ZouE4OzDYLHY-XH-Nd

It's a 12 part series and it really helped me get the ball rolling



On Tuesday, April 26, 2016 at 12:33:09 AM UTC-7, Cronos Cto wrote:
>
>
> Hello Django Lovers.
>
> So I started on Django as project of mine. Seems like a great first 
> framework to start on. At the moment I am stuck at this:
>
>
>
> 
> This was after what I encountered at the end of the Django oficial post 
> app tutorial.
>
> I tried several ways to solve it. The problem seems to lay in the url.py 
> file, but I can not seem to solve it.
>
>
> 
>
> Thank you to anyone that can help me solve 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4706b1f9-0acb-48d0-b264-a54c252430dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Migration bug in 1.9.5?

2016-04-12 Thread Aaron C. de Bruyn
* My project has been around since the Django 1.2 days.
* Some time around 1.8.x I ran squashmigrations and everything worked
perfectly.
* I've done lots of migrations since then.
* I updated the app to Python 3.
* Everything was working perfectly

I just did my first makemigration under python 3.  Specifically I added a
Boolean 'enabled' field to a model.

The migration appears to have been created properly, but when I try to run
the 'migrate' command, it tries to apply
0001_squashed_0009_auto_20150109_1447.

I tried to fake it by running 'manage.py migrate myapp 0001 --fake' and it
says it applied (faked).
Running 'manage.py migrate' shows it trying to apply the 0001_squashed...
migration again.

I also tried using the --fake-initial flag with no luck.

'showmigrations' show every migration since the squash has been applied,
just not the squashed migration or the most recent one I just created:

myapp
 [ ] 0001_squashed_0009_auto_20150109_1447 (9 squashed migrations)
 [X] 0010_auto_20150109_1824
 [X] 0011_auto_20150818_1946
 [X] 0012_auto_20150829_1610
 [X] 0013_auto_20150829_1610
 [X] 0014_auto_20150829_1618
 [X] 0015_auto_20150829_1618
 [X] 0016_remove_internetprovider_old_phone
 [X] 0017_office_linked_location
 [X] 0018_auto_20150829_2345
 [X] 0019_office_pib_version
 [X] 0020_auto_20150908_1643
 [X] 0021_internetservice_notes
 [X] 0022_office_last_router_backup_alert
 [ ] 0023_auto_20160412_1433

How can I get the system to recognize that 0001_squashed... has been
applied already?

Thanks,

-A

-- 
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/CAEE%2BrGrgYE-Dp9iVeZHV_%3Dh8nSqFwTwydb3yfoo2e8M20ViQ0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fabric - Someone has a fabfile to build a Sentry server?

2016-04-05 Thread Aaron C. de Bruyn
Another fun way to deploy it is to a dokku (or Heroku) server.

Create a git repo with a requirements.txt that includes:
sentry[postgres]
psycopg2

Create a Procfile:
web: sentry --config=sentry.conf.py start
workers: sentry --config=sentry.conf.py celery worker -B

And finally a sentry.conf.py with the appropriate settings.

'git push' and wait a few minutes.

-A



On Tue, Apr 5, 2016 at 5:36 PM, Mario Gudelj  wrote:

> Look for fabulous on GitHub. It sets up all of that on ec2.
>
>
> On Wednesday, 6 April 2016, Neto  wrote:
>
>> I need a fabric to install Sentry, Redis, and configure the server with
>> nginx template, supervisor etc.
>> I have a Amazon Instance, and I want with a command install everything.
>> I have following the docs, but I had problem with sentry-worker
>> (supervisor).
>> My server also was too slow
>>
>> Em terça-feira, 5 de abril de 2016 15:54:07 UTC-3, Neto escreveu:
>>>
>>> I need to build a server using nginx to run sentry, I needed a routine
>>> to install all the necessary packages, and configure the server.
>>> I am using Ubuntu, Nginx, Django.
>>>
>> --
>> 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/a6b376d4-2c3d-49ae-a71d-aab60069ffde%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/CAHqTbjmXzRh2r91a08n7YOayoWuKWNyFqZkJ%3DvTh94sn15HtCA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: NAS using Django

2016-03-10 Thread Aaron C. de Bruyn
Take a look at FreeNAS.  They are running FreeBSD with a Django front-end
that configures (among other things) Samba shares and Samba AD/domain joins.

-A

On Wed, Mar 9, 2016 at 11:03 PM, Vayuj Rajan <vayu...@gmail.com> wrote:

> Actually, I saw a NAS at my friends place so I came up with an idea a of
> creating my own using a raspberry pi and an extrernal HDD.
> I configured SAMBA and I can access it directly at my computer. But what I
> saw there that he was accessing it by using a  website . So basically he
> was accessing it from local web server with a storage attached.
>
> So, I wanted to connect my Django web application with Samba File sharing
> sever so that I can access it from an IP typed at a web-browser.
>
> On Wed, Mar 9, 2016 at 10:03 PM, Aaron C. de Bruyn <aa...@heyaaron.com>
> wrote:
>
>> That's still pretty vague.  What 'file sharing protocols' are you talking
>> about specifically?  And what do you mean by wanting to 'connect' the file
>> sharing protocols to the application?
>>
>> There is a PySMB library that will allow your Django application to
>> pretend to be a Windows client.
>>
>> If you're just talking about having the Django application display
>> existing files/mounts, there are various built-in tools for that.
>>
>> You might want to take a look at the FreeNAS project.  They have a Django
>> application running as a front-end to their FreeNAS appliance.
>>
>> -A
>>
>> On Wed, Mar 9, 2016 at 4:50 AM, Vayuj Rajan <vayu...@gmail.com> wrote:
>>
>>> What I wanted to do is to connect the file sharing protocols to this web
>>> application i.e the one I will be making it from Django and I wanted to
>>> host this application using apache so that it can be hosted locally.
>>>
>>> On Wednesday, March 9, 2016 at 6:05:51 PM UTC+5:30, Andréas Kühne wrote:
>>>>
>>>> Hi Vayuj,
>>>>
>>>> I think you have to be a bit more specific. Django is a web framework,
>>>> used for creating web applications and websites. A NAS is usually an array
>>>> of harddrives that has different file sharing protocols attached (for
>>>> example SMB or NFS).
>>>>
>>>> It would be possible to implement something like Amazons S3 in django
>>>> however if that is what you want?
>>>>
>>>> Regards,
>>>>
>>>> Andréas
>>>>
>>>> 2016-03-09 12:09 GMT+01:00 Vayuj Rajan <vay...@gmail.com>:
>>>>
>>>>> Hi,
>>>>> I have a query whether we can implement NAS (network attached storage)
>>>>> functionality using Django framework?
>>>>>
>>>>> --
>>>>> 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/9a9914d7-37cf-4608-892a-2f0a08b001a1%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/9a9914d7-37cf-4608-892a-2f0a08b001a1%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>> 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/fe72a195-2815-42ef-867c-6245d9e62d1c%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/fe72a195-2815-42ef-867c-6245d9e62d1c%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>

Re: NAS using Django

2016-03-09 Thread Aaron C. de Bruyn
That's still pretty vague.  What 'file sharing protocols' are you talking
about specifically?  And what do you mean by wanting to 'connect' the file
sharing protocols to the application?

There is a PySMB library that will allow your Django application to pretend
to be a Windows client.

If you're just talking about having the Django application display existing
files/mounts, there are various built-in tools for that.

You might want to take a look at the FreeNAS project.  They have a Django
application running as a front-end to their FreeNAS appliance.

-A

On Wed, Mar 9, 2016 at 4:50 AM, Vayuj Rajan  wrote:

> What I wanted to do is to connect the file sharing protocols to this web
> application i.e the one I will be making it from Django and I wanted to
> host this application using apache so that it can be hosted locally.
>
> On Wednesday, March 9, 2016 at 6:05:51 PM UTC+5:30, Andréas Kühne wrote:
>>
>> Hi Vayuj,
>>
>> I think you have to be a bit more specific. Django is a web framework,
>> used for creating web applications and websites. A NAS is usually an array
>> of harddrives that has different file sharing protocols attached (for
>> example SMB or NFS).
>>
>> It would be possible to implement something like Amazons S3 in django
>> however if that is what you want?
>>
>> Regards,
>>
>> Andréas
>>
>> 2016-03-09 12:09 GMT+01:00 Vayuj Rajan :
>>
>>> Hi,
>>> I have a query whether we can implement NAS (network attached storage)
>>> functionality using Django framework?
>>>
>>> --
>>> 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/9a9914d7-37cf-4608-892a-2f0a08b001a1%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/fe72a195-2815-42ef-867c-6245d9e62d1c%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/CAEE%2BrGpsfTR_SH2jJk%2B3F3PxNLAmvgQYsd%3D9a4FHFSpJu3xvbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[no subject]

2016-02-29 Thread Aaron C. de Bruyn
A simple annotation broke when I migrated by app from Django 1.8.x to
1.9.2, and I can't figure out why for the life of me.

Calling Company.objects.all().annotate(ticketcount=Count('srservice'))

throws an error "ProgrammingError: column "company.owner_id" must appear in
the GROUP BY clause or be used in an aggregate function"

Rolling back to Django 1.8.5 fixes the problem.
The DB backend is Postgres.

Please ignore the horrible DB schema.  It's not mine.  It's an
introspection of a horrible Windows ticketing app.

Models and traceback here:
https://gist.github.com/darkpixel/e8f494038d5192225901

Am I missing something?

-A

-- 
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/CAEE%2BrGrHkeqoH642%3DA%3D0w4DnC%3D2T8xzfignQOjh5BLLMto5f3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Concatenate complex views

2016-01-13 Thread Aaron C. de Bruyn
I may be missing something, but couldn't you use a generic ListView and
something like:

{% for car in car_list %}
  Car Make: 
  ...etc
{% endfor %}

Don't include a  tag or a submit button and you should get something
that looks like a form, but is read-only.
Maybe even disable the input box so it still looks like a normal input box,
but you can't click/type in it.

-A

On Wed, Jan 13, 2016 at 1:37 PM, Arnab Banerji  wrote:

> Hi - I am trying to concatenate "read-only" form views of all objects
> pertaining to a given model in a single page (I already have a template for
> viewing the form for one object). Given that the forms are reasonably
> complex (in some cases involving formsets), a simple "inclusion tag"
> approach does not work for me (since that requires a simple dictionary).
> Any ideas on what to do here?
>
> Example: a "print all cars" button in a car inventory app, which prints
> out a concatenation of all the car views in the inventory. Eventually, that
> can be exported to a PDF - to be viewed as a comprehensive inventory list.
>
> Thanks!
> -AB
>
> --
> 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/71d15faf-029f-4412-bfc8-dada465f0727%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/CAEE%2BrGodwfWU2QT%3D8%2B%2Bxvrp8ao0%2BbwkSnArBHMT1L-%3DrfNLuVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to display a image which is generated in the backend with Django

2015-11-22 Thread Aaron C. de Bruyn
If I recall correctly, the 'wc' object would need to be a file object.  You
could assign it similar to this:

from django.core.files import File
wc = File(open('/path/to/image', 'r'))
user.userprofile.tagcloud = wc
user.userprofile.save()

If the 'wc' variable returned by your program is already a file-like
object, you don't have to perform the 'open' step.

MEDIA_ROOT and MEDIA_URL can be whatever you want.  The ROOT is where the
files will be stored on disk, and the URL is where they should be
accessible via URL.  For example, most of my projects have:

MEDIA_URL = '/media/'
MEDIA_ROOT = 'media'

To display it in a template, try something like:


It's been a while since I've used ImageFields, hopefully someone can
correct me if I missed something.

-A


On Sun, Nov 22, 2015 at 8:23 AM, rylanlee  wrote:

> I am new to django and I am confused with the image display problem. Now I
> have a image of word-cloud generated in the backend(let's say,
> topicWords.py) and I don't know hot to deal with it. (1) How can I store it
> in the image field of model UserProfile? In the models.py, I have:
>
> class UserProfile(models.Model):
> user = models.OneToOneField(User)
> tagcloud = models.ImageField(upload_to ='rap_song/raptle/pic/')
>
> Is it right to directly do like:
>
> user.userprofile.tagcloud = wc #wc is the image generated
>
> (2) What should the setting of MEDIA_ROOT and MEDIA_URL be?
>
> (3) How should I display it in the .html?
>
> 
>
> Thank you very much!
>
> --
> 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/53934b58-f17b-469a-9765-981612d9ae29%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGq-bAW1b%3DiD4DdRONbDKOOe0XTQAEM1PVZioA%3DFr1g%2Bfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Search capability on Django 3.1.3 (Haystack)

2015-11-09 Thread Aaron C. de Bruyn
Without any specific information on the problems you are having, here
is a link to the Haystack search tool:
http://haystacksearch.org/

If you can provide us with more detail, we would be happy to help.

-A

On Sun, Nov 8, 2015 at 11:06 PM, nAncy sharma  wrote:
> Hi there,
>
> I am building a website using Django cms 3.1.3 !
> I am facing problem in implementing search capability (Haystack
> elasticsearch) .Could you provide me with someuseful links? And is the
> Django cms VERSION (3.1.3) also an issue because of which i am not able to
> implement it ?
>
> Thank you in advance!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/196c68ea-7510-40b8-ac28-9f38a813d4ac%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGoSVei9LhYiJgqrXxUkUy0DneA8Uuu5K7f7qmoJK4CoBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Random auth_permission + content_type errors during test runs

2015-11-02 Thread Aaron Lelevier
 
 Russel,

Thank you for posting this great answer on why this error may be occurring. 
 I was getting this error, and for the life of me (1-2 days), couldn't 
figure out the issue.  Thank you!!

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


Re: Random auth_permission + content_type errors during test runs

2015-11-02 Thread Aaron Lelevier
Russell,

Thank you for posting this great answer on why this error may be occurring. 
 I was getting this error, and for the live of me (1-2 days), couldn't 
figure out the issue.  Thank you!!


On Wednesday, April 2, 2014 at 2:23:48 PM UTC-7, Russell Keith-Magee wrote:
>
>
> On Wed, Apr 2, 2014 at 1:23 PM, Greg Taylor  > wrote:
>
>> I've got a project running Django 1.4, Postgres 3, Python 2.7. Our tests 
>> get about halfway through, then we get a sudden flood of errors showing 
>> that the django_content_type table may be empty:
>>
>>
>> ..EE
>>
>> Once the errors stop, they continue to the end of the test run. Here's 
>> the traceback for all of the errors:
>>
>> Traceback (most recent call last): 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/test/testcases.py",
>>  
>> line 502, in __call__ 
>>
>> self._pre_setup() 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/test/testcases.py",
>>  
>> line 463, in _pre_setup 
>>
>> self._fixture_setup() 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/test/testcases.py",
>>  
>> line 475, in _fixture_setup 
>>
>> call_command('flush', verbosity=0, interactive=False, database=db) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 150, in call_command 
>>
>> return klass.execute(*args, **defaults) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/raven/contrib/django/management/__init__.py",
>>  
>> line 37, in new_execute 
>>
>> return original_func(self, *args, **kwargs) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/base.py",
>>  
>> line 232, in execute 
>>
>> output = self.handle(*args, **options) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/base.py",
>>  
>> line 371, in handle 
>>
>> return self.handle_noargs(**options) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/commands/flush.py",
>>  
>> line 77, in handle_noargs 
>>
>> emit_post_sync_signal(set(all_models), verbosity, interactive, db) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/core/management/sql.py",
>>  
>> line 189, in emit_post_sync_signal 
>>
>> interactive=interactive, db=db) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
>>  
>> line 172, in send 
>>
>> response = receiver(signal=self, sender=sender, **named) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>>  
>> line 54, in create_permissions 
>>
>> auth_app.Permission.objects.bulk_create(objs) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/db/models/manager.py",
>>  
>> line 140, in bulk_create 
>>
>> return self.get_query_set().bulk_create(*args, **kwargs) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 421, in bulk_create 
>>
>> transaction.commit(using=self.db) 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/db/transaction.py",
>>  
>> line 153, in commit 
>>
>> connection.commit() 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/db/backends/__init__.py",
>>  
>> line 234, in commit 
>>
>> self._commit() 
>>
>> File 
>> "/home/cbweb/.virtualenvs/coursebook/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py",
>>  
>> line 235, in _commit 
>>
>> return self.connection.commit() 
>>
>> IntegrityError: insert or update on table "auth_permission" violates 
>> foreign key constraint "content_type_id_refs_id_728de91f" 
>>
>> DETAIL: Key (content_type_id)=(1) is not present in table 
>> "django_content_type".
>>
>>
>> This is pretty bizarre, but it's probably something we're doing. Has 
>> anyone ran into something like this before? I can't find anywhere that 
>> we're deleting content types (which the error seems to suggest is 
>> happening).
>>
>
> Hi Greg,
>
> It's not a common error, but I have seen it. 
>
> There are two possible causes.
>
> The first is a bad fixture. If your test has a fixture file, and that 
> fixture file includes or references a permission by primary key value, 
> you'll have problems. This is because content types are programmatically 
> allocated at runtime, and the order (and thus the IDs) aren't 
> deterministic. If you reference ID X, there's no guarantee that X will 
> 

Re: Password protect content

2015-11-02 Thread Aaron C. de Bruyn
You might want to check out Apache .htaccess files for securing the files.
Django sounds like it might be overkill for password protecting files.

-A

On Mon, Nov 2, 2015 at 8:37 AM, Andrew S  wrote:
> Hello,
>
> I have a folder full of HTML files that will reside on a subdomain.
>
> I would like to password protect these with user accounts etc.
>
>
> Can this be easily completed with Django? is there any packages that already
> do this?
>
>
>
> Andrew
>
> --
> 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/25c9b615-5cfd-492b-b8f4-a6571fa982d7%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGo_oVkqBC01SCrSJaT0d003Pk%2BqjF0v-%2BwW3QzFL9qn_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Team project via Git repo

2015-10-13 Thread Aaron C. de Bruyn
Oops--almost forgot.  Create a .gitignore in your ~/code/carsite file
before you commit your changes and push them to GitHub.

https://www.gitignore.io

-A

On Tue, Oct 13, 2015 at 7:00 PM, Aaron C. de Bruyn <aa...@heyaaron.com> wrote:
> Without knowing too much about your environment, I figured I'd tell
> you how I do it on my Debian-derivative systems.
>
> * Install python-virtualenv and virtualenvwrapper - These tools help
> you create isolated python environments under your home folder under
> '.virtualenv'.
> * Create a virtualenv for the project.  If my project name is CarSite
> I run 'mkvirtualenv carsite'.  (After the virtualenv is created it
> should leave you *inside* the virtual environment)
> * Install the latest version of Django into your virtual env by
> running 'pip install django'
> * Create your project by going in to your code folder (this is
> different than your virtualenv) "cd ~/code" and then creating the
> project "django-admin startproject carsite"
> * Go in to the carsite directory "cd ~/code/carsite"
> * Create a requirements.txt file for other developers ('pip freeze >
> requirements.txt')
> * Turn it into a git repo "git init ."
> * Commit your new project (or make changes, then commit) "git commit
> -m 'My first commit'"
> * Connect it to github by following their directions (something like
> 'git remote add origin g...@github.com:username/carsite.git' and then
> 'git push -u origin master')
>
> Now other developers should be able to start working on the project by
> doing the following:
> * cd ~/code
> * git clone g...@github.com:username/carsite.git carsite
> * cd ~/code/carsite
> * mkvirtualenv -r requirements.txt
>
> -A
>
>
>
> On Tue, Oct 13, 2015 at 5:38 PM,  <rhc.open...@gmail.com> wrote:
>> Just to update: we also tried simply copying the entire virtual environment
>> across, correcting for any differences in path. Still go the same behavior.
>>
>> We'd really welcome some advice on this one as otherwise we won't be able to
>> use Django - we need a way to collaborate on implementation.
>>
>> Thanks
>> Ralph
>>
>>
>> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
>>>
>>> Hi folks
>>>
>>> I'm a Django newbie (have found it very helpful!), so please excuse the
>>> naivete. I have a question regarding team work on a Django project via
>>> GitHub.
>>>
>>> I followed your excellent tutorial and have a virtual Python v2.7
>>> environment with Django 1.8.5 installed in it (FWIW: I thought I installed
>>> Django 1.11, but django-admin --version shows 1.8.5). I then created my app
>>> using "django-admin startproject foo" and got the project subdirectory as
>>> expected. A quick check of the server showed the "Welcome to Django" page.
>>>
>>> I then added a bunch of model definitions and customized the admin page. I
>>> verified that everything was okay by looking at the admin web page on my
>>> localhost - the customized page is there, and I was able to add some test
>>> data for one of the models. At this point, others want to pitch in to help,
>>> and so I bundled everything in my project subdirectory (including manage.py
>>> and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
>>>
>>> The other team members also setup a virtual environment with Django, using
>>> the same versions, and activated it. They then cloned the GitHub repo and
>>> got all the project files as expected, and the directory structure looks
>>> exactly the same.
>>>
>>> However, when they runserver in the project, they only get the "Welcome to
>>> Django" page. The project admin and login page doesn't show up. I've
>>> verified that all the model and settings info is correct, but we haven't
>>> been able to get the info to show on the web page.
>>>
>>> Any suggestions on what we are doing wrong? I'm assuming a team can share
>>> a Django project, but suspect we aren't collecting all the relevant files or
>>> not getting the other team's environment set correctly.
>>>
>>> Thanks
>>> Ralph
>>>
>> --
>> 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

Re: Team project via Git repo

2015-10-13 Thread Aaron C. de Bruyn
Without knowing too much about your environment, I figured I'd tell
you how I do it on my Debian-derivative systems.

* Install python-virtualenv and virtualenvwrapper - These tools help
you create isolated python environments under your home folder under
'.virtualenv'.
* Create a virtualenv for the project.  If my project name is CarSite
I run 'mkvirtualenv carsite'.  (After the virtualenv is created it
should leave you *inside* the virtual environment)
* Install the latest version of Django into your virtual env by
running 'pip install django'
* Create your project by going in to your code folder (this is
different than your virtualenv) "cd ~/code" and then creating the
project "django-admin startproject carsite"
* Go in to the carsite directory "cd ~/code/carsite"
* Create a requirements.txt file for other developers ('pip freeze >
requirements.txt')
* Turn it into a git repo "git init ."
* Commit your new project (or make changes, then commit) "git commit
-m 'My first commit'"
* Connect it to github by following their directions (something like
'git remote add origin g...@github.com:username/carsite.git' and then
'git push -u origin master')

Now other developers should be able to start working on the project by
doing the following:
* cd ~/code
* git clone g...@github.com:username/carsite.git carsite
* cd ~/code/carsite
* mkvirtualenv -r requirements.txt

-A



On Tue, Oct 13, 2015 at 5:38 PM,   wrote:
> Just to update: we also tried simply copying the entire virtual environment
> across, correcting for any differences in path. Still go the same behavior.
>
> We'd really welcome some advice on this one as otherwise we won't be able to
> use Django - we need a way to collaborate on implementation.
>
> Thanks
> Ralph
>
>
> On Tuesday, October 13, 2015 at 2:57:50 PM UTC-7, rhc.o...@gmail.com wrote:
>>
>> Hi folks
>>
>> I'm a Django newbie (have found it very helpful!), so please excuse the
>> naivete. I have a question regarding team work on a Django project via
>> GitHub.
>>
>> I followed your excellent tutorial and have a virtual Python v2.7
>> environment with Django 1.8.5 installed in it (FWIW: I thought I installed
>> Django 1.11, but django-admin --version shows 1.8.5). I then created my app
>> using "django-admin startproject foo" and got the project subdirectory as
>> expected. A quick check of the server showed the "Welcome to Django" page.
>>
>> I then added a bunch of model definitions and customized the admin page. I
>> verified that everything was okay by looking at the admin web page on my
>> localhost - the customized page is there, and I was able to add some test
>> data for one of the models. At this point, others want to pitch in to help,
>> and so I bundled everything in my project subdirectory (including manage.py
>> and the initial sqlite3 db) into a git repo and pushed it up to GitHub.
>>
>> The other team members also setup a virtual environment with Django, using
>> the same versions, and activated it. They then cloned the GitHub repo and
>> got all the project files as expected, and the directory structure looks
>> exactly the same.
>>
>> However, when they runserver in the project, they only get the "Welcome to
>> Django" page. The project admin and login page doesn't show up. I've
>> verified that all the model and settings info is correct, but we haven't
>> been able to get the info to show on the web page.
>>
>> Any suggestions on what we are doing wrong? I'm assuming a team can share
>> a Django project, but suspect we aren't collecting all the relevant files or
>> not getting the other team's environment set correctly.
>>
>> Thanks
>> Ralph
>>
> --
> 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/b13c6d50-2a22-40bf-a78d-752a7305914a%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGriRkeB5hZCd713eGvn05BzFnKUG3ASYN8T8vhS0rMdYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Platform.sh alternative for Django?

2015-09-29 Thread Aaron C. de Bruyn
Heroku is another paid alternative.

For myself, I purchase a $5/mo digital ocean server and install
'dokku' (https://github.com/progrium/dokku) so I can 'git push'.

For automated builds I use Drone CI (https://github.com/drone/drone)
which can also be installed on the same (or a separate) server.

If you need more and more resources as things grow (Redis, Postgres,
MySQL, etc...) you can either spin up additional cheap servers, or
'grow' your existing servers.

-A



On Tue, Sep 29, 2015 at 8:38 AM, Radek Svarz  wrote:
> Hi,
>
> there is the https://platform.sh/ for PHP world for Continuous Deployment.
>
> Do you know of something similar for Django apps?
>
> Thanks, Radek
>
> --
> 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/3c25216f-66e8-4c6d-9f95-15dce6dd1975%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGpbVKWps8vLVfg%2B6wE2VA9PTE2QrBvdn0EpjYXdcPgdSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Security News?

2015-08-18 Thread Aaron C. de Bruyn
Er...I totally spaced another bullet point:

* Security list for the application(s) you are using (i.e. django-security)

-A

On Tue, Aug 18, 2015 at 2:29 PM, Aaron C. de Bruyn <aa...@heyaaron.com> wrote:
> I personally follow a few:
> * The security mailing list for the distos I use (mainly ubuntu-security)
> * FullDisclosure mailing list
> * Slashdot ;)
> * SoylentNews
> * Listen to TechSNAP on Fridays (http://www.jupiterbroadcasting.com/)
>
> If you're really hard-core you can get the CVE feeds:
> https://cve.mitre.org/cve/data_updates.html
>
> Hope that helps.
>
> -A
>
>
> On Tue, Aug 18, 2015 at 12:57 PM, Nikolas Stevenson-Molnar
> <nik.mol...@consbio.org> wrote:
>> A question for server admins: how do you stay on top of important security
>> news (e.g., 0-day exploits like Heartbleed, Shellshock, GHOST, etc.)? Do you
>> use feeds, listserves, blogs, Google alerts, Twitter, or some combination
>> thereof?
>>
>> Just curious to see how others handle this. Personally, I use a combination
>> of lists, blogs, and Google alerts. But the alerts have an inherent delay,
>> and I have to remember to check the others.
>>
>> Thanks,
>> _Nik
>>
>> --
>> 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/55D38E33.4060502%40consbio.org.
>> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGogK7SimwgCCQ53D1cXMS4k1kU%3D%3DosskCaFfy7gCt9-aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Security News?

2015-08-18 Thread Aaron C. de Bruyn
I personally follow a few:
* The security mailing list for the distos I use (mainly ubuntu-security)
* FullDisclosure mailing list
* Slashdot ;)
* SoylentNews
* Listen to TechSNAP on Fridays (http://www.jupiterbroadcasting.com/)

If you're really hard-core you can get the CVE feeds:
https://cve.mitre.org/cve/data_updates.html

Hope that helps.

-A


On Tue, Aug 18, 2015 at 12:57 PM, Nikolas Stevenson-Molnar
 wrote:
> A question for server admins: how do you stay on top of important security
> news (e.g., 0-day exploits like Heartbleed, Shellshock, GHOST, etc.)? Do you
> use feeds, listserves, blogs, Google alerts, Twitter, or some combination
> thereof?
>
> Just curious to see how others handle this. Personally, I use a combination
> of lists, blogs, and Google alerts. But the alerts have an inherent delay,
> and I have to remember to check the others.
>
> Thanks,
> _Nik
>
> --
> 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/55D38E33.4060502%40consbio.org.
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGrq8ycaNcDxST74yaHpKE4PC9jYmfOBbzuWfNnEgSMY0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: please suggest me, related to technologies that I should use for facebook like chat

2015-08-10 Thread Aaron C. de Bruyn
On Mon, Aug 10, 2015 at 7:46 AM, JAI PRAKASH SINGH
 wrote:
> Thank you for replay, so i just want to know, if i want to implement in
> django will it work fine ?

That's not really a question about the language.  Developers can do
all sorts of amazing stuff with Django.  I was surprised to find
Disqus was written in Django.  Could I do it?  No.

-A

-- 
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/CAEE%2BrGqruaG9b4r%3DLvGd%3DgXUBPqv%3DB3kLehSD7bd7q2BVnwMXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What Did I Do Right? (url and domain name change)

2015-08-06 Thread Aaron C. de Bruyn
1. DNS doesn't really work that way in most situations.  Your browser
should cache it, your computer should cache it (especially Windows),
and your upstream DNS (usually your router) should cache it.  Your
computer literally stores 'mysite.com' = '1.2.3.4'.  It doesn't store
it per-page, but for the whole domain name.

2. How are the URLs generated in your application?  If your HTML
template literally has:  http://mysite.herokuapp.com/{% url
'home' %}">Home pagethen the only way to update the URLs for
your app would be to edit the template and fix them.  If you are
relying on django-sites to 'know' the base URL for your site, go into
the admin section and click on 'Sites'.  I think it's best practice to
not prefix my URLs with http://whatever...  Just use {% url 'home' %}
as it should return something like '/' for the URL (without
http://mysite.com).

A. Your ALLOWED_HOSTS setting should probably have both domains if you
want your transition to be smooth.  (i.e. the site works through both
URLs).  ALLOWED_HOSTS has no affect on what URLs you application
displays.

B. Definitely not.  Tweak, break, learn.  ;)

Hope that helps.

-A


On Thu, Aug 6, 2015 at 2:03 PM, Malik Rumi  wrote:
> I have 1 model from my django project up and running on django. Before
> adding more models and content, I wanted to use my actual domain name,
> instead of whatever.herokuapp.com. So after I got that straight, I realized
> that while the home page was mysite.com, the links were still
> mystite.herokuapp.com, which I think is a problem. But I also thought there
> had to be an easy fix for this, especially after I saw a post while I was
> searching for solutions that said django only cares about the stuff that
> comes after the domain name. So the first thing I did was change a hardcoded
> link in my navbar from mysite.herokuapp/newpage to mysite/newpage in my dev
> site. But testing it the url still said mysite.herokuapp.com/newpage. Then I
> got an idea, and I just manually changed the url to mysite/newpage and what
> do you know, it came up correctly. then I clicked around and suddenly all
> the pages on my model are coming up that way, which they were not half an
> hour ago. So the question: What did I do right?
>
> Here are my working theories:
>
> 1. The dns change, which I also did half an hour ago, worked for the home
> page immediately (I tested it at the time) but needed to propagate more for
> the other pages to work, which they do now.
>
> 2. By changing the url manually, django just fed the pages as requested
> without concern about the domain part of the url. If I start from
> mysite.herokuapp.com home page, the links still come up with that domain
> name.
>
> But how do I make this both universal and permanent?
>
> A. I could change allowed hosts setting, taking the herokuapp part out
>
> B. Do nothing, it works now and I should leave well enough alone.
>
> C. ? Your answer here ...
>
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3ded9a89-b20f-489d-aadb-667ab62fdb53%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGrft480OFiVv2%3DMLCqxZk6jwsHWTotXhU1hYS5Yv7LBLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help me develop a Job Tracker (?)

2015-07-13 Thread Aaron C. de Bruyn
You might be looking for the FormWizard.

In the latest version of Django, it has been moved to an external
application 
(https://github.com/django/django-formtools/blob/master/docs/wizard.rst).
In older version of Django, it is part of the corp app
(https://docs.djangoproject.com/en/1.7/ref/contrib/formtools/form-wizard/).

-A

On Mon, Jul 13, 2015 at 6:03 AM, Softeisbieger  wrote:
> So I made some progress on this project. I set up the means to manage
> customers, which is pretty basic stuff: I usedCreateView, ListView and the
> like.
>
> Now I have a more complex situation where I am stuck: I am now working on
> creating projects (see models above). Here I have to implement the
> following:
>
> Choose a work flow
> Based on choice in 1. show forms for the project and the different tasks (as
> defined by Workflow and Step). Show presets as defined in Workflow / Step.
>
> My Problem: I don't know how to approach this. Somehow I have to create
> Project / Jobs as indicated by the chosen Workflow. Unfortunately this a bit
> over my head at the moment: Could you give me rough directions on how to
> approach this?  Drop some keywords what is needed to make this 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c3a735a5-8141-4c5b-bf1a-1ed064daf298%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGo9_jcG6Vc238E-7%2Bv7%2BvqeWpKU0%3DHpd5rK%2B%2BPfnO1%3Dyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python & Django.

2015-07-06 Thread Aaron C. de Bruyn
Glad it's working.

-A

On Mon, Jul 6, 2015 at 10:02 AM, Steve Burrus  wrote:
> Well I want to sheeplishly say thwat I DID get Python 3.4.2 going with the
> Django server! I kind of feel like the late Gilda Radner saying "Never
> mind!" in her well-known Saturday Night Live sketch. But to answer your
> question andrew I am using the Windows 10 beta preview version of Windows.
>
> "(steve) C:\Users\SteveB\Desktop\steve\src>python manage.py runserver
> Performing system checks...
>
> System check identified no issues (0 silenced).
> July 06, 2015 - 11:48:25
> Django version 1.8.2, using settings 'proj.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> [06/Jul/2015 11:49:02]"GET / HTTP/1.1" 200 1767
> [06/Jul/2015 11:49:03]"GET /favicon.ico HTTP/1.1" 404 1934"
>
>
>
>
> On Sunday, July 5, 2015 at 10:33:36 AM UTC-5, Steve Burrus wrote:
>>
>> Listen I am having/experiencing some degree of diffilculty in being able
>> to coordinaTE my Pytjhon version with Django. i can easily end up connecting
>> to the [django] server but I have to use python version 2.7.* ins tead of
>> the preferred version 3.4.* ZCan some please help me with this?
>>
>>
>>
>
> --
> 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/83790021-8f76-45ab-894e-4e59404f227d%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGrNJdjBUNrPxJKG3yvuSRuh0OostzU1ZH7K-YJe6X0Qgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python & Django.

2015-07-05 Thread Aaron C. de Bruyn
I have a django project running under Python 3.4, so I don't think
it's a problem with Django.

If you can provide us with *any* information that might clue us in to
what is going on, it would be helpful.

At the moment, all we know is that something doesn't work.

Can you provide information on what version of Linux, Windows, or Mac
you are using?
Commands you are typing in and the responses you are getting?
Does 'python manage.py runserver' produce any output?

Thanks,

-A

On Sun, Jul 5, 2015 at 6:44 PM, Steve Burrus <steveburru...@gmail.com> wrote:
> "Are you getting an error message?" lNo particular error message. But I
> cannot even start to go thru the usual procedure to end up connecting to the
> Django server! It's irrational that for as long as the version 3.4.* of
> python has been out that  I hAvE to still use the old version 2.7.
>
> On Sun, Jul 5, 2015 at 4:52 PM, Aaron C. de Bruyn <aa...@heyaaron.com>
> wrote:
>>
>> Are you getting an error message?
>>
>> Can you describe what is happening (or not happening)?
>>
>> Thanks,
>>
>> -A
>>
>> On Sun, Jul 5, 2015 at 8:33 AM, Steve Burrus <steveburru...@gmail.com>
>> wrote:
>> > Listen I am having/experiencing some degree of diffilculty in being able
>> > to
>> > coordinaTE my Pytjhon version with Django. i can easily end up
>> > connecting to
>> > the [django] server but I have to use python version 2.7.* ins tead of
>> > the
>> > preferred version 3.4.* ZCan some please help me with this?
>> >
>> >
>> >
>> >
>> > --
>> > 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/1d63c599-24ae-416f-8f01-d584c3fd8dfa%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/fAjA0D7wyXM/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/CAEE%2BrGpyXcBm1AszLHXqsaJ2rg7y13u-1SjT9MizNbT6wdx8Cw%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABcoaSDK9Yk%2BxadQMw2Kq3cXpEz4BzDzsbs_JDE8db%3DUFGUOEw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

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


Re: Python & Django.

2015-07-05 Thread Aaron C. de Bruyn
Are you getting an error message?

Can you describe what is happening (or not happening)?

Thanks,

-A

On Sun, Jul 5, 2015 at 8:33 AM, Steve Burrus  wrote:
> Listen I am having/experiencing some degree of diffilculty in being able to
> coordinaTE my Pytjhon version with Django. i can easily end up connecting to
> the [django] server but I have to use python version 2.7.* ins tead of the
> preferred version 3.4.* ZCan some please help me with this?
>
>
>
>
> --
> 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/1d63c599-24ae-416f-8f01-d584c3fd8dfa%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGpyXcBm1AszLHXqsaJ2rg7y13u-1SjT9MizNbT6wdx8Cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How To Activate Django Server.

2015-06-25 Thread Aaron C. de Bruyn
Steve,

You don't appear to be in the same folder as manage.py.

You need to change to the directory that holds your project files.

-A

On Thu, Jun 25, 2015 at 1:35 PM, Steve Burrus  wrote:
> No i am sorry but python manage.py runserver doesn't work! I first tried to
> run it in a newly created virtual environment, it failed. so I just tried to
> run it in the Desktop folder but it still failed. I remember a command which
> had in it "django-admin.py" that I need to type right?
>
>  "C:\Users\SteveB\Desktop>python manage.py runserver
> python: can't open file 'manage.py': [Errno 2] No such file or directory"
>
>
>
> On Thu, Jun 25, 2015 at 12:00 PM,  wrote:
>>
>> On 06/25/15 18:07, Steve Burrus wrote:
>>
>> I am sorry that I hjave to ask about this, since I was recently able to do
>> it, but I have to ask how do I go about going from successfully creating a
>> new virtual environment to then being able to connect to the Django server?
>> I have seen countless videos, on youtube, on how this is done but I simply
>> forgot.
>>
>>
>> python manage.py runserver
>>
>> dragon
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/W_41qowiu8k/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/558C33B3.7030700%40gmail.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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABcoaSDK8Oc_8A6AGRMgDZX4ZVg6FeSCePGbo5YgNmrYCMiQiA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: Trying understand static files.

2015-04-22 Thread Aaron C. de Bruyn
Have you looked through the deployment documentation yet?
(https://docs.djangoproject.com/en/1.8/howto/deployment/)

-A

On Wed, Apr 22, 2015 at 4:35 PM, john  wrote:
> Hi,
> I have created a website that works well under "runserver".  But when I use
> nginx and uwsgi the basic website comes up but it is missing the static file
> information. I have run "manage.py collectstatic" but still no static files
> are used.
>
> Reading the Django doc's tells me that I need the webserver to serve the
> static files.  Ok I think I can do that (maybe).  But I don't understand
> completely.  In my templates I have links like:
> 
>
> How does the nginx server understand to provide the css file for my html
> page from the code above?
>
> I read that I can add a 'location' in the nginx config file but don't
> understand how nginx would understand to provide it when my template is
> called.
>
> Thanks for the help in advance.
>
> Johnf
>
>
> --
> 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/5538303D.2080202%40jfcomputer.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGoERBV7%3DsQ2H%3DcDEKf01KkrBqcCKWrvoBx-SHqQR0B5nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migration on new project fails under 1.8, works under 1.7.7

2015-04-05 Thread Aaron C. de Bruyn
I'll submit a pull request.  Thanks Stephen.

-A

On Sun, Apr 5, 2015 at 7:24 PM, Stephen J. Butler
<stephen.but...@gmail.com> wrote:
> The avatar app is unmigrated and has a reference to the auth.User
> model. References from umigrated apps to migrated apps (which now is
> all of Django core and contrib) isn't supported:
>
> https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies
>
> """Even if things appear to work with unmigrated apps depending on
> migrated apps, Django may not generate all the necessary foreign key
> constraints!"""
>
> I think what was happening is that in 1.7.x Django was not creating
> the Foreign Key constraint and wasn't raising an error on that. In 1.8
> it does, which seems like a better situation to me.
>
> Way to fix it would be to add migrations to avatar. Even a basic
> migration should suffice.
>
> On Sun, Apr 5, 2015 at 6:11 PM, Aaron C. de Bruyn <aa...@heyaaron.com> wrote:
>> This is output from the migrate command against an empty postgres DB.
>>
>>
>> 16:05:39 [aaron@ender:~/code/busybodyweb] [busybody] master* ± python
>> manage.py migrate
>> Operations to perform:
>>   Synchronize unmigrated apps: stronghold, site_basics, gunicorn,
>> djcelery_email, staticfiles, admindocs, messages,
>> kombu_transport_django, djcelery, djangosecure, humanize, avatar,
>> django_extensions, debug_toolbar, raven_compat, bootstrap3
>>   Apply all migrations: sessions, admin, tastypie, auth, sites,
>> contenttypes
>> Synchronizing apps without migrations:
>>   Creating tables...
>> Creating table avatar_avatar
>> Creating table celery_taskmeta
>> Creating table celery_tasksetmeta
>> Creating table djcelery_intervalschedule
>> Creating table djcelery_crontabschedule
>> Creating table djcelery_periodictasks
>> Creating table djcelery_periodictask
>> Creating table djcelery_workerstate
>> Creating table djcelery_taskstate
>> Creating table djkombu_queue
>> Creating table djkombu_message
>> Running deferred SQL...
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 338, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 330, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/base.py",
>> line 390, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/base.py",
>> line 441, in execute
>> output = self.handle(*args, **options)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
>> line 179, in handle
>> created_models = self.sync_apps(connection,
>> executor.loader.unmigrated_apps)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
>> line 317, in sync_apps
>> cursor.execute(statement)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/backends/utils.py",
>> line 79, in execute
>> return super(CursorDebugWrapper, self).execute(sql, params)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/backends/utils.py",
>> line 64, in execute
>> return self.cursor.execute(sql, params)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/utils.py",
>> line 97, in __exit__
>> six.reraise(dj_exc_type, dj_exc_value, traceback)
>>   File 
>> "/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/backends/utils.py",
>> line 62, in execute
>> return self.cursor.execute(sql)
>> django.db.utils.ProgrammingError: relation "auth_user" does not exist
>>
>> 16:06:20 [aaron@ender:~/code/busybodyweb] [busybody] master* 1 ±
>>
>>
>> Then I downgrade to Django 1.7.7 and try again:
>>
>> 16:06:20 [aaron@en

Migration on new project fails under 1.8, works under 1.7.7

2015-04-05 Thread Aaron C. de Bruyn
This is output from the migrate command against an empty postgres DB.


16:05:39 [aaron@ender:~/code/busybodyweb] [busybody] master* ± python
manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: stronghold, site_basics, gunicorn,
djcelery_email, staticfiles, admindocs, messages,
kombu_transport_django, djcelery, djangosecure, humanize, avatar,
django_extensions, debug_toolbar, raven_compat, bootstrap3
  Apply all migrations: sessions, admin, tastypie, auth, sites,
contenttypes
Synchronizing apps without migrations:
  Creating tables...
Creating table avatar_avatar
Creating table celery_taskmeta
Creating table celery_tasksetmeta
Creating table djcelery_intervalschedule
Creating table djcelery_crontabschedule
Creating table djcelery_periodictasks
Creating table djcelery_periodictask
Creating table djcelery_workerstate
Creating table djcelery_taskstate
Creating table djkombu_queue
Creating table djkombu_message
Running deferred SQL...
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 338, in execute_from_command_line
utility.execute()
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/base.py",
line 390, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/base.py",
line 441, in execute
output = self.handle(*args, **options)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
line 179, in handle
created_models = self.sync_apps(connection,
executor.loader.unmigrated_apps)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
line 317, in sync_apps
cursor.execute(statement)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/backends/utils.py",
line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/backends/utils.py",
line 64, in execute
return self.cursor.execute(sql, params)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/utils.py",
line 97, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
  File 
"/home/aaron/.virtualenvs/busybody/local/lib/python2.7/site-packages/django/db/backends/utils.py",
line 62, in execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "auth_user" does not exist

16:06:20 [aaron@ender:~/code/busybodyweb] [busybody] master* 1 ±


Then I downgrade to Django 1.7.7 and try again:

16:06:20 [aaron@ender:~/code/busybodyweb] [busybody] master* 1 ± pip
install django==1.7.7
Downloading/unpacking django==1.7.7
  Downloading Django-1.7.7-py2.py3-none-any.whl (7.4MB): 7.4MB
downloaded
Installing collected packages: django
  Found existing installation: Django 1.8
    Uninstalling Django:
  Successfully uninstalled Django
Successfully installed django
Cleaning up...
16:06:39 [aaron@ender:~/code/busybodyweb] [busybody] master* ± python
manage.py migrate
System check identified some issues:

WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
HINT: Django 1.6 introduced a new default test runner. It
looks like this project was generated using Django 1.5 or earlier. You
should ensure your tests are all running & behaving as expected. See
https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner
for more information.
Operations to perform:
  Synchronize unmigrated apps: stronghold, site_basics,
djcelery_email, djcelery, debug_toolbar, kombu_transport_django,
djangosecure, django_extensions, avatar, raven_compat, bootstrap3
  Apply all migrations: sessions, admin, tastypie, auth, sites,
contenttypes
Synchronizing apps without migrations:
  Creating tables...
Creating table avatar_avatar
Creating table celery_taskmeta
Creating table celery_tasksetmeta
Creating table djcelery_intervalschedule
Creating table djcelery_crontabschedule
Creating table djcelery_periodictasks
Creating table djcelery_periodictask
Creating table djcelery_workerstate
Creating table djcelery_taskstate
Creating table djkombu_queue
Creating table djkombu_message
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applyin

Re: "ResourceWarning: unclosed" error using mysql-connector-python

2015-03-01 Thread Aaron Abajian
I was also getting these errors, upgrading resolved them for me as well.

On Friday, July 4, 2014 at 6:59:03 AM UTC-7, Zemian Deng wrote:
>
> No problem. Thanks for the reply.
>
>
> On Fri, Jul 4, 2014 at 12:51 AM, cercatrova2  > wrote:
>
>>  On 04/07/14 05:09, Zemian Deng wrote:
>>  
>> Hum... I am surprised that no one has experienced this warning msg yet, 
>> or maybe I can't catch anyone to reply. 
>>
>>  For those are curious, I do now see mysql-connector-python 1.2.2 is 
>> available, and upgrading to this version got rid off these warnings.
>>
>> On Thursday, June 12, 2014 11:24:40 PM UTC-4, Zemian Deng wrote: 
>>>
>>> Anyone?
>>>
>>> On Tuesday, June 10, 2014 11:26:18 PM UTC-4, Zemian Deng wrote: 

 Hi there, 

  I am using mysql-connector-python (1.1.6) with Django (1.6.5) and 
 myapp is working fine. But each SQL call to DB will result the following 
 warning messages:

   Exception ignored in: >>> family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=6, 
 laddr=('127.0.0.1', 62622), raddr=('127.0.0.1', 3306)>
  
 ResourceWarning: unclosed >>> family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=6, 
 laddr=('127.0.0.1', 62622), raddr=('127.0.0.1', 3306)>
  
  
  Has anyone seen this and know a way to resolve it?
  Also, FYI, I am using the following in my settings file.
 DATABASES = {
  'default': {
'ENGINE': 'mysql.connector.django',
'NAME': 'mydb',
'USER': 'test',
'PASSWORD': 'test',
 },
 }

  Thanks,
 Zemian
  
>>>   -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a443d950-fe72-4380-bf61-1fc9c71c9af9%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> Zemian - I saw these warning messages too with 1.1.6 but indeed they went 
>> away with 1.2.2 about a month ago so I didn't post anything. Sorry but I 
>> didn't know of your message at the time.
>>
>>
>>
>>  -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/53B632EE.2080203%40gmail.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ea575334-f11d-4841-8ac2-1ffb4b278b14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Real time and Django - approaches

2015-02-21 Thread Aaron Reabow
Thanks Carlos.

How did you find the implementation?  Was it quite smooth, or did you hit a 
lot of problems along the way?

On Friday, 20 February 2015 17:04:48 UTC+2, Carlos Aguilar wrote:
>
> I build something related with realtime using gevent-socketio more than 1 
> year ago and works really well.
>
> Best Regards
>
> On Fri, Feb 20, 2015 at 6:37 AM, Aaron Reabow <rea...@gmail.com 
> > wrote:
>
>> Hi.
>>
>> I wanted to see what the Django community thought about realtime circa 
>> 2015.
>>
>> My impression (and I could be very wrong) is that if you want real time, 
>> you should build your own stack up from scratch.  There are frameworks - 
>> like swampdragon/socketio - that promise to do the hard yards for you, but 
>> ultimately are either based on older versions of the underlying tech, or 
>> too green to be in production.
>>
>> So which stack to build?  There is the gevent route which looks promising 
>> as it keeps it all in the python family.  (Stack would be something like - 
>> django/redis/gevent/gunicorn)
>>
>> From what I have read, gevent becomes opaque and throws up hard to 
>> understand errors.  Without a strong community behind this, debugging is 
>> either for the advanced, or extremely dedicated.
>>
>> Another stack option is to use Node.  I quite like this, despite the 
>> challenges.  The stack would be django/apache +redis/socetio/node/celery.  
>> I think the hardest part would be managing oauth2 between the two servers.  
>> On the upside, django can do all the regular web stuff, with node handling 
>> realtime components.
>>
>> So I have just stated my own views from what I could glean from blog 
>> posts.  I was interested if people had alternate understandings.
>>
>> What I am building definitely does need pubsub at the least, and to be as 
>> near to realtime as possible would be an advantage.
>>
>> many thanks,
>>
>> Aaron
>>
>>
>>  -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a5923d8e-54a4-46ab-8df0-fdbb25ad076b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/a5923d8e-54a4-46ab-8df0-fdbb25ad076b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Carlos Aguilar
> Consultor Hardware y Software
> DWD
> http://www.dwdandsolutions.com
> http://www.houseofsysadmin.com
> Cel: +50378735118
> USA: (301) 337-8541
>  

-- 
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/3bba5430-4bc4-4f07-8238-d282bd6d06b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Real time and Django - approaches

2015-02-20 Thread Aaron Reabow
Hi.

I wanted to see what the Django community thought about realtime circa 2015.

My impression (and I could be very wrong) is that if you want real time, 
you should build your own stack up from scratch.  There are frameworks - 
like swampdragon/socketio - that promise to do the hard yards for you, but 
ultimately are either based on older versions of the underlying tech, or 
too green to be in production.

So which stack to build?  There is the gevent route which looks promising 
as it keeps it all in the python family.  (Stack would be something like - 
django/redis/gevent/gunicorn)

>From what I have read, gevent becomes opaque and throws up hard to 
understand errors.  Without a strong community behind this, debugging is 
either for the advanced, or extremely dedicated.

Another stack option is to use Node.  I quite like this, despite the 
challenges.  The stack would be django/apache +redis/socetio/node/celery. 
 I think the hardest part would be managing oauth2 between the two servers. 
 On the upside, django can do all the regular web stuff, with node handling 
realtime components.

So I have just stated my own views from what I could glean from blog posts. 
 I was interested if people had alternate understandings.

What I am building definitely does need pubsub at the least, and to be as 
near to realtime as possible would be an advantage.

many thanks,

Aaron


-- 
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/a5923d8e-54a4-46ab-8df0-fdbb25ad076b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ajax philosophy

2015-02-12 Thread Aaron Reabow
Okay great, thanks.

I wrote a basic view, and it seems to do the job.  So far so good :)

I know (of) DRF, but not tastypie - will have a look.

thanks again for the help

On Thursday, 12 February 2015 11:37:36 UTC+2, Avraham Serour wrote:
>
> in my opinion no, it actually makes sense to have an API with its own 
> routes and views.
>
> I suggest you take a look at tastypie or DRF
>
> On Thu, Feb 12, 2015 at 10:17 AM, Aaron Reabow <rea...@gmail.com 
> > wrote:
>
>> I would like to separate out my ajax requests into their own views (one 
>> per page, is what I am thinking)
>>
>> This allows me to keep a very generic base view that applies to multiple 
>> pages.  This have a number of advantages for me, such as building a bullet 
>> proof view that never gives any trouble :)
>>
>> Really what I am asking is - from a conceptual level, are their any 
>> serious reasons why this approach would be a bad idea?
>>
>> (I am just taking my first steps into the world of ajax, hence the 
>> beginner question)
>>
>> -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f714b07b-ad69-4e60-8ce4-3cc73cc85cea%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/f714b07b-ad69-4e60-8ce4-3cc73cc85cea%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df10d7c5-9367-4573-9cab-037ac3cc1074%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ajax philosophy

2015-02-12 Thread Aaron Reabow
I would like to separate out my ajax requests into their own views (one per 
page, is what I am thinking)

This allows me to keep a very generic base view that applies to multiple 
pages.  This have a number of advantages for me, such as building a bullet 
proof view that never gives any trouble :)

Really what I am asking is - from a conceptual level, are their any serious 
reasons why this approach would be a bad idea?

(I am just taking my first steps into the world of ajax, hence the beginner 
question)

-- 
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/f714b07b-ad69-4e60-8ce4-3cc73cc85cea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2015-01-16 Thread Aaron C. de Bruyn
If it still doesn't work after doing what James suggested, you can look to
see if python is actually 'listening' on port 8000.

>From an 'elevated' command prompt (start->type 'cmd', right-click 'cmd' and
hit 'run as administrator') type 'netstat -abno > netstat.txt' and hit
enter.  Then type 'notepad netstat.txt' and you will see a list of all the
ports and programs that are using them.

Use the 'find' feature in notepad to look for a program running on '8000'.
If you don't see Python, something is not working correctly.

Occasionally you might see another app that is using the port.  A few years
back, Windows Small Business Server would occasionally seize random ports
used by other applications for use for DNS queries.

-A


On Fri, Jan 16, 2015 at 11:52 AM, James Schneider 
wrote:

> You should be running 'python manage.py runserver' from inside the
> directory of your project root , not using the django-admin.py command. The
> manage.py file should have been automatically generated when you created
> the project using django-admin.py. I hadn't even realized that
> django-admin.py supported the 'runserver' argument. It doesn't work for me,
> but 'python manage.py runserver' runs fine (and is what is recommended in
> the tutorial).
>
> It should look something like this:
>
>> $ cd 
>
> $ python manage.py runserver
>> Validating models...
>> 0 errors found
>> January 16, 2015 - 04:17:18
>> Django version 1.6.6, using settings 'project_name.settings'
>> Starting development server at http://127.0.0.1:8000/
>
> Quit the server with CONTROL-C.
>
>
> The command should 'hang' without displaying any errors if it is running
> correctly. It stays open to accept HTTP requests to http://127.0.0.1:8000.
> As you make requests, they should show up under the command with the URL's
> that you are requesting and the response codes from the development server.
>
> See the section here:
> https://docs.djangoproject.com/en/1.7/intro/tutorial01/#the-development-server
>
> -James
>
>
> On Jan 16, 2015 10:02 AM, "KamalKanta Majhi"  wrote:
>
>> Hi Kirby,
>>
>> Thanks for the reply. The same Error is throwing at
>> http://localhost:8000/ .
>>
>>
>> -- Kamal
>>
>> On Friday, January 16, 2015 at 10:27:51 PM UTC+5:30, C. Kirby wrote:
>>>
>>> Try localhost:8000
>>>
>>>
>>> On Friday, January 16, 2015 at 8:51:50 AM UTC-6, KamalKanta Majhi wrote:

 I h'v just run the django-admin.py runserver command to setup django
 dev server. But  dev server is not running at http://127.0.0.1:8000/.
 Also i h'v tested at http://0.0.0.0:8000/ and
 http://192.168.0.106:8000/. Throwing same error like below screen
 shot. Please help if anybody already resolved the same.


 


 -- Kamal



 On Monday, August 27, 2012 at 1:23:23 PM UTC+5:30, nav wrote:
>
> Dear Folks,
>
> I am running my django development server on 127.0.0.1:8000 and
> accessing this address from my web browser on the same machine. In the 
> past
> few days I have found thet the web browsers keep prepending the address
> with "www." when using the above address. 127.0.0.1 without the prot 
> number
> works fine but the django development server requires a port number.
>
> I have not encountered this problem before and am puzzled by what is
> happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/
> file is below if that helps:
>
> 
> 127.0.0.1   localhost
> 127.0.1.1   
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> 
>
> TIA
> Cheers,
> nav
>
  --
>> 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/cc0c84af-b413-4a76-a572-b3498ff350c4%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 

Re: Deploying Django on Docker

2015-01-12 Thread Aaron C. de Bruyn
My docker setup is pretty easy:

wget -qO- https://raw.github.com/progrium/dokku/v0.3.13/bootstrap.sh |
sudo DOKKU_TAG=v0.3.13 bash

cat ~/.ssh/id_rsa.pub | ssh r...@mynewhost.mydomain.tld "sudo
sshcommand acl-add dokku myproject"

git remote add production do...@mynewhost.mydomain.tld:myproject

git push production master


Dokku is awesome.  ;)



On Sun, Jan 11, 2015 at 10:24 PM, Anssi Kääriäinen  wrote:
> I have given this issue a bit more thought, and it seems using Docker might
> be a bit too complex for the "just completed tutorial use case". Docker is
> nice, but if things do not work out the way you want, troubleshooting can
> get a bit complex.
>
> Instead it might be good to *fully* document how to set up a virtual machine
> based Django setup. The documentation should include:
>   - minimal information about how to install virtualbox and Ubuntu 14.04
> image. (Maybe vagrant would be a better idea?)
>   - how to setup Django with Gunicorn (is supervisord a good idea for
> process management?)
>   - static files
>   - media files
>   - security
>   - logging
>   - multiple environments (for example, how to use settings for multiple
> environments. environment variables are the way to go IMO)
>   - automatic deployment
>   - backup, restore, clone production to qa (clone to qa is a really useful
> feature if your database is small enough for it)
>
> Second step would be to automate as much of the above list as possible.
> Maybe the mezzanine fab file is enough for that.
>
> The above list also tells a pretty good story about why I pursue a
> documented way to fully set up Django. When setting up a small Django app,
> doing all of the above things properly requires just too much effort.
>
>  - Anssi
>
> --
> 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/c6bd553e-f21e-4a4f-ba5a-150e58bac0db%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGpHh-u3rU8G-dZrYLSFvn1ZNeUkpGfbSftHSfYbdD%3DbrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: dashboard for user profile

2015-01-03 Thread Aaron Reabow
Did you ever find anything like this?

On Friday, 13 July 2012 03:57:45 UTC+2, psychok7 wrote:
>
> i there,
> i am trying to write a dashboard page to present after user login. i have 
> been searching google and only found *django-admin-tools . won*dering if 
> there is something like that for a user profile page (tried django-profiles 
> with no luck)
>
> thanks
>

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


Re: Swampdragon, the realtime framework for Django seems interesting. But will it scale ?

2014-12-16 Thread Aaron Reabow
Work on his site (yes)

-- 
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/f664ce13-cdf2-4221-9138-22985a187978%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swampdragon, the realtime framework for Django seems interesting. But will it scale ?

2014-12-15 Thread Aaron Reabow
the thing i am trying to figure out is how this works with my existing 
setup.

I get that you need to install redis. but how does the rest of the stack 
change

mine is through the good people at webfaction:

apache tomcat
nginx (static)
postgres
python2.7
django1,6
html/css/js

how much of this can i leave alone, while installing redis?

On Wednesday, 12 November 2014 06:37:47 UTC+2, Suren Sth wrote:
>
> I recently came across Swampdragon ( Visit official site 
> ). I am curious can it be used in production 
> sites and will it scale ? If it can be, what is the best way?
>

-- 
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/02805d73-d0e2-4bbd-81cc-74c5d201639f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Obtaining content from Git

2014-11-21 Thread Aaron C. de Bruyn
I'm not aware of any such module, but there are a few python 'git'
modules for reading/writing, etc...

As for how much trouble it would be, that all depends on how familiar
you are with git, python, Django, and the template system.

One way you might be able to achieve what you want is to create your
own template tag.  (The documentation is here:
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-tags)

You could pass a few parameters to your tag--I'm not sure what you're
looking for, but maybe:

{% gitfile "myfolder/myfile.txt" "d4ea4eea799" %}

And your tag could load data from "myfolder/myfile.txt" at revision
"d4ea4eea799".

There are a few exampled in the Django code itself
(https://github.com/django/django/tree/master/django/templatetags) as
well as plenty of samples on the internet for writing your own
template tag.

-A

On Fri, Nov 21, 2014 at 2:29 PM, martin f krafft  wrote:
> Hello,
>
> we have a Django project with a few pages that come from Git.
> Currently, Apache rewrite rules serve those files statically (and
> they make use of the same template/CSS as Django does, so the user
> does not actually notice), and it's a massive hack and pain to keep
> up-to-date.
>
> Hence I was thinking: how much trouble would it be to have Django
> reach into Git rather than its database and obtain data there to be
> filled into template slots? Ideally, there'd be the possibility of
> running a filter (e.g. reStructuredText) between Git and the
> template rendering.
>
> I've seen http://luispedro.org/software/git-cms, but that does way
> more than just sourcing from Git. And it's not immediately obvious
> to me how it even does the Git interaction.
>
> What I envision is a storage layer (with optional caching) that
> either fetches from the filesystem (with a Git checkout, using mtime
> for cache expiration), or directly from a local Git repo (using
> either commit or blob hash for cache expiration).
>
> Does anyone know of such a module? Would it be hard to write? Where
> would one start?
>
> Thanks,
>
> --
> @martinkrafft | http://madduck.net/ | http://two.sentenc.es/
>
> mulutlitithtrhreeaadededd s siigngnatatuurere
>
> spamtraps: madduck.bo...@madduck.net
>
> --
> 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/20141121222930.GA15206%40fishbowl.rw.madduck.net.
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGqxe5NGvQU6Coam0%2Bev5AjG1GdONt7cdhj9h%2BUshEHSgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: A better "manage.py shell" with syntax highlighting and multiline editing.

2014-10-13 Thread Aaron C. de Bruyn
That's awesome!  Thanks.

-A

On Mon, Oct 13, 2014 at 8:35 AM, Jonathan S 
wrote:

> Hi all,
>
> Two weeks ago I released the python-prompt-toolkit library with the
> "ptpython" REPL. That is a nice python interactive shell with decent
> multiline editing, syntax highlighting and autocompletion.
> For a list of all the features, see:
> http://github.com/jonathanslenders/python-prompt-toolkit
>
> Now django-extensions its "shell_plus" is supporting this as a front-end.
> Do:
>
> pip install -U django-extensions
> pip install -U prompt-toolkit
>
> then add 'django_extensions' to your INSTALLED_APPS in your django
> settings.
>
> If you run "django manage.py shell_plus", then you'll get your new shell.
> If you love IPython and you have IPython installed, then this should
> automatically use IPython as the back-end.
>
> Prompt-toolkit is still beta, but already used by many people, and it
> should feel stable, if you experience any issues, please report at github:
> http://github.com/jonathanslenders/python-prompt-toolkit
> Feature requests are very welcome.
>
> Enjoy!
> Jonathan
>
> django-extensions: https://github.com/django-extensions/django-extensions
>
> --
> 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/76b1f82a-e8bc-4f4d-a6aa-2d7e0868b39d%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGpjOxEt5UWnd4phcZX90S9b21ERyf4B6YtfAQ1x4axz9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Views triggering twice

2014-10-04 Thread Aaron Lelevier
Malcom,

Thank you for this writeup you did on debugging HTML code.  I was also 
showing Django Views loading twice, and it was due to an empty "href". 
 Only took a few minutes to fix after reading your writeup.  Thanks

On Friday, November 14, 2008 5:52:15 PM UTC-8, Malcolm Tredinnick wrote:
>
>
> On Fri, 2008-11-14 at 13:58 -0500, Jeff Gentry wrote:
> [...]
> > I'm attaching a tarball, which immitates my setup in a minimal
> > fashion.  At least when running on my system, the following browser
> > request triggers this behavior:
> > 
> > http://servername/test/
> > 
> > > rendering at all. You could try printing things like the output of
> > > traceback.print_stack() in your view to see if it's called the same way
> > > both times, for example.
> > 
> > I didn't see any differences in the two outputs.
> > 
> > > shortest possible example more or less naturally reveals what the
> > > problem is in the first place, because you end up seeing which line is
> > > critical to triggering the issue at hand.
> > 
> > Unfortunately, it didn't work here - I've got a view that only calls a
> > template, and a template which is almost completely empty.
>
> You didn't quite reduce it to the smallest possible example. However, it
> was a good start and your example was small enough that it only took a
> couple of attempts to find the problem. For the record, here's more or
> less a verbatim transcript of what I did:
>
> (1) Quick read through the files, nothing obvious showed up in the urls,
> view or template.
>
> (2) Ran manage.py and verified that the page loaded in the browser.
> Twice. So the problem is repeatable on something other than your system
> (always a relief).
>
> (3) Removed the use of request context from the call to
> render_to_response() in the view, since that was superfluous. Nothing
> changed.
>
> (4) Ran "curl -i http://localhost:8000/test/; to see what the headers
> looked like and see which end of the transaction was doing the second
> request. The headers looked normal (could have checked this in the
> browser too, via Firebug). It also loaded the page only once, which
> meant the problem was triggered by the browser.
>
> (5) Checked the HTML that was returned by curl (that was why I used "-i"
> and not just "-I"), since it's now clear that the returned HTML contains
> the problem and noticed the error on the second attempt.
>
> You're using the deprecated "background" attribute on the body element.
> The description of "background" from the HTML spec (section 7.5.1 -- the
> body element) says
>
> The value of this attribute is a URI that designates an image
> resource.
> 
> Note that it's a URI. That means something that is retrieved. Since
> you've used the value "#fff", that will be interpreted by the browser as
> a reference to the current page (#fff being an anchor, and not passed to
> the server). Ergo, a second request is made.
>
> The moral is (again) "don't put style elements in your HTML", I
> guess. :-)
>
> Regards,
> Malcolm
>
>

-- 
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/bb9a4cd1-a976-4c4a-ab29-49672666fb37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there anything similar to phpmyadmin

2014-09-22 Thread Aaron C. de Bruyn
You might consider setting up your database connection string, then doing a
'python manage.py inspectdb'.

This will spit out a bunch of model definitions.  Paste them into your
models.py, and add them in admin.py, and you have an interface for managing
a database.

-A

On Sat, Sep 20, 2014 at 6:38 PM, Yuan-Liang Tang  wrote:

> I'd like to know if there is anything/anyway similar to phpmyadmin for
> managing MySQL DBs in a Django project or in the Python environment. Any
> suggestions?
>
> django-mysql-manage seems to be dead.
>
> https://pypi.python.org/pypi/django-mysql-manager/0.1.2
>
> --
> 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/c13ab3ab-e23c-48b7-8bb8-bce38e72686a%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGoM48UduuTjfC9hawcHF6ErT9bD%3D_VaeWa-jKsdHBSL4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Updating Django project from 1.4 (if not older) to 1.7

2014-09-06 Thread Aaron C. de Bruyn
It depends on a lot of things.

1. You can try running:
python
from django import get_version
print get_version()


2. If you don't see manage.py in the root directory, you are probably using
a very old version of django.  I would start by creating a virtualenv
running an early version of Django (maybe 1.2) and get the application
running.  Then slowly upgrade (1.3, then 1.4, etc...) until you get up to
1.7.  Follow the upgrade instructions here:
https://docs.djangoproject.com/en/1.7/releases/

If there isn't much code to the app, I would start with a clean project and
slowly move the required apps over to the new project.  But it all depends
on the time you have available and the amount of code to work with.

3. Follow the steps in the release notes.  Possibly use a tool like 'grep'
if you are in a Linux environment to search through the code for deprecated
modules.  If the application has a good set of tests, they should tell you
what's broken.

4. Depends on how much code, how much time, and how efficient you are as a
programmer.  If you've got four weeks, but only need 90 minutes of sleep
every night, most projects can be re-written from scratch.  ;)

If it seems too daunting, you can always post specific questions herep--or
even find someone (https://www.djangojobs.net/jobs/) to help you
professionally.

-A

On Sat, Sep 6, 2014 at 1:30 PM, Abdulla Al-Khenji 
wrote:

> Hello all,
>
> I have been assigned with updating a Django project that was last
> developed in 2012 to the latest version, fixing bugs, and security issues,
> and updating deprecated code to match the latest version.
>
> Couple of questions I couldn't answer myself:
>
> 1) How can I check which version this application was built on?
> 2) I don't see a "manage.py" file anywhere, how can get that file? I need
> it to run the application on a local server at least.
> 3) How do I go about and actually "update" all the deprecated code?
> 4) Would you guys recommend that we start writing it again from scratch?
>
> I have 4 weeks to do that, so time plays a crucial role here..
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9eba19fa-b9ab-4382-accc-0317edd92bb7%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGo0RXqWAMg%3Dshk9GtWfraJ4OFExfot-SgE%3DW7BjsM2EfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Comments in real time

2014-08-27 Thread Aaron Reabow
thank you for the responses, I will have a go at each.

I wonder if the angular and websockets approaches could compliment each 
other...

On Friday, 22 August 2014 20:52:26 UTC+2, Julo Waks wrote:
>
> If you need to save the comments, take a look to django-angular.
> Its an integration of angularJS into django.
> Where you can save the model via javascript, i really recommend you 
> Angular for this.
> --
> *From: * Collin Anderson  
> *Sender: * django...@googlegroups.com  
> *Date: *Fri, 22 Aug 2014 10:37:22 -0700 (PDT)
> *To: *
> *ReplyTo: * django...@googlegroups.com  
> *Subject: *Re: Comments in real time
>
> You could also look into the EventSource JavaScript API.
>
> -- 
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/4df79594-fc7d-42be-acec-4c2385afe10a%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/397920ed-f494-4a0d-834f-0745837ee003%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Comments in real time

2014-08-20 Thread Aaron Reabow
Hi all,

I use a proprietary application that let people on multiple browsers 
comment.

In real time their comments are displayed for everyone to see.

What is quite nice, is that you can then order and group these comments.

I have looked through the Django apps, but am unsure if any of them will 
give me similar capabilities (or parts thereof).

Would anyone have a suggestion on where to start looking.  My alternative 
would be to then build the interactivity in javascript.

many thanks in advance,

Aaron

-- 
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/80044c93-b217-4caa-8512-ad4265abd8f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-18 Thread Aaron C. de Bruyn
After trying to load the page in Chrome, do you see any output in the
'runserver' window?


On Mon, Aug 18, 2014 at 7:28 PM, Andrew Koller  wrote:

> I'm having issues getting the dev server to work. After I installed
> Django, and
>
> $ python -c "import django; prindjango.get_version())"
>
>> returns 1.6.5
>
> Then:
>
> $ python manage.py runserver
>
> returns:
>
> Validating models...
> 0 errors found
> August 19, 2014 - 02:19:03
> Django version 1.6.5, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
>
> but 127.0.0.1:8000 shows no data in Chrome.
>
> Thanks for the help
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/13f29c35-56bb-455e-b7dc-68d2f160c82e%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGrz1Ocwbb4X3WKv2P0-%2Bd2aqO1%3DDbat%3DccEe2BbXyTneQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Should I use generic foreign key, and how?

2014-08-16 Thread Aaron Law
Hi all,

I have php web programming background, and new to Django. I am helping my
brother to build an online system to manage inventory, and I've got a
database design & coding problem recently. Needing help!

That is, I have a set of tables of "possible products", "inventory",
"suppiler", etc. I want to attach a "comment" to each of them. Therefore, I
think I should make a generic "comment" table to hold all the comments of
products, inventory, suppiler.

--
possible_products
id: int (pk)
name: varchar
url: varchar
price: decimal
created_at: datetime
updated_at: datetime
--
comments
id: int (pk)
parent_id: int (fk)
content: text
author: int (fk)
table: char (which the table this comment belongs to)
created_at: datetime
updated_at: datatime
--

My problem is, when "possible_products" table is the parent of "comment",
then a foreign key of the parent (id number) is stored in the "comment"
table in order to link up them.

However, how about the fk of the "inventory" table and the "suppiler"
table? It should not be that: I create 2 more columns of "inventory_id" nor
"suppiler_id" in "comments" table. (That is, I should not create the 4th
column when I want to link up the 4th parent table.)

So, Should I use generic forgien key of Django? (so that, my "comment"
table design is right.) And how to use/implement it?

P.S I mainly develop the system in the Admin section of Django.

Regards,
Aaron Law Ho hon
--~--~-~--~~~---~--~~
Free as in Freedom ;-)
--~--~-~--~~~---~--~~

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


Re: Simple History - Field Change

2014-07-04 Thread Aaron Reabow
You are totally right.

There is a historical table that required deletion.

This is why you shouldn't debug late on friday afternoon.  I had actually 
looked for that table but somehow missed it.

I will pick up the broader problems with simple history separately.

thanks for taking the time to look through this Cal. 

On Friday, 4 July 2014 18:05:43 UTC+2, Cal Leeming [Simplicity Media Ltd] 
wrote:
>
> It sounds like you haven't applied the table changes to the cloned table 
> which it creates to track changes.
>
> I'd advice using something like South to manage your schema changes, and 
> this should work out of the box with django-simple-history. 
>
> For now, you can delete the cloned table and re-sync, you will naturally 
> lose the historical data but if you deleted the original then this probably 
> won't matter.
>
> It's also worth mentioning that the design approach 
> of django-simple-history is completely wrong, and personally I wouldn't 
> recommend using it. Feel free to start a separate thread if you'd like to 
> discuss that further though as it's slightly off topic for this thread.
>
> Let us know how you get on.
>
> Cal
>
>
> On Fri, Jul 4, 2014 at 4:47 PM, Aaron Reabow <rea...@gmail.com 
> > wrote:
>
>> Environment:
>>
>>
>> Request Method: POST
>> Request URL: upon request :)
>>
>> Django Version: 1.6.2
>> Python Version: 2.7.5
>> Installed Applications:
>> ('django.contrib.admin',
>>  'django.contrib.admindocs',
>>  'django.contrib.auth',
>>  'django.contrib.sites',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'myproject.ngc',
>>  'registration',
>>  'crispy_forms',
>>  'floppyforms',
>>  'simple_history')
>> Installed Middleware:
>> ('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')
>>
>>
>> Traceback:
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/core/handlers/base.py"
>>  
>> in get_response
>>   114. response = wrapped_callback(request, 
>> *callback_args, **callback_kwargs)
>> File "/home/metadata/webapps/greenhouse/myproject/myproject/ngc/views.py" 
>> in leadManagementView
>>   540. model_instance.save()
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
>> in save
>>   545.force_update=force_update, 
>> update_fields=update_fields)
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
>> in save_base
>>   582.update_fields=update_fields, 
>> raw=raw, using=using)
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/dispatch/dispatcher.py"
>>  
>> in send
>>   185. response = receiver(signal=self, sender=sender, 
>> **named)
>> File 
>> "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py" 
>> in post_save
>>   209. self.create_historical_record(instance, created and 
>> '+' or '~')
>> File 
>> "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py" 
>> in create_historical_record
>>   222.history_user=history_user, **attrs)
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py"
>>  
>> in create
>>   157. return self.get_queryset().create(**kwargs)
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py" 
>> in create
>>   319. obj.save(force_insert=True, using=self.db)
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
>> in save
>>   545.force_update=force_update, 
>> update_fields=update_fields)
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
>> in save_base
>>   573. updated = self._save_table(raw, cls, force_insert, 
>> force_update, using, update_fields)
>> File 
>> "/home/metadata/webapps/greenhouse/lib/python2.7/dj

Re: Simple History - Field Change

2014-07-04 Thread Aaron Reabow
Environment:


Request Method: POST
Request URL: upon request :)

Django Version: 1.6.2
Python Version: 2.7.5
Installed Applications:
('django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.auth',
 'django.contrib.sites',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'myproject.ngc',
 'registration',
 'crispy_forms',
 'floppyforms',
 'simple_history')
Installed Middleware:
('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')


Traceback:
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/core/handlers/base.py" 
in get_response
  114. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File "/home/metadata/webapps/greenhouse/myproject/myproject/ngc/views.py" 
in leadManagementView
  540. model_instance.save()
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
in save
  545.force_update=force_update, 
update_fields=update_fields)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
in save_base
  582.update_fields=update_fields, 
raw=raw, using=using)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/dispatch/dispatcher.py" 
in send
  185. response = receiver(signal=self, sender=sender, **named)
File 
"/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py" 
in post_save
  209. self.create_historical_record(instance, created and '+' 
or '~')
File 
"/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py" 
in create_historical_record
  222.history_user=history_user, **attrs)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py" 
in create
  157. return self.get_queryset().create(**kwargs)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py" 
in create
  319. obj.save(force_insert=True, using=self.db)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
in save
  545.force_update=force_update, 
update_fields=update_fields)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
in save_base
  573. updated = self._save_table(raw, cls, force_insert, 
force_update, using, update_fields)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
in _save_table
  654. result = self._do_insert(cls._base_manager, using, 
fields, update_pk, raw)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" 
in _do_insert
  687.using=using, raw=raw)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py" 
in _insert
  232. return insert_query(self.model, objs, fields, **kwargs)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py" 
in insert_query
  1511. return query.get_compiler(using=using).execute_sql(return_id)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/sql/compiler.py"
 
in execute_sql
  899. cursor.execute(sql, params)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py" 
in execute
  69. return super(CursorDebugWrapper, self).execute(sql, 
params)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py" 
in execute
  53. return self.cursor.execute(sql, params)
File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/utils.py" 
in __exit__
  99. six.reraise(dj_exc_type, dj_exc_value, traceback)
File 
"/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py" 
in execute
  53. return self.cursor.execute(sql, params)

Exception Type: DataError at /leads
Exception Value: smallint out of range


On Friday, 4 July 2014 17:43:50 UTC+2, Cal Leeming [Simplicity Media Ltd] 
wrote:
>
> Can you please paste the full clear text stacktrace?
>
> Cal
>
>
> On Fri, Jul 4, 2014 at 3:49 PM, Aaron Reabow <rea...@gmail.com 
> > wrote:
>
>> Hi all,
>>
>> I am getting this error on a modelform
>>
>> smallint out of range
>>
>>
>>
>> But the form is actually submitting just fine and being stored in the DB.  I 
>> use

Simple History - Field Change

2014-07-04 Thread Aaron Reabow
Hi all,

I am getting this error on a modelform

smallint out of range



But the form is actually submitting just fine and being stored in the DB.  I 
used to have a positive small int, but have changed it  (dropped the offending 
table, resync'ed, restarted the server...)

I have history = HistoricalRecords() as one of the fields  (ie am tracking 
changes with django-simple-history), and I wonder if this is effecting my 
ability to make changes to the model.


My other thought is that it is a caching problem somewhere.


has anyone come across this problem and have any idea how to fix?


many thanks,


Aaron

-- 
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/6af23e8d-9f15-477d-843f-dc9c33b7edf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using session data to populate multiple forms

2014-06-25 Thread Aaron Reabow
haha - okay

*model_instance.participant = request.session.get('participant')*

works perfectly.

I thought the incorrect use of objects was just the start :)

Thanks Daniel, much appreciated.


On Wednesday, 25 June 2014 11:07:19 UTC+2, Daniel Roseman wrote:
>
> On Wednesday, 25 June 2014 08:58:05 UTC+1, Aaron Reabow wrote:
>>
>> Perhaps I should be more specific.
>>
>> How do i populate some fields in a table from a form, and other fields 
>> from session variables in the view  (or the template or the model if that 
>> was more appropriate)
>>
>> many thanks,
>>
>> aaron
>>
>>
> Well, I understand that bit. What I don't understand is what's wrong with 
> the code you've posted, once you correct the use of dictionary syntax? 
>  This is exactly the correct approach.
> --
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4e2efcb1-bb19-491d-9db4-7792f359474a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using session data to populate multiple forms

2014-06-25 Thread Aaron Reabow
Perhaps I should be more specific.

How do i populate some fields in a table from a form, and other fields from 
session variables in the view  (or the template or the model if that was 
more appropriate)

many thanks,

aaron

On Tuesday, 24 June 2014 18:21:02 UTC+2, Aaron Reabow wrote:
>
> Hi Daniel,
>
> Thanks for the response. 
>
> What I am trying to get right is the ability to save session data across 
> multiple forms.
>
> In an initial form, people can tell me some generic information about 
> their department, role etc.
>
> It is then useful for me to save that information alongside their answers 
> in subsequent forms that they complete within a session.  (It helps me to 
> know who is who when I analyse their responses)
>
> I save a little session dictionary of their core information in URL1 and 
> am looking to add that information to the models that they complete in 
> URL2,3,4...
>
> I hope that makes some sense.
>
> warm regards,
>
> Aaron
>
> On Tuesday, 24 June 2014 18:04:16 UTC+2, Daniel Roseman wrote:
>>
>> On Tuesday, 24 June 2014 14:30:48 UTC+1, Aaron Reabow wrote:
>>>
>>> Hi All,
>>>
>>> I have been scratching around this for a bit now.
>>>
>>> Sometimes I *don't want people to have to register* on my site, but I 
>>> do want to *capture some information* about them and *reuse it across 
>>> multiple mini questionnaires/forms*.
>>>
>>> I can happily set and get a session variable using the session 
>>> 'dictionary'
>>>
>>> What I am trying to figure out is how to then use this information to 
>>> populate fields so I can know who is giving which answers.
>>>
>>> I could take the session variable and write this to the template, grab 
>>> this information in the template and write it to the input using jquery. 
>>>  This doesn't seem the most efficient way.
>>>
>>> I assume writing this information in the view would be optional, 
>>> alternatively is there a way to foreignkey type of approach.
>>>
>>> Also I am pretty new to django so i might be way off the mark..
>>>
>>> many thanks in advance,
>>>
>>> Aaron
>>>
>>> my view:
>>>
>>> def sessionStoreView(request):
>>> if request.method == "POST":
>>> form = sessionStoreForm(request.POST)
>>> if form.is_valid():
>>> model_instance = form.save(commit=False)
>>> *model_instance['participant'] 
>>> = request.session.get('participant') #something like that would be great if 
>>> it worked*
>>> model_instance.save()
>>> return HttpResponseRedirect('sessionStore')
>>> else:
>>> form = sessionStoreForm()
>>> return render(request, "sessionStore.html", {'form': form})
>>>
>>
>> Apart from the fact that model_instance is, well, a model instance, and 
>> therefore you access it via dot notation not dictionary notation, what 
>> exactly are you having trouble with here?
>> --
>> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c43f521c-6765-457f-9fe1-6f851ebaae1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Login - Redirecting back to login page

2014-06-24 Thread Aaron Reabow
also try: LOGIN_REDIRECT_URL

On Tuesday, 24 June 2014 16:55:21 UTC+2, Sergiy Khohlov wrote:
>
> Hello,
>
>  Could you please paste your LOGIN_URL  from your settings.py 
>
>
>
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
>
> On Tue, Jun 24, 2014 at 5:40 PM, Діма Ревуцький  > wrote:
>
>> I had same problem 
>> In settings remove SESSION_COOKIE_DOMAIN or set correct domain
>>
>> понедельник, 6 июня 2011 г., 13:57:11 UTC+3 пользователь Aidan написал:
>>>
>>> I'm having trouble with the Django Admin. My login page appears ok at 
>>> http://127.0.0.1:8000/admin but when I try to login with a valid 
>>> username or password the page seems to refresh - it reappears with 
>>> text boxes empty. It doesn't display any errors on the page (logging 
>>> in with invalid username / password brings up all the red errors you'd 
>>> expect). 
>>>
>>> I'm not sure what's going on here. The console gives me the following: 
>>>
>>> (cache) C:\PythonProjects\CacheProject\cache>python manage.py 
>>> runserver 
>>> Validating models... 
>>>
>>> 0 errors found 
>>> Django version 1.3, using settings 'cache.settings' 
>>> Development server is running at http://127.0.0.1:8000/ 
>>> Quit the server with CTRL-BREAK. 
>>> [06/Jun/2011 11:52:09] "GET /admin/ HTTP/1.1" 200 2053 
>>> [06/Jun/2011 11:52:17] "POST /admin/ HTTP/1.1" 302 0 
>>> [06/Jun/2011 11:52:21] "GET /admin/ HTTP/1.1" 200 2053 
>>>
>>> settings.py - 
>>> # 
>>> INSTALLED_APPS = ( 
>>> 'django.contrib.auth', 
>>> 'django.contrib.contenttypes', 
>>> 'django.contrib.sessions', 
>>> 'django.contrib.sites', 
>>> 'django.contrib.messages', 
>>> 'django.contrib.admin', 
>>> ) 
>>> # 
>>>
>>> urls.py - 
>>>
>>> from django.conf.urls.defaults import patterns, include, url 
>>>
>>> from django.contrib import admin 
>>> admin.autodiscover() 
>>>
>>> urlpatterns = patterns('', 
>>> (r'^admin/', include(admin.site.urls)), 
>>> ) 
>>>
>>> Any ideas?
>>
>>  -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/739282ff-e00d-46ca-99dc-8bebdff27f6f%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0f12f7a9-f1d4-4faf-b29b-b322f68f006d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using session data to populate multiple forms

2014-06-24 Thread Aaron Reabow
Hi Daniel,

Thanks for the response. 

What I am trying to get right is the ability to save session data across 
multiple forms.

In an initial form, people can tell me some generic information about their 
department, role etc.

It is then useful for me to save that information alongside their answers 
in subsequent forms that they complete within a session.  (It helps me to 
know who is who when I analyse their responses)

I save a little session dictionary of their core information in URL1 and am 
looking to add that information to the models that they complete in 
URL2,3,4...

I hope that makes some sense.

warm regards,

Aaron

On Tuesday, 24 June 2014 18:04:16 UTC+2, Daniel Roseman wrote:
>
> On Tuesday, 24 June 2014 14:30:48 UTC+1, Aaron Reabow wrote:
>>
>> Hi All,
>>
>> I have been scratching around this for a bit now.
>>
>> Sometimes I *don't want people to have to register* on my site, but I do 
>> want to *capture some information* about them and *reuse it across 
>> multiple mini questionnaires/forms*.
>>
>> I can happily set and get a session variable using the session 
>> 'dictionary'
>>
>> What I am trying to figure out is how to then use this information to 
>> populate fields so I can know who is giving which answers.
>>
>> I could take the session variable and write this to the template, grab 
>> this information in the template and write it to the input using jquery. 
>>  This doesn't seem the most efficient way.
>>
>> I assume writing this information in the view would be optional, 
>> alternatively is there a way to foreignkey type of approach.
>>
>> Also I am pretty new to django so i might be way off the mark..
>>
>> many thanks in advance,
>>
>> Aaron
>>
>> my view:
>>
>> def sessionStoreView(request):
>> if request.method == "POST":
>> form = sessionStoreForm(request.POST)
>> if form.is_valid():
>> model_instance = form.save(commit=False)
>> *model_instance['participant'] 
>> = request.session.get('participant') #something like that would be great if 
>> it worked*
>> model_instance.save()
>> return HttpResponseRedirect('sessionStore')
>> else:
>> form = sessionStoreForm()
>> return render(request, "sessionStore.html", {'form': form})
>>
>
> Apart from the fact that model_instance is, well, a model instance, and 
> therefore you access it via dot notation not dictionary notation, what 
> exactly are you having trouble with here?
> --
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cf96fdf0-e8e4-4141-9a5e-9ad5ca7f5918%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using session data to populate multiple forms

2014-06-24 Thread Aaron Reabow
Hi All,

I have been scratching around this for a bit now.

Sometimes I *don't want people to have to register* on my site, but I do 
want to *capture some information* about them and *reuse it across multiple 
mini questionnaires/forms*.

I can happily set and get a session variable using the session 'dictionary'

What I am trying to figure out is how to then use this information to 
populate fields so I can know who is giving which answers.

I could take the session variable and write this to the template, grab this 
information in the template and write it to the input using jquery.  This 
doesn't seem the most efficient way.

I assume writing this information in the view would be optional, 
alternatively is there a way to foreignkey type of approach.

Also I am pretty new to django so i might be way off the mark..

many thanks in advance,

Aaron

my view:

def sessionStoreView(request):
if request.method == "POST":
form = sessionStoreForm(request.POST)
if form.is_valid():
model_instance = form.save(commit=False)
*model_instance['participant'] 
= request.session.get('participant') #something like that would be great if 
it worked*
model_instance.save()
return HttpResponseRedirect('sessionStore')
else:
form = sessionStoreForm()
return render(request, "sessionStore.html", {'form': form})

-- 
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/3246927b-5b7e-4b03-9612-651ae0b10431%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Development SaaS with Django

2014-05-24 Thread Aaron C. de Bruyn
The best way to find out would be to download django-cms and django-shop
and test them out for yourself to make sure they meet your requirements.
 Or hire a developer to research your requirements for you.

My guess would be 'no', because their goal isn't to be multi-tenant apps.

-A


On Sat, May 24, 2014 at 12:48 PM, Carlos Perche <
carlosfelipeper...@gmail.com> wrote:

> Hello, I need to create an app like study case django-cms Dataprotect (
> http://www.dataprotectcloud.com/), it need be an SaaS with user accounts,
> plans and pricing, multi tenant, etc.
>
> I want to know if Django-CMS and DjangoShop do have these native resources.
>
> Or if you can help me with built references of how to develop my SaaS with
> Django.
>
> thank you very much
>
> --
> 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/62b57927-229d-4e41-bb10-793bafd8b6dc%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGqvV1aUWPrkQUfUzp0CL%3DaWnf2y4vEaeSh_cMuL%2BMSJZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Recruiting part time Django, python programmer for Bitcoin startup- remote work OK

2014-04-29 Thread Aaron Zirker
 

Hello Django users group,

My name is Aaron Zirker and I am the CEO and Founder at The Cryptocurrency 
Analytics Company. We have created an automated Bitcoin trading platform 
and recently received funding to further our front end development.


We're a NYC-based bitcoin startup looking for a front-end developer skilled 
with Django. Should have experience in developing aesthetic visual 
interfaces and able to present examples of work. The technologies we use 
include Python, Django, Flask, PostgreSQL and redis. Bitcoin experience is 
not necessary. Experience in AngularJS a plus. Please contact me for 
details at aa...@cryptocurrencyanalytics.com.



-- 
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/68048962-5a51-48c4-8bbb-650f21b28f91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I register to get access to the IRC Channel?

2014-04-02 Thread Aaron C. de Bruyn
Take a look at this:

http://www.wikihow.com/Register-a-User-Name-on-Freenode

If you still get stuck, let us know.

-A


On Wed, Apr 2, 2014 at 1:43 PM, John Draper  wrote:

> I go to Adium --> File --> irc.freenode.net
> see screenshot
>
> I put in my nickname, hostname, and password.
>
> I get this   See 2nd screenshot...
>
> So what do I do next?I tried double clicking the item, and it just
> goes back to the
> first screenshot you see.   I tried Option-click,  Control-click, Command
> click.
>
> But there is nothing I can do,  to bring up the channel?
> I tried file --> new chat - that didnt work
> I tried Status --> irc.freenode.net --> Available - that didnt work.
>
> And I don't see anything else,  that could give me any clue on how to join
> the #django channel.
>
> HELP
>
> is there anyone out there who can "lead me by the hand" and help a fellow
> Django beginner ask for help
> over IRC?I'm on Fuze...   get the app...   http://fuze.com.   Send me
> your Email, I invite you to the Conference
> and we can screen share.   Skype used to be able to do that,  but not
> since M$ bastardized it.
>
> John
>
>
>  --
> 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/b03812e1-6e34-4c1a-87c3-a0a0fd722eba%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGrJpdXA07UB-cJr%2B0eNMCQ-yk_egHQRSoWLtp%3D0xDJsJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Avoid Django s3-urls stripping

2014-03-28 Thread Aaron Cannon
I'd like to try to reproduce this locally.  If you can send me the URL
(feel free to mangle the signature parameter for security), that will
help.  Alternatively, you might cut the URL into pieces, to see if
it's some specific characters that it's choking on, and then just send
me that bit.

Otherwise, if you'd like to create a small example project that
demonstrates this issue, and upload it to github, that would work as
well.

Aaron

On 3/28/14, Paolo Bertasi <paolo.b...@gmail.com> wrote:
>
> Hi and thanks for your help.
>
> I tried
> * to print url in the console : OK
> * to print HttpResponse(url) in the console: OK
> * to return the url witout a template in the browser : wrong
>
> So i am really confused
> I am almost sure that:
> 1) it is not a s3 problem
> 2) it is not a HttpResponse problem
> 3) it is not a templating problem
>
> It seems that django strip the url when i get the url via browser...
>
>
>
> Il giorno giovedì 27 marzo 2014 19:34:10 UTC+1, Aaron Cannon ha scritto:
>>
>> Is the url a bytestring?  A quick check of the code for HttpResponse
>> shows that that class is expecting a byte string.  Perhaps the URL
>> contains unicode characters that aren't being escaped properly?
>>
>> Aaron
>>
>> On 3/27/14, Aaron Cannon <can...@fireantproductions.com >
>> wrote:
>> > Other things I'd probably try to debug this issue would be:
>> >
>> > * Hard coding the string into the call to HttpResponse,
>> > * printing the variable that contains the URL to the console.
>> >
>> > If the URL was still bad after trying the first item, and the second
>> > item printed the expected result, then you could completely take S3
>> > out of the picture.  From there, I would start narrowing it down, to
>> > see if it was a specific character that was causing the problem.
>> >
>> > Narrowing things down a bit more might make it easier for folks to
>> > help you figure out your issue.
>> >
>> > Luck.
>> >
>> > Aaron
>> >
>> > On 3/27/14, Paolo Bertasi <paolo...@gmail.com > wrote:
>> >> Hi Aaron,
>> >> the html is "wrong" as well.
>> >>
>> >> Moreover i tried {% autoescape off %} but with no luck :(
>> >>
>> >>
>> >>
>> >>
>> >> Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha
>> scritto:
>> >>>
>> >>> Try clicking view source in your browser when you view it.  Perhaps
>> >>> the URL needs to be HTML escaped?
>> >>>
>> >>> Just a guess.
>> >>>
>> >>> Aaron
>> >>>
>> >>> On 3/21/14, Paolo Bertasi <paolo...@gmail.com > wrote:
>> >>> > Hello,
>> >>> > I'm trying to setup a mini django app to allow users to download
>> files
>> >>> from
>> >>> >
>> >>> > s3. I wrote a simple python function (using boto of course) to fetch
>> >>> >
>> >>> > the
>> >>> >
>> >>> > correct url but when i handle the url with django the url is
>> stripped.
>> >>> > I wrote down the exact behaviour
>> >>> > here<
>> >>>
>> http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
>>
>>
>> >>>
>> >>>
>> >>> > .
>> >>> >
>> >>> > Please help :)
>> >>> >
>> >>> > --
>> >>> > You received this message because you are subscribed to the Google
>> >>> Groups
>> >>> > "Django users" group.
>> >>> > To unsubscribe from this group and stop receiving emails from it,
>> send
>> >>> an
>> >>> > email to django-users...@googlegroups.com .
>> >>> > To post to this group, send email to
>> >>> > django...@googlegroups.com.
>> >>>
>> >>> > Visit this group at http://groups.google.com/group/django-users.
>> >>> > To view this discussion on the web visit
>> >>> >
>> >>>
>> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%40googlegroups.com.
>>
>>
>> >>>
>> >>>
>> >>> > For more options, visit https://groups.google.com/d/optout.
>> >>> >
>> >>>
>>

Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Is the url a bytestring?  A quick check of the code for HttpResponse
shows that that class is expecting a byte string.  Perhaps the URL
contains unicode characters that aren't being escaped properly?

Aaron

On 3/27/14, Aaron Cannon <cann...@fireantproductions.com> wrote:
> Other things I'd probably try to debug this issue would be:
>
> * Hard coding the string into the call to HttpResponse,
> * printing the variable that contains the URL to the console.
>
> If the URL was still bad after trying the first item, and the second
> item printed the expected result, then you could completely take S3
> out of the picture.  From there, I would start narrowing it down, to
> see if it was a specific character that was causing the problem.
>
> Narrowing things down a bit more might make it easier for folks to
> help you figure out your issue.
>
> Luck.
>
> Aaron
>
> On 3/27/14, Paolo Bertasi <paolo.b...@gmail.com> wrote:
>> Hi Aaron,
>> the html is "wrong" as well.
>>
>> Moreover i tried {% autoescape off %} but with no luck :(
>>
>>
>>
>>
>> Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha scritto:
>>>
>>> Try clicking view source in your browser when you view it.  Perhaps
>>> the URL needs to be HTML escaped?
>>>
>>> Just a guess.
>>>
>>> Aaron
>>>
>>> On 3/21/14, Paolo Bertasi <paolo...@gmail.com > wrote:
>>> > Hello,
>>> > I'm trying to setup a mini django app to allow users to download files
>>> from
>>> >
>>> > s3. I wrote a simple python function (using boto of course) to fetch
>>> > the
>>> >
>>> > correct url but when i handle the url with django the url is stripped.
>>> > I wrote down the exact behaviour
>>> > here<
>>> http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
>>>
>>>
>>> > .
>>> >
>>> > Please help :)
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Django users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> > email to django-users...@googlegroups.com .
>>> > To post to this group, send email to
>>> > django...@googlegroups.com.
>>>
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1172243d-6d55-41b4-9cf4-a6bbc6379225%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOjPWjRwkCY%2BG-BtLO6XL8Sc-pK3TWBa%3D01aRPLP%2BVZCZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Other things I'd probably try to debug this issue would be:

* Hard coding the string into the call to HttpResponse,
* printing the variable that contains the URL to the console.

If the URL was still bad after trying the first item, and the second
item printed the expected result, then you could completely take S3
out of the picture.  From there, I would start narrowing it down, to
see if it was a specific character that was causing the problem.

Narrowing things down a bit more might make it easier for folks to
help you figure out your issue.

Luck.

Aaron

On 3/27/14, Paolo Bertasi <paolo.b...@gmail.com> wrote:
> Hi Aaron,
> the html is "wrong" as well.
>
> Moreover i tried {% autoescape off %} but with no luck :(
>
>
>
>
> Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha scritto:
>>
>> Try clicking view source in your browser when you view it.  Perhaps
>> the URL needs to be HTML escaped?
>>
>> Just a guess.
>>
>> Aaron
>>
>> On 3/21/14, Paolo Bertasi <paolo...@gmail.com > wrote:
>> > Hello,
>> > I'm trying to setup a mini django app to allow users to download files
>> from
>> >
>> > s3. I wrote a simple python function (using boto of course) to fetch the
>> >
>> > correct url but when i handle the url with django the url is stripped.
>> > I wrote down the exact behaviour
>> > here<
>> http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
>>
>>
>> > .
>> >
>> > Please help :)
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to django-users...@googlegroups.com .
>> > To post to this group, send email to
>> > django...@googlegroups.com.
>>
>> > Visit this group at http://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1172243d-6d55-41b4-9cf4-a6bbc6379225%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOi_Kf63Q0oONmZ8Aa77Qd2%3DFBtREgFV6GrjZ3WurxYP0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Client side timestamp handling and timezone

2014-03-27 Thread Aaron Cannon
Have you seen this SO answer?  This might help you to convert to UTC
in JS.  No idea why you're seeing different results inside and outside
the shell.

Luck.

Aaron

On 3/18/14, Yoanis Gil Delgado <yoa...@2burbujas.net> wrote:
> Hello there,
>
> I've been struggling with this issue for the last few days and I cannot seem
> to find the way to fix it. I've this web page with a form where a user is
> requested to enter a date and a time of the day. Then there is a search
> button which does a JSON post back to the server with certain information.
> The user selected date/time is sent also back to the server as part of this
> information. Right now, before sending data back to the server the selected
> date/time is converted to a timestamp, which is assumed to be in the
> client's time zone.
>
> The server code attempts to convert this timestamp back to a valid datetime
> object, by means of:
>
> datetime.datetime.fromtimestamp(int(self.request_data.get(TIME_OF_PICKUP_FIELD)))
>
> but the function fromtimestamp is also applying the timezone conversation to
> the provide value which turns the datetime one hour ahead/behind the user's
> selected value. What's strange to me is that if I run this code outside
> Django's shell:
>
>>>>datetime.datetime.fromtimestamp(1395160800)
>
> the result is: datetime.datetime(2014,3,18,12,40)
>
> which is correct since (client's timezone is America/Chicago and server's is
> America/Havana).
>
> But if I try the same code with python manage.py shell:
>
>>>>datetime.datetime.fromtimestamp(1395160800)
>
> the result is: datetime.datetime(2014, 3, 18, 11, 40)
>
> I've tried with USE_TZ=False (TIME_ZONE setting is America/Chicago and
> server local time is America/Havana) and I still get the same result. I
> guess a work around this issue would be to send the timestamp in UTC but I
> haven't found a reliable way to do so in Javascript.
>
> I would appreciate any help.
>
> Bests,
>
> Yoanis.
>
> --
> 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/0F5D31CD-462E-485D-9C2A-3613BD593C7C%402burbujas.net.
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOirb4pigNUhdau2qftpxKi4dR9pwW%3D0DFfbk%3DfRQ%2B7F%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Try clicking view source in your browser when you view it.  Perhaps
the URL needs to be HTML escaped?

Just a guess.

Aaron

On 3/21/14, Paolo Bertasi <paolo.b...@gmail.com> wrote:
> Hello,
> I'm trying to setup a mini django app to allow users to download files from
>
> s3. I wrote a simple python function (using boto of course) to fetch the
> correct url but when i handle the url with django the url is stripped.
> I wrote down the exact behaviour
> here<http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
> .
>
> Please help :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOgQt14WY4-r7neHjrPdxN0gJ24ETvJVNxFhq1k8%3DHEERA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Displaying HTML forms through AJAX

2013-12-27 Thread Aaron Decker
Arun, 

Do yourself some favors.

1. use jQuery for Ajax (or some other lib). You are doing it the very hard 
and not cross-browser compatible way.
2. use Django's template system for HTML generation.
3. if you do number 2 you can embed the CSRF token in the template render 
like you are supposed to.

-Aaron



On Thursday, December 26, 2013 1:10:42 PM UTC-5, Arun Kaushik wrote:
>
> I am a newbie. I am learning Django by developing a web application. There 
> is use-case where I got stuck. 
> there are 3 buttons on a html page
> *Personal info*
> *Education*
> *Work Experience*
> It is desired when the user click any of the button, respective html form 
> shall be displayed on right-half of web-page.
>
> *What I have tried is this, onclick function of buttons:*
> *function myfun()*
> *{*
> * var xmlhttp;*
> *if (window.XMLHttpRequest)*
> *  {*
> *  xmlhttp=new XMLHttpRequest();*
> *  }*
> *else*
> *  {*
> *  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");*
> *  }*
> *xmlhttp.onreadystatechange=function()*
> *  {*
> *  if (xmlhttp.readyState==4 && xmlhttp.status==200)*
> *{*
> *document.getElementById("rightpan").innerHTML=xmlhttp.responseText;*
> *}*
> *  }*
> *xmlhttp.open("GET","{% url "polls:demo_test" %}",true);*
> *xmlhttp.send();*
> *}*
> **
>
> *in views.py, demo test does this:*
>
> *def demo_test(request):*
> * return HttpResponse("  method='post'>Firstname: name='first_name' />Lastname: type='text' name='last_name' /> type='submit' value='Submit' />")*
>
>
>1. First of all, it works fine except that it *does not embed 
>CSRF_TOKEN* in the form, which is important.
>2. Secondly, I feel that this approach is against the philosophy of 
>django.
>
> Please give some suggestions on how can I do this. Loading HTML Forms 
> dynamically through AJAX.
>
>

-- 
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/4693cb5a-5c2f-43db-94df-c56988378b6d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Expected Behavior with Proxy Models

2013-12-18 Thread Aaron Spike
I experienced some obscure test failures after integrating Zinnia with my 
application. I've tracked it down to the behavior of Proxy Models and I'm 
unable
to rationalize the documentation with the behavior I see. Here's what I've 
done
to understand the issue:

If I create an app with a Proxy Model for auth.User (using get_user_model):

# pm/models.py
# a stripped down copy of Zinnia's Author
from django.db import models
from django.contrib.auth import get_user_model

class MyUser(get_user_model()):
objects = get_user_model()._default_manager

def __str__(self):
return self.get_full_name() or self.get_username()

class Meta:
app_label = 'pm'
proxy = True

I see the following behavior in the shell:

$ ./manage.py shell
Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth import get_user_model
>>> get_user_model()

>>> get_user_model().objects.model

>>> get_user_model().objects.get(pk=1)

>>> 

This seems to be contrary to the claim made in the documentation:

"QuerySets still return the model that was requested

There is no way to have Django return, say, a MyPerson object whenever 
you 
query for Person objects. A queryset for Person objects will return 
those 
types of objects. The whole point of proxy objects is that code relying 
on 
the original Person will use those and your own code can use the 
extensions 
you included (that no other code is relying on anyway). It is not a way 
to 
replace the Person (or any other) model everywhere with something of 
your 
own creation."


https://docs.djangoproject.com/en/dev/topics/db/models/#querysets-still-return-the-model-that-was-requested


If I create a second app and model with a Proxy for auth.User:

# pm2/models.py
from django.db import models
from django.contrib.auth import get_user_model

class MyUser2(get_user_model()):
objects = get_user_model()._default_manager

def __str__(self):
return self.get_full_name() or self.get_username()

class Meta:
app_label = 'pm2'
proxy = True

Then I get an AssertionError with the following traceback:

$ ./manage.py shell --traceback
Traceback (most recent call last):
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 222, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 255, in execute
output = self.handle(*args, **options)
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 385, in handle
return self.handle_noargs(**options)
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/core/management/commands/shell.py",
 
line 54, in handle_noargs
get_models()
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/db/models/loading.py",
 
line 197, in get_models
self._populate()
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/db/models/loading.py",
 
line 72, in _populate
self.load_app(app_name, True)
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/db/models/loading.py",
 
line 96, in load_app
models = import_module('.models', app_name)
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/utils/importlib.py",
 
line 35, in import_module
__import__(name)
  File "~/src/django_proxy_model_test/pm/models.py", line 5, in 
class MyUser(get_user_model()):
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/db/models/base.py",
 
line 134, in __new__
new_class._default_manager = 
new_class._default_manager._copy_to_model(new_class)
  File 
"~/.virtualenvs/django_proxy_model_test/local/lib/python2.7/site-packages/django/db/models/manager.py",
 
line 95, in _copy_to_model
assert issubclass(model, self.model)
AssertionError

After the first Proxy Model is registered, self.model points at the Proxy 
Model 
instead of the original Model. The second Proxy Model is not a subclass of 
the 
first.

Is there a contradiction between the behavior I observe and the 
documentation? 
Or am I simply misunderstanding

Re: URL generation in django

2013-09-07 Thread Aaron C. de Bruyn
I believe this is what you are looking for:

https://docs.djangoproject.com/en/1.5/topics/http/urls/#reverse-resolution-of-urls

-A


On Sat, Sep 7, 2013 at 8:17 PM, Nafiul Islam wrote:

> I've been busy exploring the different Python Web Frameworks, and it has
> been a rewarding experience. I wanted to ask regarding a certain feature
> that I found in Pyramid, and that is URL 
> generation.
> I wanted to ask if Django had something similar built in (I could not find
> something like this in the docs) or do I have to use a third-party library,
> if so then what library would you recommend?
>
> --
> Kind Regards,
> Nafiul Islam
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: I really about to give up Django

2013-08-30 Thread Aaron C. de Bruyn
Feel free to use whatever names you'd like in models.

def Ikhouvanjou(models.Model):
  #whatever field names you want...

-A


On Fri, Aug 30, 2013 at 6:23 PM, Dan Gentry  wrote:

>
> Just my opinion, but I see no reason to use English names in models.  Use
> whatever you wish.  English speaking programmers have been using cryptic
> variable names for decades.
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Gunicorn with Two Django App

2013-08-13 Thread Aaron C. de Bruyn
Just a stab in the dark, but are both projects using the same port?

Using gunicorn, you can set the IP and port the server runs on, then in
Nginx you need to tell each app to use the correct port.

Example from memory:

/home/aaron/app1 $ python manage.py gunicorn 127.0.0.1:8000

/home/aaron/app2 $ python manage.py gunicorn 127.0.0.1:8001

Then in the nginx config for app1 you need to point it to
127.0.0.1:8000and app2 needs to be pointed to
127.0.0.1:8001.

-A



On Tue, Aug 13, 2013 at 7:31 AM, Muhammed TÜFEKYAPAN
<muhammed...@gmail.com>wrote:

> Hello Everyone,
>
>
> I use digitalocean for server and i install nginx and unicorn for django.
> I have one service for my project. I also want to add new django project
> and i made it with making new services.
>
> When my one project running the other project stop.
>
> How can i run two projects same time?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: broken packages

2013-08-12 Thread Aaron C. de Bruyn
This isn't a django issue, but rather an issue with the package management
system in your Linux distribution.

This can happen if someone publishes a broken package, or you add on PPA's
that have conflicting requirements.

Basically it's saying that geonode depends on a version of Django greater
than 1.5.1 but version 1.4.1 is installed.  It may be that 1.5.1 is not
available in your distro yet.

You might try the Debian or Ubuntu forums for further assistance.

-A



On Mon, Aug 12, 2013 at 9:32 AM, Truongxuan Quang  wrote:

> I run command
> $sudo apt-get install geonode
> it showed as the list bellows:
>
>  geonode : Depends: python-django (>= 1.5.1) but 1.4.1-2ubuntu0.3 is to be
> installed
>Depends: python-agon-ratings but it is not installable
>Depends: python-dialogos but it is not installable
>Depends: python-django-activity-stream but it is not installable
>Depends: python-django-forms-bootstrap but it is not installable
>Depends: python-django-friendly-tag-loader but it is not
> installable
>Depends: python-django-geoexplorer but it is not installable
>Depends: python-django-jsonfield but it is not installable
>Depends: python-django-taggit but it is not installable
>Depends: python-django-taggit-templatetags but it is not
> installable
>Depends: python-django-user-accounts but it is not installable
>Depends: python-geonode-avatar but it is not installable
>Depends: python-gisdata but it is not installable
>Depends: python-gsconfig but it is not installable
>Depends: python-owslib but it is not installable
>Depends: python-pycsw but it is not installable
>Depends: python-paver but it is not installable
>Depends: python-user-messages but it is not installable
>Depends: python-django-announcements but it is not installable
>Depends: python-pinax-theme-bootstrap but it is not installable
>Depends: python-pinax-theme-bootstrap-account but it is not
> installable
> E: Unable to correct problems, you have held broken packages.
>
> I have used
> $sudo apt-get clean, autoclean, and install -f in order to fix packages
> but i was not success
>
> Please help me to fix these
>
> Many thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django windows user

2013-08-11 Thread Aaron C. de Bruyn
On Sun, Aug 11, 2013 at 1:35 PM, Robin Lery  wrote:

> have a linux server or hosting provider yet. I was just curious, as when
> the time will come to deploy in production level, what other basic things
> should I know. I will try the tutorials on ssh that you gave me. And thank
> you for your guidance!



There's lots to know.
My personal opinion is that you shouldn't take on too much at the start.
 If you know how to develop and market your app--stick to that.  Let
someone else host your site and deal with all the server stuff.

When your site starts getting wildly popular and you need to scale (or
hopefully a little bit before), start playing around on a test machine and
see what it takes to manage it appropriately.

Most of the servers I manage are Debian (or Ubuntu) based.  So the majority
of what I need to know is 'apt-get update && apt-get dist-upgrade' to keep
packages up-to-date, followed by a decent knowledge of Nginx (web server),
uwsgi (a WSGI...host?...that runs your Django app), MySQL or Postgresql for
your database,  followed by some basic SSH/SCP knowledge.  For Windows
users I recommend two tools:  PuTTY and WinSCP.  PuTTY will give you
command-line access via SSH on your server.  WinSCP is a nice
file-management GUI.

Not to say there isn't deeper knowledge required for tuning, caching,
firewalling, etc...but that's the majority of it.

If you ever have specific systems-management questions that aren't
particularly applicable to Django, Google is your friend--or shoot me an
e-mail.

-A

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django windows user

2013-08-10 Thread Aaron C. de Bruyn
Google is your friend.

The first tutorial that came up when I searched for 'ssh for windows users'
was this site:
http://support.suso.com/supki/SSH_Tutorial_for_Windows

Do you have an existing Linux server at your house or with a hosting
provider?

If managing a Linux server is too steep of a learning curve, there are
several providers out there that will do that for you and provide you a
simple way to deploy your application.

A good resource is Django Hosting: http://djangohosting.com/

Each provider has different requirements for 'automagically' deploying your
site.  Some use 'requirements.txt' file or a 'Procfile'.

Some people find Heroku easy and cheap for deploying small test
applications: https://www.heroku.com/

If you have specific questions, please ask them and the community would be
glad to assist.

-A



On Sat, Aug 10, 2013 at 3:27 PM, Robin Lery  wrote:

> Hello,
> I am a windows user, and its great learning django and python as well. I
> am just curious that, when I happen to deploy my site for production, is it
> helpful to deploy in unix system. And if there is, please guide me to use
> ssh and other stuff that is required to deploy so. Any help will be highly
> appreciated.
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




  1   2   3   4   >