Django Modules for comparative "shopping cart" and data analysis

2014-01-06 Thread Frank Jaworski
Hello, 

Given the task of creating an application that presented the user with a 
pseudo-shopping cart they could add and subtract to see the potential cost 
and savings over a period time with graphing and analysis of said 
comparisons, what does Django have to offer in terms of existing modules? 
 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/572ce064-42b8-4c4f-a0a1-ea758e87c74d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Deploying to Heroku for first time, Dynos is blank, not recognizing Procfile

2014-01-06 Thread Scott Meyers


Programming newb, Trying to use Heroku for the first time for a Django app. 
After I push it to Heroku, the Dynos field is blank. I expected to see my 
procfile: web: python manage.py runserver 0.0.0.0:$PORT --noreload

Of course, when I try to open the application on Heroku, I get: An error 
occurred in the application and your page could not be served. Please try 
again in a few moments.

If you are the application owner, check your logs for details

Could this be because I don't have an extension on my procfile?

My Procfile should just be a file I created in my text editor, right?

Here is the log:

2014-01-06T07:34:17.321925+00:00 heroku[router]: at=error code=H14 desc="No 
web processes running" method=GET path=/ 
host=aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect= 
service= status=503 bytes=

2014-01-06T07:34:17.778360+00:00 heroku[router]: at=error code=H14 desc="No 
web processes running" method=GET path=/favicon.ico 
host=aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect= 
service= status=503 bytes=

2014-01-06T07:35:01.608749+00:00 heroku[router]: at=error code=H14 desc="No 
web processes running" method=GET path=/ 
host=aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect= 
service= status=503 bytes=

2014-01-06T07:35:01.868486+00:00 heroku[router]: at=error code=H14 desc="No 
web processes running" method=GET path=/favicon.ico 
host=aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect= 
service= status=503 bytes=

2014-01-06T07:46:57.862560+00:00 heroku[router]: at=error code=H14 desc="No 
web processes running" method=GET path=/ 
host=aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect= 
service= status=503 bytes=

2014-01-06T07:46:58.114270+00:00 heroku[router]: at=error code=H14 desc="No 
web processes running" method=GET path=/favicon.ico 
host=aqueous-dawn-4712.herokuapp.com fwd="98.232.45.58" dyno= connect= 
service= status=503 bytes=

-- 
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/293796b7-2700-4c95-ac02-25c512ea41b0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Broken links even after change the site information

2014-01-06 Thread Carlos Quiros
Hello.

I have a Django application running in my server 
http://data.ilri.org/formhub

However the links of the application are broken for example 
*http://data.ilri.org/accounts/register/* instead of 
*http://data.ilri.org/formhub/accounts/register/ 
*

I been looking on the internet and also configured the site framework with:

python manage.py shell
>>> from django.contrib.sites.models import Site
>>> one = Site.objects.all()[0]
>>> one.domain = 'http://data.ilri.org/formhub/'
>>> one.name = 'Formhub'
>>> one.save()
>>> quit()
(formhub-env)[cquiros@rmg formhub]$ python manage.py dumpdata sites
Your environment is:"formhub.preset.default_settings"
[{"pk": 1, "model": "sites.site", "fields": {"domain": 
"http://data.ilri.org/formhub/;, "name": "Formhub"}}](formhubnv)

But still the links are broken.

What else do I need to do?

Any help is much appreciated.

Carlos.

-- 
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/c3d05252-7253-409d-ab03-5f9296bdc24c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


report

2014-01-06 Thread fabricio
 
I am creating a report and I would like to show me when a message was being 
processed in my view http://pastebin.com/RFuefdRu




 I'm using blockUI when I click the print button I do not know if this right 
way to do thiscode javascript http://pastebin.com/0eRRWybL


if someone can help me 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/29e66a2f-cd92-4ef5-a094-5b2c7aefb329%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django manage.py returns ValueError: zero length field name in format

2014-01-06 Thread Jaimin Patel
Its highly recommended that you use Python 2.7. It should resolve the issue.

Thanks.

On Sunday, January 5, 2014 8:50:06 PM UTC-5, Carlos Quiros wrote:
>
> Hi,
>
> I am trying to run a Django application in Python 2.6.6 Django==1.5.5 . 
> But when I try to run
>
> *python manage.py*
>
> I get:
>
> *Traceback (most recent call last):
>   File "manage.py", line 12, in 
> print('Your environment 
> is:"{}"'.format(os.environ['DJANGO_SETTINGS_MODULE']))
> ValueError: zero length field name in** format*
>
> Any idea what is wrong? I am also running the same application in another 
> server but with Python 2.7.5 and it works ok.
>
> Note: DJANGO_SETTINGS_MODULE is an environmental variable in both systems
>
> Thanks,
>
> Carlos
>
>
>
>

-- 
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/e5af3bfe-9a1f-4948-b8c8-5dabf69bcbe4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Seperate fields for SelectDateWidget in template

2014-01-06 Thread voger
I have Googled a lot but I can't find an answer. I want to use 
SelectDateWidget in one of my forms but I want the select boxes in 
separate divs so I can use them with Zurb Foundation. With all the other 
widgets it is easy. For example I can do



{{ form.username.label_tag }}{{ form.username }}{{ 
form.username.errors }}



but with SelectDateWidget I want to do something like

{{ form.birth_date.label_tag }}

{{ form.birth_date_month }}


{{ form.birth_date_day }}


{{ form.birth_date_year }}

 {{ form.birth_date.errors }}

so I can use it with Foundation's grid system. I even looked at 
SelectDateWidget source but I couldn't understand how to do it.


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


Re: Django manage.py returns ValueError: zero length field name in format

2014-01-06 Thread Jaimin Patel
Here you can read it, 
https://docs.djangoproject.com/en/dev/releases/1.5/#python-compatibility

though I agree that is should be working fine with your current setup as it 
does mention that its compatible with 2.6.5+. However, if its not too much 
trouble just update to 2.7 and it should work fine. (I had come across this 
issue in past and python version upgrade fixed for me.)

On Monday, January 6, 2014 10:13:47 AM UTC-5, Jaimin Patel wrote:
>
> Its highly recommended that you use Python 2.7. It should resolve the 
> issue.
>
> Thanks.
>
> On Sunday, January 5, 2014 8:50:06 PM UTC-5, Carlos Quiros wrote:
>>
>> Hi,
>>
>> I am trying to run a Django application in Python 2.6.6 Django==1.5.5 . 
>> But when I try to run
>>
>> *python manage.py*
>>
>> I get:
>>
>> *Traceback (most recent call last):
>>   File "manage.py", line 12, in 
>> print('Your environment 
>> is:"{}"'.format(os.environ['DJANGO_SETTINGS_MODULE']))
>> ValueError: zero length field name in** format*
>>
>> Any idea what is wrong? I am also running the same application in another 
>> server but with Python 2.7.5 and it works ok.
>>
>> Note: DJANGO_SETTINGS_MODULE is an environmental variable in both systems
>>
>> Thanks,
>>
>> Carlos
>>
>>
>>
>>

-- 
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/b8874d4e-d8e7-4f17-8a64-66397424fda6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Looking for a full time Django/Python job (Rochester, NY area OR remote)

2014-01-06 Thread Adam Stein
As I can't relocate, I'm looking for something either in the Rochester,
NY area OR remote.

I've been using Django for professional and personal use for about 6
years.  Check out my LinkedIn page (www.linkedin.com/in/adamestein/
) for more details about my skills and work history.  A resume is
available upon request.

I'm currently using Django/Python for my own personal projects.  You can
see examples at http://stein.alwaysdata.net/. The 'Home Web Apps' is
meant to keep track of my monthly bill payments.  The 'Shop Owner Web
Apps' is meant to keep track of inventory and sales.  Just log in with
the user name "guest" and password "guest" for either project.  These
are meant just for me so it's missing functionality that you would see
in a commercial project, but it does provide an example of Django and
JavaScript (specifically jQuery).  Also, they are works in progress.
Feel free to try out anything you want.  The "guest" account is
specifically there so I can show these projects to others.

Other Python and/or Django examples can be found at
https://github.com/adamestein/.  My tic-tac-toe program is a command
line program with an option (--humanstart) to allow the human to go
first.  All other projects were created by someone else, but I added
functionality that I needed for home Django projects.

You can contact me at 'a...@csh.rit.edu' or through my LinkedIn profile.

-- 
Adam Stein (a...@csh.rit.edu)


-- 
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/1389020809.2567.42.camel%40zookeeper.steinhome.net.
For more options, visit https://groups.google.com/groups/opt_out.


Re: VERY cheap django hosting?

2014-01-06 Thread Дмитрий Вержиковский
I use digitalocean.com . 
For only 5$/month you get a great quick ssd hosting.

среда, 8 июня 2011 г., 9:30:17 UTC+3 пользователь raj написал:
>
> Hey guys, 
> Just wondering if you could give me some hosts that are very cheap for 
> django hosting? Is hostgator any good? I really don't know what to 
> look for in a host. A lot of people are recommending web faction, but 
> its around $9 bucks a month. I was looking in the $5 bucks a month 
> range. Any ideas? Thank you. 
> -Raj

-- 
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/aff31d36-0f01-4160-a9a9-db4f3540d4a2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: wait message

2014-01-06 Thread Derek
Have a look at this SO Q:

http://stackoverflow.com/questions/7554405/wait-for-a-file-using-jquery

You should be able to easily write a server-side function in Django that 
can check for the existence of the file...

On Sunday, 5 January 2014 15:27:13 UTC+2, fabricio wrote:
>
> But my process is all done in an application that I use to report and give 
> fpdf when I click the print button the process is all done there
>

-- 
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/cf8d12a7-8422-4ecb-afaa-5e80b8b66378%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: VERY cheap django hosting?

2014-01-06 Thread Mark Moss
Try instant Django Hosting by 
Gigapros.com ==> 
*http://www.gigapros.com/portal/django-hosting*
Don't waste your time on installation. Just start using django framework 
out-of-the-box!

-  Mark


On Wednesday, June 8, 2011 12:00:17 PM UTC+5:30, raj wrote:
>
> Hey guys, 
> Just wondering if you could give me some hosts that are very cheap for 
> django hosting? Is hostgator any good? I really don't know what to 
> look for in a host. A lot of people are recommending web faction, but 
> its around $9 bucks a month. I was looking in the $5 bucks a month 
> range. Any ideas? Thank you. 
> -Raj

-- 
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/069821ec-ad08-4a1a-bf01-c803ab167da2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ViewDoesNotExist at /admin/

2014-01-06 Thread Gabriele Stoia
Hi,

I fixed my problem changing the .fcgi file like this:















*#!/usr/bin/eval PYTHON_VERSION=2.6 DJANGO_VERSION=1.5.4 pythonimport os, 
syssys.path.append('/home/path/to/myproject/')#_PROJECT_DIR = 
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))//delete 
this line#sys.path.insert(0, 
_PROJECT_DIR)   
 
//delete this line#sys.path.insert(0, 
os.path.dirname(_PROJECT_DIR))   
//delete this line#_PROJECT_NAME = 
_PROJECT_DIR.split('/')[-1]
//delete this 
linesys.path.insert(0,'/home/path/to/myproject/')   
  
//add this lineos.environ['DJANGO_SETTINGS_MODULE'] = 
"myProject.settings"from django.core.servers.fastcgi import 
runfastcgirunfastcgi(method="threaded", daemonize="false")*



Il giorno venerdì 27 dicembre 2013 22:03:33 UTC+7, Cal Leeming [Simplicity 
Media Ltd] ha scritto:
>
> Hello,
>
> Perhaps try installing a completely new/fresh dev environment in a 
> vmware/virtualbox instance, and attempt to get it working from there, that 
> will at least help you narrow this problem down locally instead of poking 
> around at production. Also try and make sure you install the same 
> OS/release as what you are trying to deploy in production. You should also 
> use virtualenv/virtualenvwrapper to help reduce the chance of 
> library/dependency conflict.
>
> Also heads up - realistically the mailing lists are here to point you in 
> the right direction, but it's up to you to do as much of the work as 
> possible. If you come up against a problem, 99% of the time Google will 
> already have the answer. Some great examples of how to use Google 
> accurately can be found at 
> https://code.djangoproject.com/wiki/UsingTheMailingList .
>
> If you're not sure how to use any of the things mentioned, then here are 
> some good starting points for learning;
>
> http://gettingstartedwithdjango.com/ - Django learning
> http://learnpythonthehardway.org/book/next.html - Python learning
> http://virtualenvwrapper.readthedocs.org/en/latest/
>
> Hope this helps, and remember to update this thread once you figure out 
> the answer so others can find it in the future.
>
> Cal
>
>
>
>
> On Fri, Dec 27, 2013 at 12:34 PM, Gabriele Stoia 
>  > wrote:
>
>> Thank you Tom for your answer. 
>> I'm sorry but I don't have much experience with Django...
>>
>> Do you have an idea how to fix this problem ?
>>
>> Thanks in advance
>> Gabri
>>
>> Il giorno martedì 24 dicembre 2013 20:58:32 UTC+7, Thomas ha scritto:
>>>
>>>
>>> On 2013-12-23, at 9:42 PM, Gabriele Stoia  wrote:
>>>
>>> I think I found the problem...maybe...
>>>
>>> I running my app in the same hosting of another app ... (sorry for my 
>>> english..is not my first language... I'm italian…)
>>>
>>>
>>> If you are not using virtualenv and pip to manage each of these 
>>> installations you will likely find it useful to do so. It should eliminate 
>>> worries about conflicts between version sets.
>>>
>>> hth
>>>
>>>   - Tom
>>>
>>>
>>>
>>> I have
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *-- first app-- feincms-- other module-- ...--second app-- -- feincms-- 
>>> -- other module*
>>>
>>> Maybe my second-app is using feincms of the first app which is different 
>>> version.
>>> I think this because I got this error :
>>>
>>> No module named filterspecs
>>> /home/*alessandrocambogia*/feincms/admin/filterspecs.py in , line 7
>>>
>>> where *alessandrocambogia *is the first-app.
>>>
>>> I need to have 
>>> /home/alessandrocambogia/*gabryandjenny*/feincms
>>>
>>> where *gabryandjenny * is the second-app
>>>
>>> but actually I don't know how to change the path... Is my first experience 
>>> in Django.
>>>
>>> Can you help in this  Please ??? 
>>> Thank you in advance.
>>>
>>> Gabri
>>>
>>>
>>>
>>>
>>> Il giorno martedì 24 dicembre 2013 07:45:02 UTC+7, Russell Keith-Magee 
>>> ha scritto:


 On Mon, Dec 23, 2013 at 10:53 AM, Gabriele Stoia 
 wrote:

> Hi Russel,
>
> thank you for your e-mail !!!
> I thought that something was connected with MPTT or FeinCMS... I'll 
> try to work out !
> What I really don't understand why so many problem when you in 
> deployment ??? In local everything was super fine !!!
>

 If you're having "deployment only" problems, this points to a problem 
 with the way your development process is organised. These sorts of 
 problems 
 only emerge because your development environment is fundamentally 
 different 
 to your production environment -- for example, different versions of 
 software, different paths. If you make good use of virtualenv to isolate 
 your project, and use requirements files to ensure version compatibility, 
 you should be able to minimise this sort of 

Re: test driven development and mixin for views

2014-01-06 Thread Sven
Hi Arun,

thanks for this advice. I finally came also to the conclusion that the best 
test would be to create (as part of each test case) all possible use case 
szenarios for this mixin class. For instance if it should be utilizable for 
ListView and CreateView then i would create unit tests against those 2 classes 
with an inheritance of that mixin. This should be the only way to quarantee 
the correct behavior of the mixin within a given use case. 

If someone would use the mixin outside of this, let's say for DetailView and 
this was not explicit tested then there is no gurantee that it will still 
behave as expected. That should be fair enought.

Thanks,
Sven

On Monday 06 January 2014 02:08:29 trojactory wrote:
> Hi sassman,
> 
> Since you mentioned TDD, I assume you are talking about unit tests. As with
> any matter in quality control, the more you can test, the better!
> 
> In my opinion, you would need to provide atleast one testcase for each of
> the four CBV views. It is better to create a derived class in each case
> rather than mocking it.
> 
> Regards,
> Arun
> 
> On Monday, January 6, 2014 12:01:30 AM UTC+5:30, sassman wrote:
> > Hi Folks,
> > 
> > i recently wrote some small mixins that are intented to be attached to CBV
> > like ListView, UpdateView, DetailView or even CreateView. The aim is to
> > give
> > users only access to their data. Their in terms of ownership. As an
> > Example
> > you have a Post model were a field called owner is a ForeignKey to
> > 'auth.User'
> > as a basic example.
> > 
> > So the mixin does filtering the queryset and passes an additional
> > parameter to
> > form classes where as an additional form Mixin then passes this down to
> > the
> > model. So far so good. (see http://pastebin.kde.org/pyzrouxfw)
> > 
> > Now my Question:
> > 
> > what would be the best solution to write a dedicated test against this
> > mixin?
> > Would it be good or worth to create some Views loke the 4 above that
> > inherits
> > also the Mixin and then test against this as a complete behaviour? Or
> > better
> > mock it somehow differently?
> > 
> > I really appreaciate your suggestions!!
> > 
> > 
> > 
> > 
> > Best Regards
> > 
> > Sven
-- 


Best Regards, 
Sven

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


How do I save my scrapped data to my Database

2014-01-06 Thread yesplorer
Hi everyone, 

I'm using Django 1.5, Python 2.7 on windows 7.
I have the following view that extracts and display links from various 
sources. It works ok. But I don't know how to: 
1. save the data to the database and 
2. sort it by date extracted.

I hope someone could help me here.

views.py:

def foo():
site = "http://www.foo.com/portal/jobs;
hdr = {'User-Agent' : 'Mozilla/5.0'}
req = urllib2.Request(site, headers=hdr)
jobpass = urllib2.urlopen(req)
soup = BeautifulSoup(jobpass)
for tag in soup.find_all('a', href = True):
tag['href'] = 
urlparse.urljoin('http://www.businessghana.com/portal/',  tag['href'])
return map(str, soup.find_all('a', href = re.compile('.getJobInfo')))

def example():
site = "http://example.com;
hdr = {'User-Agent' : 'Mozilla/5.0'}
req = urllib2.Request(site, headers=hdr)
jobpass = urllib2.urlopen(req)
soup = BeautifulSoup(jobpass)
return map(str, soup.find_all('a', href = re.compile('.display-job')))

 foo_links = foo()
 example_links = example()

def all_links():
return (foo_links + example_links)

def display_links(request):
name = all_links()
paginator = Paginator(name, 25)
page = request.GET.get('page')
try:
name = paginator.page(page)
except PageNotAnInteger:
name = paginator.page(1)
except EmptyPage:
name = paginator.page(paginator.num_pages)

return render_to_response('jobs.html', {'name' : name}) 




my template looks like this:


{% for link in name %}
   {{ link|safe }}
{% endfor %}
 
 

{% if name.has_previous %}
Previous
{% endif %}


Page {{ name.number }} of {{ name.paginator.num_pages}}.


{% if name.has_next %}
next
{% endif %}

 


My model looks like this:

from django.db import models

class jobLinks(models.Model):
links = models.URLField()
pub_date = models.DateTimeField('date retrieved')

def __unicode__(self):
return self.links

It is my first programming project and I can't get this part to work no 
matter what I tried/searched
Any help will 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d7d719a-6c92-4d09-85e7-ee95d86d7a67%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Embedding images like on Quora

2014-01-06 Thread Vibhu Rishi
Hi Arun

Thanks man. This is also interesting.

However, I dont really want to download the web and autolink the image ( as
how it is in facebook - though I think now that I know i would want to try
it out also). What I want to achieve is that if there is an image which a
person has hosted on google+/flickr/etc , just pasting that url in his post
will show the thumbnail of that image. So, lets say he has an album on
google+, and he is referencing 2 or 3 images he can then just paste their
links, and they show up as images.

V.


On Mon, Jan 6, 2014 at 3:16 PM, trojactory  wrote:

> Hi Vibhu,
>
> This works automatically for certain sites if they implement a standard
> called oEmbed (http://oembed.com/). Several sites like Flickr, Youtube
> etc support providing a thumbnail for a url within their domain. Django has
> several packages which support oEmbed, of which, I have used micawber (
> https://pypi.python.org/pypi/micawber) very successfully in the past.
>
> For a general solution, you will need to download the page in the
> background and parse it for a representative image.
>
> Hope this addresses your question.
>
> Regards,
> Arun
>
> On Monday, January 6, 2014 2:48:30 PM UTC+5:30, Vibhu Rishi wrote:
>>
>> Hi,
>>
>> Is there a way to have images show up by just pasting a url ?
>>
>> e.g. on Quora, if i paste a url to an image - http://www.brothersthegame.
>> com/core/media/images/brothers_europe05_big.jpg
>>
>> it shows up as an image not as a URL. How can I achieve the same using
>> django ?
>>
>> Regards,
>> Vibhu
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>  --
> 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/4bf2d938-75a2-4fa9-9796-9a52a150a073%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwnq10r7x1Ly6waB1%3D28cKcdDCEf%3D78d3fv_YHffSzu3hg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: test driven development and mixin for views

2014-01-06 Thread trojactory
Hi sassman,

Since you mentioned TDD, I assume you are talking about unit tests. As with 
any matter in quality control, the more you can test, the better! 

In my opinion, you would need to provide atleast one testcase for each of 
the four CBV views. It is better to create a derived class in each case 
rather than mocking it.

Regards,
Arun

On Monday, January 6, 2014 12:01:30 AM UTC+5:30, sassman wrote:
>
> Hi Folks, 
>
> i recently wrote some small mixins that are intented to be attached to CBV 
> like ListView, UpdateView, DetailView or even CreateView. The aim is to 
> give 
> users only access to their data. Their in terms of ownership. As an 
> Example 
> you have a Post model were a field called owner is a ForeignKey to 
> 'auth.User' 
> as a basic example. 
>
> So the mixin does filtering the queryset and passes an additional 
> parameter to 
> form classes where as an additional form Mixin then passes this down to 
> the 
> model. So far so good. (see http://pastebin.kde.org/pyzrouxfw) 
>
> Now my Question: 
>
> what would be the best solution to write a dedicated test against this 
> mixin? 
> Would it be good or worth to create some Views loke the 4 above that 
> inherits 
> also the Mixin and then test against this as a complete behaviour? Or 
> better 
> mock it somehow differently? 
>
> I really appreaciate your suggestions!! 
>
>
> -- 
>
>
> Best Regards 
>   
> Sven 
>
>

-- 
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/8125cbbb-f689-4db7-b3d1-4832c9a15aac%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Embedding images like on Quora

2014-01-06 Thread trojactory
Hi Vibhu,

This works automatically for certain sites if they implement a standard 
called oEmbed (http://oembed.com/). Several sites like Flickr, Youtube etc 
support providing a thumbnail for a url within their domain. Django has 
several packages which support oEmbed, of which, I have used micawber (
https://pypi.python.org/pypi/micawber) very successfully in the past.

For a general solution, you will need to download the page in the 
background and parse it for a representative image. 

Hope this addresses your question.

Regards,
Arun

On Monday, January 6, 2014 2:48:30 PM UTC+5:30, Vibhu Rishi wrote:
>
> Hi,
>
> Is there a way to have images show up by just pasting a url ? 
>
> e.g. on Quora, if i paste a url to an image - 
> http://www.brothersthegame.com/core/media/images/brothers_europe05_big.jpg
>
> it shows up as an image not as a URL. How can I achieve the same using 
> django ? 
>
> Regards,
> Vibhu
>
> -- 
> Simplicity is the ultimate sophistication. - Leonardo da Vinci
> Life is really simple, but we insist on making it complicated. - Confucius 
>

-- 
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/4bf2d938-75a2-4fa9-9796-9a52a150a073%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Embedding images like on Quora

2014-01-06 Thread Vibhu Rishi
some more details of what I am looking for :

Its a forum kind of thing. So, the model has a TextField where user can
type whatever text he wants which can include urls and images.

for urls, i can use a template filter like urlize
I want something similar for images ( imgize ? )

V.


On Mon, Jan 6, 2014 at 2:48 PM, Vibhu Rishi  wrote:

> Hi,
>
> Is there a way to have images show up by just pasting a url ?
>
> e.g. on Quora, if i paste a url to an image -
> http://www.brothersthegame.com/core/media/images/brothers_europe05_big.jpg
>
> it shows up as an image not as a URL. How can I achieve the same using
> django ?
>
> Regards,
> Vibhu
>
> --
> Simplicity is the ultimate sophistication. - Leonardo da Vinci
> Life is really simple, but we insist on making it complicated. - Confucius
>



-- 
Simplicity is the ultimate sophistication. - Leonardo da Vinci
Life is really simple, but we insist on making it complicated. - Confucius

-- 
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/CAPiONwkWeMO5QySssfuQ%3D%3DmzPXQ1R2j9guK-oM1L5QCrqpGfzw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Can't Install on Windows 8.1

2014-01-06 Thread Mike Dewhirst

Malik

I'm confused. What are you doing with GAE and Windows 8.1? Have you 
given up Windows?


Also, I think you will fare better with Pillow rather than PIL. It seems 
PIL is no longer being supported and Pillow has taken over.


Mike

On 5/01/2014 11:57pm, Malik Rumi wrote:

This is just an update to all of you, and to anyone coming after me with
similar problems. No, I did not get what I wanted for Christmas. It
turns out distribute has been deprecated, and I should have gotten the
"new" setuptools instead. It seems the brilliant minds behind distribute
set up a 'fake' setuptools and deleted pkg_resources. I can't begin to
understand all that. But my upgrade, like so many other things in this
project, has failed. I posted to their mailing list so we'll see what
happens there. I do not have Django or any other accessory up and running.

I did move my install to c:\Python27, and that allowed me to get PIL,
which had failed before, but then GAE decided to insist I use a
python25.dll, which of course caused errors. It seems this is triggered
if the python install is in the default place. How stupid is that?
anyway, I got a patch (not from Google) and my GAE is fine again.
Nevertheless, all this has eaten up a lot of time.

When and if I ever get Django running I'll be back, but I don't expect
to have any Windows problems anymore. Thanks.

On Wednesday, December 25, 2013 4:02:52 PM UTC-6, Felipe Coelho wrote:

2013/12/25 Malik Rumi 

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

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



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

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

Here is that last portion from my command line window:

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

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

/Downloading/unpacking django/

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

/  Running setup.py egg_info for package django/

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

/under dir/

/ectory '*'/

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

/under direct/

/ory '*'/

/Installing collected packages: django/

/  Running setup.py install for django/

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

/under dir/

/ectory '*'/

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

/under direct/

/ory '*'/

/Successfully installed django/

/Cleaning up.../

/
/

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

/
/

/startproject/

/ project_sl1/

/
/

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

/
/

/startproject/

/ project_sl1/

/Access is denied./

/
/

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

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