hi

2021-09-14 Thread Jonathan MBADOU
hi

-- 
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/851a7bb3-dedd-4c59-962c-a5bbf85478aan%40googlegroups.com.


django

2021-03-29 Thread Jonathan Bilesi
hi 
i getting this error 
ValueError at /empty range for randrange() (0, 0, 0)

here my code 

random_object = Trending.objects.all()[randint(0, len(trending) -1)] 

-- 
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/61600bb6-f877-4588-a799-0b29109d43d5n%40googlegroups.com.


Re: Django/python free Training

2020-12-22 Thread Jonathan Mator
I am interested

On Mon, Dec 21, 2020, 12:40 PM David Zea  wrote:

> Hi.
>
> I'm  Interested!
>
>
> El vie, 18 dic 2020 a las 9:26, Python Class ()
> escribió:
>
>> Hi guys,
>>
>> I am manucho from Kenya and am good developer with django and python and
>> i want to teach people what i know .I want to start a youtube channel for
>> Django and python based tutorials ..If intrested you can message me here on
>> concepts and projects you want covered and i will start immediately.
>>
>> Regards,
>> Manucho.
>>
>> --
>> 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/5c715780-23c4-4d31-9219-a1e7b92c14f1n%40googlegroups.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALsZvTtRGrEfqiOgReB4kmw_EtCteKKx-QYxXq0shqsrL7q5fw%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B1BtCQmrcKEUin8M3N1g-Jmw67J2%2BWxMqXBo55GTPWObs5P8w%40mail.gmail.com.


Re: guys help me please, I cannot upload images from django form,

2020-08-29 Thread Jonathan Villavicencio
Hello!
in the class Posts in the field "image" add upload_to=upload_path for
example:
image = models.ImageField(blank=True, null=True, verbose_name='surat',
upload_to=upload_path)

upload_path is a method
write it before of the class definition
def upload_path(instance, filename):
return '/'.join([instance.image, filename])

El sáb., 29 de ago. de 2020 a la(s) 11:16, allaberdi...@gmail.com (
allaberdi16yazha...@gmail.com) escribió:

> I can upload images from django admin panel but cannot to do same thing
> with django form ,  it saves any text but did not save images only,  anyone
> help me  please
> this is my code:
>
> models.py:
> class Posts(models.Model):
>
> Ahal = 'Ahal'
> Balkan = 'Balkan'
> Dasoguz = 'Dasoguz'
> Lebap = 'Lebap'
> Mary = 'Mary'
>
>
> CHOOSE_REGION = {
> (Ahal,'Ahal'),
> (Balkan,'Balkan'),
> (Dasoguz,'Dasoguz'),
> (Lebap,'Lebap'),
> (Mary,'Mary')
> }
>
>
> name = models.CharField(max_length=30, blank=False, verbose_name='Ady')
> image = models.ImageField(blank=True, null=True, verbose_name='surat')
> text = models.TextField(verbose_name='gosmaça maglumat')
> price = models.FloatField(verbose_name='bahasy')
> region = models.CharField(max_length=30, choices=CHOOSE_REGION,
> blank=False, verbose_name='welaýat')
> district = models.CharField(max_length=30, blank=False,
> verbose_name='etrab')
> user = models.ForeignKey(User, on_delete=models.CASCADE,
> verbose_name='eýesi')
> phone = models.CharField(max_length=50, blank=False, verbose_name='telefon
> belgisi')
> published = models.DateTimeField(auto_now=True, verbose_name='satuwa çykan
> guni')
>
>
>
> forms.py:
> class PostForm(forms.ModelForm):
> class Meta:
> model = Posts
> fields = ['name','image','text','price','region','district','user','phone']
>
>
> views.py:
> def add_post(request):
> form = PostForm(request.POST or None)
> if form.is_valid():
> form.save()
> template = 'add_post.html'
> context = {'form':form}
> return render(request,template,context)
>
> settings.py:
>
> STATIC_URL = '/static/'
> STATICFILES_DIR = [Path(BASE_DIR,'static')]
>
> MEDIA_URL = '/media/'
> MEDIA_ROOT = Path(BASE_DIR,'media')
>
>
> urls.py:
>
> from django.conf.urls.static import static
> from django.conf import settings
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('', include('posts.urls')),
> ]
>
> urlpatterns += static(settings.MEDIA_URL,
> document_root=settings.MEDIA_ROOT)
>
>
>
> html form tag:
> {% extends 'index.html' %}
>
> {% load static %}
>
> {% block content %}
>
> 
> {% csrf_token %}
> {{form.media}}
> {{form.as_p}}
> 
> 
>
> {% endblock %}
>
> --
> 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/ad47578f-64a8-40b5-b72b-f3eebb668dben%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAEkprV7PmRfkHyMD4VS%3DiN6S%2BjGUwaoaWrkxQ2fhWWXOoHc9Q%40mail.gmail.com.


Re: configure nginx

2020-06-22 Thread Jonathan Spicer
>From the error message it appears something is already listening on port
80. Do you apache installed? Or do you have python running as a web server?

If something is already using the same port number the service can't start.

Kind regards

Johnny

On Sun, 21 Jun 2020 at 05:21, Giovanni Silva  wrote:

> I have an Error:
>
> nginx.service - A high performance web server and a reverse proxy server
>  Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor
> preset: enabled)
>  Active: failed (Result: exit-code) since Sun 2020-06-21 06:17:48
> CEST; 35s ago
>Docs: man:nginx(8)
> Process: 26937 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on;
> master_process on; (code=exited, status=0/SUCCESS)
> Process: 26938 ExecStart=/usr/sbin/nginx -g daemon on; master_process
> on; (code=exited, status=1/FAILURE)
>
> Jun 21 06:17:45 vmi404911.contaboserver.net systemd[1]: Starting A high
> performance web server and a reverse proxy server...
> Jun 21 06:17:45 vmi404911.contaboserver.net nginx[26938]: nginx: [emerg]
> bind() to 0.0.0.0:80 failed (98: Address already in use)
> Jun 21 06:17:46 vmi404911.contaboserver.net nginx[26938]: nginx: [emerg]
> bind() to 0.0.0.0:80 failed (98: Address already in use)
> Jun 21 06:17:46 vmi404911.contaboserver.net nginx[26938]: nginx: [emerg]
> bind() to 0.0.0.0:80 failed (98: Address already in use)
> Jun 21 06:17:47 vmi404911.contaboserver.net nginx[26938]: nginx: [emerg]
> bind() to 0.0.0.0:80 failed (98: Address already in use)
> Jun 21 06:17:47 vmi404911.contaboserver.net nginx[26938]: nginx: [emerg]
> bind() to 0.0.0.0:80 failed (98: Address already in use)
> Jun 21 06:17:48 vmi404911.contaboserver.net nginx[26938]: nginx: [emerg]
> still could not bind()
> Jun 21 06:17:48 vmi404911.contaboserver.net systemd[1]: nginx.service:
> Control process exited, code=exited, status=1/FAILURE
> Jun 21 06:17:48 vmi404911.contaboserver.net systemd[1]: nginx.service:
> Failed with result 'exit-code'.
> Jun 21 06:17:48 vmi404911.contaboserver.net systemd[1]: Failed to start A
> high performance web server and a reverse proxy server.
>
> Can anyone help -me?
>
> --
> *Giovanni Silva*
> +55 31 9 9532-1877
>
> --
> 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/CABO2r9fXi%3DLK0pRp5UQ%2B5r8mZeNYPwGr6TLwQLRZ%2BbZKMqt5ow%40mail.gmail.com
> 
> .
>


-- 

Kind regards

Johnny Spicer

e: joh...@spicersolutions.com
m: +44 (0) 7821 329479 <+44%207821%20329479>
w: www.spicersolutions.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOLOTcJVPbYSQtWhEn3L3N27-HTsmSS%3DDqqTz23656ooziULDw%40mail.gmail.com.


Set a default value for a field as the instance of a second model (which links to a third)

2020-04-28 Thread Jonathan Acres
Based on the topic description, I can't help but feel I'm already 
overcomplicating this...

I have 3 models:

   - Audit
   - LeadAuditor
   - Action

The Audit model links to Lead_Auditor so each Audit instance has a single 
Audit.lead_auditor:

*lead_auditor = models.ForeignKey('LeadAuditor', on_delete=models.SET_NULL, 
null=True)*
The Action model links to Audit so each Action instance has a single 
Action.audit_ref:

*audit_ref = models.ForeignKey('Audit', on_delete=models.SET_NULL, 
null=True)*
That all works fine but I want to include a field in Action which shows the 
lead_auditor based on the audit_reference and I'm not sure how best to do 
that (still in the early stages of learning).

Ideally, I would like the Action model to contain an @property field which 
equates to (Audit.lead_auditor wherever Action.audit_ref is matched) 

I'm going round in circles adding complexity that doesn't work anyway.  Any 
pointers would be much 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0ba3e0d8-2da1-4a31-823a-6a387b30644d%40googlegroups.com.


Re: Can't connect databases together

2020-01-17 Thread Jonathan Villavicencio
for example:
https://docs.djangoproject.com/en/3.0/ref/models/fields/#foreignkey

El vie., 17 de ene. de 2020 a la(s) 11:43, Jonathan Villavicencio (
codejonvi...@gmail.com) escribió:

> In your model define a class and in out make the relationship with other
> class that reference the other table in the database
>
> El vie., 17 de ene. de 2020 a la(s) 11:14, Stephen (stephen.u...@gmail.com)
> escribió:
>
>> sqlite3
>>
>> On Friday, 17 January 2020 16:53:01 UTC+1, Jonathan Villavicencio wrote:
>>>
>>> Hello Stephen,
>>>
>>> What is the database you are using?
>>>
>>> El vie., 17 de ene. de 2020 a la(s) 10:25, Stephen (steph...@gmail.com)
>>> escribió:
>>>
>>>> How can I connect 2 database tables together please?. I am trying to
>>>> display some objects in a table by selecting an object that is in another
>>>> table. How do I connect them 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...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/fa1798cf-a27f-459a-a814-a31c3431ca8b%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/fa1798cf-a27f-459a-a814-a31c3431ca8b%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>> 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/139dbb63-5027-4db2-91b4-5409e6ef70bb%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/139dbb63-5027-4db2-91b4-5409e6ef70bb%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAAEkprXrEE1CirqQ79QnzALLKb8%2BxV%2BcAucX90kjHecaiZj-2Q%40mail.gmail.com.


Re: Can't connect databases together

2020-01-17 Thread Jonathan Villavicencio
In your model define a class and in out make the relationship with other
class that reference the other table in the database

El vie., 17 de ene. de 2020 a la(s) 11:14, Stephen (stephen.u...@gmail.com)
escribió:

> sqlite3
>
> On Friday, 17 January 2020 16:53:01 UTC+1, Jonathan Villavicencio wrote:
>>
>> Hello Stephen,
>>
>> What is the database you are using?
>>
>> El vie., 17 de ene. de 2020 a la(s) 10:25, Stephen (steph...@gmail.com)
>> escribió:
>>
>>> How can I connect 2 database tables together please?. I am trying to
>>> display some objects in a table by selecting an object that is in another
>>> table. How do I connect them 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/fa1798cf-a27f-459a-a814-a31c3431ca8b%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/fa1798cf-a27f-459a-a814-a31c3431ca8b%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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/139dbb63-5027-4db2-91b4-5409e6ef70bb%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/139dbb63-5027-4db2-91b4-5409e6ef70bb%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAAEkprV8SMEjYvjbAa-LdyoeLE%3DPtS%3DVD2aCGkgg0ZwDLfVWEA%40mail.gmail.com.


Re: Can't connect databases together

2020-01-17 Thread Jonathan Villavicencio
Hello Stephen,

What is the database you are using?

El vie., 17 de ene. de 2020 a la(s) 10:25, Stephen (stephen.u...@gmail.com)
escribió:

> How can I connect 2 database tables together please?. I am trying to
> display some objects in a table by selecting an object that is in another
> table. How do I connect them 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fa1798cf-a27f-459a-a814-a31c3431ca8b%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAEkprWP-G77TpZ_Ds%3D6SOqH8DVeUX_nkQUxcWqT2FwBB-2BCQ%40mail.gmail.com.


Re: Django 3.0 Released.

2019-12-05 Thread Jonathan Morgan
Another thing to consider is whether you need to update the packages you 
use to build your application.  I've found that support for the LTS version 
of django is not consistent across packages, where support for the latest 
version is much more consistent, such that sometimes a needed update to a 
package required me to update django, either because of the package itself 
only working on a newer version, or one of its dependencies having this 
constraint.  Because of this, I tend to keep my applications running on the 
latest django, rather than an LTS, so I can also keep updating the related 
packages.  I also personally find the changes needed to move an application 
from version to version of django to be much more managable if you do it 
every version, in small chunks, rather than waiting between LTS versions, 
but your mileage and stomach for these updates may vary.

On Wednesday, December 4, 2019 at 1:48:06 PM UTC-5, Andréas Kühne wrote:
>
> So your question is if you should use LTS versions or use the latest 
> blazing version.
>
> The answer is of course - it depends.
>
> Do you see anything in django 3 that you need to have? In that case - 
> upgrade to django 3. If you only want to make sure that your application is 
> safe and secure and you don't need the bleeding edge functionality - keep 
> with the LTS:es.
>
> It also depends on your application cycle. I currently have 2 projects 
> running - one is a commercial ecommerce platform. The other is a platform 
> for course administration. Both have completely different requirements on 
> technical functionality from django. On the ecommerce site we are running 
> on LTS versions, on the other site we are running with the latest version 
> of django.
>
> I think the most important thing is to make sure that you have a secure 
> site regardless - so if you run the lts versions, you need to update as 
> soon as the next LTS comes out. And the same goes for the other versions as 
> well - update all the time in that case.
>
> Regards,
>
> Andréas
>
>
> Den mån 2 dec. 2019 kl 22:18 skrev o1bigtenor  >:
>
>> On Mon, Dec 2, 2019 at 6:18 AM Carlton Gibson > > wrote:
>> >
>> > Django 3.0 is now available.
>> >
>> > https://www.djangoproject.com/weblog/2019/dec/02/django-3-released/
>> >
>> > With the release of Django 3.0, Django 2.2 has reached the end of
>> > mainstream support. The final minor bug fix release (which is also a
>> > security release), 2.2.8, was issued today. Django 2.2 is an LTS 
>> release and
>> > will receive security and data loss fixes until April 2022. All users 
>> are
>> > encouraged to upgrade before then to continue receiving fixes for
>> > security issues.
>> >
>> > See the downloads page [1] for a table of supported versions and the
>> > future release schedule.
>> >
>> > [1] https://www.djangoproject.com/download/#supported-versions
>> >
>> Greetings
>>
>> Thank you - - - -interesting news!
>>
>> I'm a little confused though - - - - I have, at least in many things
>> so far that I've used,
>> software I mean, tended to move from one long term service version to the 
>> next.
>> Yet - - - Django is different - - - - it is suggested that I leave a
>> long term version
>> for a short term version, which will itself be followed by a short
>> term version, and then
>> after another period of time there will be a long term service
>> version. Shortly after
>> that long term service version has been reached, if the pattern used
>> for the transition
>> from version 2 to 3, version 4 will be offered.
>>
>> So - - - - what gives the best long term stability of function for use
>> of Django?
>>
>> 1. forget long term service versions and expect to revise you code
>> every 6 to 8 months
>> 2. use LTS code but using it until the release of the next major
>> version means that
>>   interesting advancements again mean a relentless pattern of revision
>> 3. don't worry about LTS and write the code and get the application to
>> work well and
>>  hope that I can hold things working without major security issues
>> until its worth
>>  redoing the application.
>>
>> I'm starting to think that option #3 is looking more attractive.
>>
>> Regards
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAPpdf58DU9XPYM-FOJ1%3DSy-PObNDJ%2B2Xw8hk3sr9BxTdFYcDjg%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63b2f084-85d7-412c-8a44-c09043c2a595%40googlegroups.com.


Re: HELP HELP FATAL: password authentication failed for user "postgres"

2019-11-29 Thread Jonathan Duclos


On Friday, 29 November 2019 09:42:00 UTC-3, EMPOWER EXCEL wrote:
>
> cqn some body helps me to correct this error while running *python 
> manager.py runeserver *
> (analyseprotection) flavien@flavien-VirtualBox:~/MyProjects/alertprot$ 
> python manage.py runserver
> Performing system checks...
> System check identified no issues (0 silenced).
> Unhandled exception in thread started by 
> Traceback (most recent call last):
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/utils/autoreload.py",
>  
> line 228, in wrapper
> fn(*args, **kwargs)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
>  
> line 127, in inner_run
> self.check_migrations()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/base.py",
>  
> line 422, in check_migrations
> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
>  
> line 20, in __init__
> self.loader = MigrationLoader(self.connection)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>  
> line 52, in __init__
> self.build_graph()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>  
> line 210, in build_graph
> self.applied_migrations = recorder.applied_migrations()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>  
> line 65, in applied_migrations
> self.ensure_schema()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>  
> line 52, in ensure_schema
> if self.Migration._meta.db_table in 
> self.connection.introspection.table_names(self.connection.cursor()):
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 254, in cursor
> return self._cursor()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 229, in _cursor
> self.ensure_connection()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 213, in ensure_connection
> self.connect()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/utils.py",
>  
> line 94, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 213, in ensure_connection
> self.connect()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 189, in connect
> self.connection = self.get_new_connection(conn_params)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
>  
> line 176, in get_new_connection
> connection = Database.connect(**conn_params)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/psycopg2/__init__.py",
>  
> line 126, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> django.db.utils.OperationalError: FATAL:  password authentication failed 
> for user "postgres"
> FATAL:  password authentication failed for user "postgres"
>


I've the same problem, but I was inputing a wrong string in field password, 
do you checked if as wrong?  

-- 
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/5bba54a0-4458-4743-8a1c-f040f1ad4b46%40googlegroups.com.


Re: Problem with SQLite and migrations

2019-08-21 Thread Jonathan Mrutu
Hi Jaemin,

You can try to post this question on stack overflow, but why don't you use
PostgreSQL this is recommended.
SQLite as the name implies it's more for testing purpose in a small project
environment.
//Jona


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Aug 21, 2019 at 2:48 PM Jaemin Noh  wrote:

> Hello.
>
> My application is currently in a development state, so it's using SQLite
> as a database backend at the moment.
>
> Due to the bad design decisions, my application has a migration with raw
> CREATE VIEW statements and unmanaged models. These VIEWs refer other tables
> with JOIN clauses.
> The problem is, when a column is being added to or removed from a table
> with a migration, Django remakes table(
> https://github.com/django/django/blob/1e429df748867097451bf0b45d1080ae6828d921/django/db/backends/sqlite3/schema.py#L320-L346),
> and VIEW throws a 'no such table' error when joined table is being deleted.
>
> Maybe this is SQLite's problem since table is being deleted inside a
> transaction and this should not cause any problem in theory. Maybe it can
> be fixed in Django to use ALTER TABLE statement.
> Ultimately, I can just get away with this problem if I switch to MySQL or
> PostgreSQL.
>
> So, what should I do? Where should I report this 'bug' or 'problem'?
> SQLite? Django?
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/21c59661-bdba-43f6-9551-de1a6bf278de%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD9jLPLTvpG%3D1-Psj%2BxdfORgy1ASov-Ue6RDU8UiwRNGM6tk1w%40mail.gmail.com.


Re: DRF with Rich Text

2019-08-21 Thread Jonathan Mrutu
You must secure your endpoints with authentication mechanism and on top of
that you might consider using
 django-rest-knox

//Jona

On Wed, Aug 21, 2019 at 5:57 PM Yoo  wrote:

> Hi,
> Thanks for the prompt response (and sorry for such a late one). I suppose
> I'm simply asking about JSON in general and DRF validation. Using the
> general serializer (serializer.Serializers), DRF validates the JSON itself,
> right? So, if some malicious person sent Python code via the JSON using
> some kind of escape char, then DRF responds with an error, right?
>
> Otherwise, is there some Django util that can deal with this? Because the
> API is just an endpoint. All someone has to do (at least in this project)
> is send a JWT Access token alongside some throttling. Can you point out
> some Headers that I can use? Is it possible to use some kind of app (i.e.
> android + iOS) signature?
>
> Thank you!
>
> On Tuesday, August 20, 2019 at 11:46:24 PM UTC-4, Aditya Singh wrote:
>>
>> Hi,
>> Hope you are good.
>> Django ships with top of the line CSRF protection first of all, Secondly,
>> you may specify domain specific headers and strictly restrict the expected
>> type of data, cookies timeout, response data type from the server to the
>> client. Also, you may leverage several robust django compatible packages
>> which relate to security and prevent any requests to the API whiah are
>> unauthorized. From unauthorized, I feel obliged to mention that you must
>> make sure that all the endpoints in your api are well defined and that all
>> the methods being executed on those corresponding endpoints need strong
>> authentication.
>> Hope, I could be of some help,
>> Kind regards,
>> Aditya
>>
>> On Wed, Aug 21, 2019, 9:11 AM Yoo  wrote:
>>
>>> Hi, I'm gonna be using Django Rest Framework for API with a Postgres
>>> stack and not developing with website. Coding apps in Swift and Androidx
>>> Java. Users can POST rich text, or text that uses HTML, to the server, and
>>> then other users can GET that HTML and view it in (ui)TextView.
>>>
>>> Based on previous experience, it seemed like Android's TextView wouldn't
>>> have any trouble with XSS or the like. Not sure about Swift, so can someone
>>> tell me if I should worry on the iOS side?
>>>
>>> Last thing. Because this is just an API, how does DRF protect my server
>>> against some malicious JSON POST request? A request that isn't sent from
>>> the designated app or is hand-crafted. If DRF doesn't somehow serialize
>>> correctly, then there would be some server issues, right? Gah worrying.
>>>
>>> TL;DR. Programming mobile with DRF. Should I worry about Rich Text (HTML
>>> Editing) on client and/or server side?
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/6c6b92e2-7e49-42f8-abe5-d05b1d0f4619%40googlegroups.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a6ea2741-061c-4392-af73-6e9ff4dc5a16%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD9jLPK2YyjuLn%3D6HP3fM2aLU9PbBeMg_3CWHYiKuafMObYu%2BA%40mail.gmail.com.


Re: Model form will not display in the URL assigned

2019-08-14 Thread Jonathan Villavicencio
Hello!, change the " of the fields of the Meta class to ' in the class
Busines..(forms.ModelForm)

El mié., 14 ago. 2019 a las 12:38, Kean () escribió:

> Hi,
>
> New to Django, I'm trying to create a form which means user can update in
> the browser and it gets stored in the database, however my form wont appear
> in the browser.
>
> please see setup:
>
> URLS.py
>
> path('Business register/Business management/Admin/Add new business',
> views.addnewbusiness, name='addnewbusiness'),
>
> MODELS
>
> class Businessownercreate(models.Model):
> Creator = models.CharField(max_length=20)
> Micro_Small_Medium = models.CharField(max_length=6)
> Business_Name = models.CharField(max_length=20)
> Owner_Firstname = models.CharField(max_length=20)
> Owner_Surname = models.CharField(max_length=20)
> Companies_House_Number = models.CharField(max_length=8)
> Address_Line_1 = models.CharField(max_length=30)
> Address_Line_2 = models.CharField(max_length=30)
> Town = models.CharField(max_length=20)
> City = models.CharField(max_length=20)
> County = models.CharField(max_length=20)
> Postcode = models.CharField(max_length=10)
> Email = models.EmailField(max_length=50)
> Phone = models.CharField(max_length=15)
> Mobile = models.CharField(max_length=15)
> Created_date = models.DateTimeField('date published')
>
> def __unicode__(self):
> return self.Business_Name
>
> def __str__(self):
> return self.Companies_House_Number
> return self.Business_name
>
>  FORMS.py
>
> class Businessownercreate(forms.ModelForm):
>
> class Meta:
> model = Businessownercreate
> fields = ["Creator", "Micro_Small_Medium", "Business_Name",
> "Owner_Firstname",
> "Owner_Surname", "Companies_House_Number", "Address_Line_1",
> "Address_Line_2",
> "Town", "City", "County", "Postcode", "Email", "Phone", "Mobile",
> "Created_date"
> ]
>
> VIEWS.py
>
> def addnewbusiness(request):
> if request == "POST":
> form = Businessownercreate(request.POST)
> if form.is_valid():
> form.save()
>
> return HttpResponseRedirect('/Business register/Business
> management/Admin/Add new business/business overview')
> else:
> form = Businessownercreate()
>
> return render(request, 'businessownercreate.html')
>
>
> TEMPLATES.
>
> {% load static %}
>
> 
> https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css
> ">
>
> 
> https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js
> ">
>
> 
> 
> Billntrade
> 
> business overview
> Back
> {{user.username}}
>   
> 
> 
> 
>
>
> 
> 
>
> 
> {% csrf_token %}
>  {{form.as_p}}
>
>
> create
> 
>
> Please can anyone help, I can't seem to get anything other than the button
> to appear?
>
> Best,
>
> K
>
>
> --
> 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/5b9b7ce1-1161-439d-b485-516b89cb7ee0%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAEkprU37ZPRVur4fyt_CyDLKnQidT8BikoUbAQDhXUQyddiKQ%40mail.gmail.com.


Re: Recreating SQL query in ORM

2019-08-01 Thread Jonathan Spicer
Thanks Simon, that's a great help.

On Wednesday, 31 July 2019 15:03:55 UTC+1, Simon Charette wrote:
>
> Hello,
>
> assuming you have a FullMatch model mapped to your FullMatches table
> the following should do.
>
> FullMatch.objects.filter(
> job_id=job_id,
> ).values(
> seq=Concat('loading_code', ...),
> ids=Concat('loading_id', ),
> ).annotate(
> total=Count('*'),
> ).order_by('-total')
>
> Using .values() before an annotation of an aggregate function uses the 
> provided columns
> from grouping.
>
> Cheers,
> Simon
>
> Le mardi 30 juillet 2019 12:56:56 UTC-4, Jonathan Spicer a écrit :
>>
>> Hello,
>>
>> I have an sql query that I would like to recreate using the ORM. Would it 
>> be possible for someone to give me some pointers.
>>
>> select count(*) as total,
>> 
>> concat(loading_code,code1_code,code2_code,code3_code,code4_code) as seq,
>> 
>> concat(loading_id,',',code1_id,',',code2_id,',',code3_id,',',code4_id) as 
>> ids
>> from FullMatches where job_id = %s group by seq, ids 
>> order by total desc
>>
>> Thanks in advance.
>>
>> Johnny
>>
>

-- 
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/5f6f271a-4d8d-4d02-80c3-9085f15f6ce4%40googlegroups.com.


Re: Recreating SQL query in ORM

2019-07-30 Thread Jonathan Spicer
Hello John,

I did try that but it complained about the query not containing the primary 
key.

I did wonder if there are methods within the ORM that can replicate it, the 
tricky part being creating a value to group by from concatenated rows.

On Tuesday, 30 July 2019 19:14:32 UTC+1, John Bagiliko wrote:
>
> Do you want to make this exact query in Django? 
> Then use Your_model.objects.raw("the query here except the last semi 
> colon")
>
> On Tue, Jul 30, 2019, 4:56 PM Jonathan Spicer <
> joh...@spicersolutions.co.uk > wrote:
>
>> Hello,
>>
>> I have an sql query that I would like to recreate using the ORM. Would it 
>> be possible for someone to give me some pointers.
>>
>> select count(*) as total,
>> 
>> concat(loading_code,code1_code,code2_code,code3_code,code4_code) as seq,
>> 
>> concat(loading_id,',',code1_id,',',code2_id,',',code3_id,',',code4_id) as 
>> ids
>> from FullMatches where job_id = %s group by seq, ids 
>> order by total desc
>>
>> Thanks in advance.
>>
>> Johnny
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d91ae3ab-f111-4081-8a6e-26fad5a2f782%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/d91ae3ab-f111-4081-8a6e-26fad5a2f782%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/edd9244d-a320-4bfc-8859-b7aab1439c37%40googlegroups.com.


Recreating SQL query in ORM

2019-07-30 Thread Jonathan Spicer
Hello,

I have an sql query that I would like to recreate using the ORM. Would it 
be possible for someone to give me some pointers.

select count(*) as total,

concat(loading_code,code1_code,code2_code,code3_code,code4_code) as seq,

concat(loading_id,',',code1_id,',',code2_id,',',code3_id,',',code4_id) as 
ids
from FullMatches where job_id = %s group by seq, ids order 
by total desc

Thanks in advance.

Johnny

-- 
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/d91ae3ab-f111-4081-8a6e-26fad5a2f782%40googlegroups.com.


Re: how to convert django application to Windows exe format

2019-07-21 Thread Jonathan May
Pip install pyinstaller and then run “pyinstaller — onefile filename.py”

On Sun, Jul 21, 2019 at 6:01 PM Jonathan May  wrote:

> You can use pyinstaller to convert your py file to exe
>
> On Sun, Jul 21, 2019 at 5:57 PM Mike Dewhirst 
> wrote:
>
>> Try searching for python to exe
>>
>>
>> *Connected by Motorola*
>>
>>
>> Balaji Shetty  wrote:
>>
>> Hi
>>
>> Can anyone please tell me
>> how to convert django application to Windows exe format.
>>
>> --
>> 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/CAECSbOvhEg7kAZU8gwARLU-vkk%3Dx0b4moGf7eSSFb2RrGcruuw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAECSbOvhEg7kAZU8gwARLU-vkk%3Dx0b4moGf7eSSFb2RrGcruuw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> --
>> 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/c853s6280bnne1mgefv0k317.1563749853389%40email.android.com
>> <https://groups.google.com/d/msgid/django-users/c853s6280bnne1mgefv0k317.1563749853389%40email.android.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAOYzx0iJrZgg71W%3D1LKPU2evQR5UdLFDX1HdzFPK_NXkU31vjA%40mail.gmail.com.


Re: how to convert django application to Windows exe format

2019-07-21 Thread Jonathan May
You can use pyinstaller to convert your py file to exe

On Sun, Jul 21, 2019 at 5:57 PM Mike Dewhirst  wrote:

> Try searching for python to exe
>
>
> *Connected by Motorola*
>
>
> Balaji Shetty  wrote:
>
> Hi
>
> Can anyone please tell me
> how to convert django application to Windows exe format.
>
> --
> 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/CAECSbOvhEg7kAZU8gwARLU-vkk%3Dx0b4moGf7eSSFb2RrGcruuw%40mail.gmail.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c853s6280bnne1mgefv0k317.1563749853389%40email.android.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOYzx0gnV6kdm7-UrzyMxWDczAywPFO_2fRCW%2Bu%3DNA4n2yutmQ%40mail.gmail.com.


order_by function gets error if the field name or json key, has a dash.

2019-01-13 Thread Jonathan Espinal
order_by function gets error if the field name or json key, has a dash.


I know Django use a dash for asc or desc methods. but in this case the dash 
is in the middle.


EXAMPLE:

MyTable.objects.all().order_by('myfield__en-us')

I have a jsonb field like:

{
"es": "Casa",
"en-us": "House"
}



Does anybody know how to fix it?
I can't change de json structure :(


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/9cd9ae56-5529-4915-b91a-5703926e58de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Do queries made instantiating a form not show up in db.connection.queries?

2018-11-01 Thread Jonathan Berger
Thank you!

I was looking at the value of 'connection.queries' before rendering the
form.

On Thu, Nov 1, 2018 at 6:12 PM Karen Tracey  wrote:

> On Thu, Nov 1, 2018 at 8:14 PM Jonathan Berger 
> wrote:
>
>>
>> Per the db and model FAQ
>> <https://docs.djangoproject.com/en/2.1/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running>:
>> expected behavior is that 'connection.queries' should contain a list of all
>> SQL queries made by an app.
>>
>> I'm finding actual behavior for a Form subclass that has a
>> ModelMultipleChoiceField with a default queryset, does not add that query
>> to 'connection.queries'. This violates expected behavior.
>>
>>
>
> https://docs.djangoproject.com/en/2.1/ref/forms/fields/#django.forms.ModelChoiceField.queryset
> notes the queryset is "evaluated when the form is rendered." ...are you
> rendering the form or just instantiating it (per the subject)?
>
> Karen
>
>
> --
> 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/CACS9racCtAAgPLwv7-SBw-40Sddge_r9hpBS5eDBqE_1GGJbqA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CACS9racCtAAgPLwv7-SBw-40Sddge_r9hpBS5eDBqE_1GGJbqA%40mail.gmail.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/CAN1jqrL%2B8z5hbKVGx1Hnw6S5C8FCX75s2myQjAEYUxJwbWmUWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Do queries made instantiating a form not show up in db.connection.queries?

2018-11-01 Thread Jonathan Berger
Hi Django Users,

I'm a moderate-level user of Django and trying to determine if I've found a
bug.

Per the db and model FAQ
<https://docs.djangoproject.com/en/2.1/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running>:
expected behavior is that 'connection.queries' should contain a list of all
SQL queries made by an app.

I'm finding actual behavior for a Form subclass that has a
ModelMultipleChoiceField with a default queryset, does not add that query
to 'connection.queries'. This violates expected behavior.

Am I misunderstanding something or is this a bug?

Thanks,
Jonathan

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


Bokeh Server via Django Tutorial

2017-11-08 Thread Jonathan Bennett
I created a tutorial that demonstrates how to create and host a Django 
Website that serves interactive Bokeh Server plots.

The github repository is here:
https://github.com/KonoAnalytics/BokehDjango

The website is here, although I don't intend to keep this up permanently:
http://45.33.6.39/

Please consider taking it for a spin and giving me any feedback you may 
have.

Thanks,
Jonathan

-- 

Jonathan Bennett
Kono Analytics
p: 713.489.4338
w: konoanalytics.com
<https://twitter.com/konoanalytics>  
<https://linkedin.com/company/kono-analytics>  
<https://github.com/konoanalytics>  <https://facebook.com/konoanalytics>  
<https://instagram.com/konoanalytics>

-- 
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/cda57ac4-1daa-456e-a523-a3bd1c4e08f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Supervisor FATAl Exited too quickly (process log may have details(About inet_http_server and unix_http_server)

2017-09-09 Thread Jonathan Cheng
I wrote a Django project and I use supervisor with gunicorn


/etc/supervisor/conf.d/weather.conf



[group:weather_station]
programs=site

[program:site]
directory=$PROJECT
command=/home/nhcc/.local/bin/gunicorn -c /$PROJECT/weather_station/
gunicorn.conf.py -p gunicorn.pod weather_station.wsgi
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor.log
environment=my-environment-variable
~




`sudo supervisorctl reread`


`sudo supervisorctl reload`


`sudo supervisorctl status`


It showed up the error

> weather_station:site FATAL Exited too quickly (process 
log may have details)


So I checked out the log file :

`/var/log/supervisor/supervisord.log`


> 2017-09-08 17:15:25,000 CRIT Supervisor running as root (no user in 
> config file) 
> > 2017-09-08 17:15:25,000 WARN Included extra file 
> "/etc/supervisor/conf.d/weather.conf" during parsing 
> >2017-09-08 17:15:25,007 INFO RPC interface 'supervisor' initialized 
> >2017-09-08 17:15:25,008 CRIT Server 'inet_http_server' running without 
> any HTTP
> > authentication checking 
> > 2017-09-08 17:15:25,008 INFO RPC interface
> > 'supervisor' initialized 
> > 2017-09-08 17:15:25,008 CRIT Server 'unix_http_server' running without 
> any HTTP authentication checking
> > 2017-09-08 17:15:25,008 INFO supervisord started with pid 32371
> > 2017-09-08 17:15:26,013 INFO spawned: 'site' with pid 32447 
> > 2017-09-08 17:15:26,018 INFO exited: site (exit status 127; not expected)
> > 2017-09-08 17:15:27,022 INFO spawned: 'site' with pid 32448 
> > 2017-09-08 17:15:27,026 INFO exited: site (exit status 127; not expected)
> > 2017-09-08 17:15:29,032 INFO spawned: 'site' with pid 32449 
> > 2017-09-08 17:15:29,038 INFO exited: site (exit status 127; not expected)
> > 2017-09-08 17:15:32,043 INFO spawned: 'site' with pid 32451 
> > 2017-09-08 17:15:32,059 INFO exited: site (exit status 127; not expected)
> > 2017-09-08 17:15:33,060 INFO gave up: site entered FATAL state, too
> > many start retries too quickly
>   
>   
>  




According to `Included extra file`[the 
solution](https://github.com/Supervisor/supervisor/issues/272)

According to `Server 'unix_http_server' running without any HTTP 
authentication checking`[the 
solution](https://github.com/Supervisor/supervisor/issues/717)

I added two section [unix_http_server] and [inet_http_server]


 
   [unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0766 ; socket file mode (default 0700)
;chown=nobody:nogroup   ; socket file uid:gid owner
;username=user  ; (default is no username (open server))
;password=123   ; (default is no password (open server))

[inet_http_server] ; inet (TCP) server disabled by default
port=*:9001; (ip_address:port specifier, *:port for all iface, 
;username=user  ; (default is no username (open server))
;password=123   ; (default is no password (open server))




This is the current  supervisor.conf



[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0766 ; socket file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default 
$CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default 
supervisord.pid)
childlogdir=/var/log/supervisor; ('AUTO' child log dir, 
default $TEMP)

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:
make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a 
unix socket

[inet_http_server] ; inet (TCP) server disabled by default
port=*:9001;

[include]
files = /etc/supervisor/*.conf
files = /etc/supervisor/conf.d/*.conf









Then I ran

 
   sudo supervisord -c /etc/supervisor/supervisord.conf
sudo supervisorctl -c /etc/supervisor/supervisord.conf




And I checked the log again

The error is completely be same

Does anyone know why??

-- 
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/4a1e659d-93be-4420-b68e-cd04d8188961%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread Jonathan Cheng
I use Python3.5.2 Django1.9

I use `python -m venv venv/weather_station` to create virtual evnironment 
(/home/user/venv)

This is my project tree in Ubuntu /home/user/myproject:
(`export project=/home/user/myproject`)

myproject
   |
   ├── gunicorn.conf.py
   ├── static
   │   ├── admin
   └── weather_station
   ├── base
   │   ├── migrations
   │   ├── static
   │   └── templates
   └── weather_station
   ├── __init__.py
   ├── wsgi.py
   ├── urls.py
   ├── settings
   ├── base.py
   ├── production.py
在此輸入代碼...

__init__.py:
import pymysql
pymysql.install_as_MySQLdb()
wsgi.py
import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", 
"weather_station.settings.production")

application = get_wsgi_application()
The partial in the settings.base.py:
BASE_DIR = 
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__
 
ROOT_URLCONF = 'weather_station.urls'

WSGI_APPLICATION = 'weather_station.wsgi.application'

STATIC_URL = '/static/'
In the partial of settings.production.py:
from .base import *   

DEBUG = False

STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')

MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media')
gunicorn.conf.py:
import os
 
bind = '127.0.0.1:8080'
worders = (os.sysconf('SC_NPROCESSORS_ONLN') * 2) + 1
loglevel = 'error'
command = '/home/user/venv/weather_station/bin/gunicorn'
pythonpath = '/home/user/myproject/weather_station'

And in the /etc/nginx/sites-available/weather.conf:

upstream weather_station {
server 127.0.0.1:8080;
}

server {
listen 80 default_server;
listen 443 default ssl;
server_name http://my_ip;
client_max_body_size 10M;
keepalive_timeout15;

location /static/ {
alias   /$project/static/;
}
location /media/ {
alias   /$project/media/;
}

location / {
proxy_redirect  off;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP   $remote_addr;
proxy_set_headerX-Forwarded-For 
$proxy_add_x_forwarded_for;
proxy_set_headerX-Forwarded-Protocol$scheme;
proxy_pass  http://myproject;

When I the follwoing command under myproject
gunicorn -c gunicorn.conf.py weather_station.weather_station.wsgi



It showed `ImportError: No module named 'weather_station.settings'`

Does any know the reason ?


it successfully weather_station.wsgi.

But the new error is  `ImportError: No module named 
'weather_station.settings'`

detailed log

   
 File "/home/user/myproject/weather_station/weather_station/wsgi.py", line 
17, in 
application = get_wsgi_application()
  File 
"/home/user/.local/lib/python3.5/site-packages/django/core/wsgi.py", line 13
, in get_wsgi_application
django.setup()
  File 
"/home/user/.local/lib/python3.5/site-packages/django/__init__.py", line 17, 
in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File 
"/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py", 
line 55, in __getattr__
self._setup(name)
  File 
"/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py", 
line 43, in _setup
self._wrapped = Settings(settings_module)
  File 
"/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py", 
line 99, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named 'weather_station.settings'







-- 
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/87a81098-2124-4702-a429-4f161cd055d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Heroku push failed

2017-02-05 Thread Jonathan Cheng
In Win10
when i run "git push heroku master"
the traceback showed:
"python manage.py collectstatic"
,the python file
ImportError: No module named 'markdown_deux'

but i have installed the django-markdown-deux
why i met this traceback?



-- 
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/21f408d7-48d3-4b34-918b-f5bb8e7f3a29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
after importing announce,directories in settings.py 
if DEBUG:
announce(__name__, databases=DATABASES, backend="Postgres: 9.5", 
caches=CACHES)

it said CACHES isn't defined when i running the server 
python manage.py runserver












Mike Dewhirst於 2016年9月16日星期五 UTC+8上午8時43分17秒寫道:
>
> On 16/09/2016 1:10 AM, Jonathan Cheng wrote: 
> > thx your code,though i cant run it in cmd 
> That is correct. It is designed to be imported and called from 
> settings.py. 
>
> I'll send you a screenshot off-line 
>
> 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/a9036fd7-62bc-42ca-901e-418eb57491ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx your code,though i cant run it in cmd

Mike Dewhirst於 2016年9月12日星期一 UTC+8上午10時05分10秒寫道:
>
> Jonathan 
>
> I use the attached announce.py to display exactly where all the 
> directories and URLs are. I had trouble in the beginning getting it 
> straight in my head but seeing it every time I looked at the dev-server 
> output helped a lot. 
>
> Comments in announce.py show how to use it. 
>
> Good luck 
>
> Mike 
>
> On 12/09/2016 1:58 AM, Jonathan Cheng wrote: 
> > thx reply,but it just can see the original html with no css,is my path 
> > setted correct? 
> > 
> > ludovic coues於 2016年9月11日星期日 
> > UTC+8ä¸‹å ˆ11時45分24ç§’å¯«é “ï¼š 
> > 
> > Have you tried to add a few newlines to be sure about which line 
> > is the issue ? 
> > 
> > Also, in you email, there is a space between % and } in the load 
> > staticfiles tag 
> > 
> > 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com 
> > >: 
> > > I use django1.10 
> > > 
> > > i reference the official doc 
> > > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
> > <https://docs.djangoproject.com/en/1.10/intro/tutorial06/> 
> > > 
> > > my project name:mysite 
> > > 
> > > structure: 
> > > 
> > > - mysite- 
> > > 
> > > Â  Â  Â  Â  Â  Â  Â - mysite - urls.py 
> > > 
> > > Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â -views.py 
> > > 
> > > Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ... 
> > > 
> > > Â  Â  Â  Â  Â  Â  Â - templates - index.html 
> > > 
> > > Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â - images 
> > > Â  Â  Â  Â  Â  Â  Â - static - mysite - assets - css - main.css 
> > > 
> > > Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Â  - js 
> > > 
> > > Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Â  ... 
> > > In my index.html 
> > > 
> > > add 
> > > 
> > > `{% load staticfiles % } 
> > > Â  Â  Â  Â  ` 
> > > 
> > > it said i have a Invalid block tag about TemplateSyntaxError 
> > > `` 
> > > 
> > > views.py (about static files part) 
> > > ```STATICFILES_DIRS = [ 
> > > Â  Â  os.path.join(BASE_DIR, "static"), 
> > > Â  Â  '/mysite/static/', 
> > > ] 
> > > STATIC_URL = '/static/' 
> > > STATIC_ROOT='/mysite/static/'``` 
> > > 
> > > what's part should i notice? 
> > > 
> > > -- 
> > > 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 
> > <https://groups.google.com/group/django-users>. 
> > > To view this discussion on the web visit 
> > > 
> > 
> https://groups.google.com/d/msgid/django-users/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com>.
>  
>
> > 
> > > For more options, visit https://groups.google.com/d/optout 
> > <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 "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to django-users...@googlegroups.com  
> > <mailto:django-users+unsubscr...@googlegroups.com >. 
> > To post to this group, send email to django...@googlegroups.com 
>  
> > <mailto: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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/a699584c-d57f-4b84-a38b-fe03638caefd%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/385a4dc3-8f15-4252-bf8a-c9fd41f08a70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx everyone,all bugs were fixed early.


Jonathan Cheng於 2016年9月11日星期日 UTC+8下午10時59分56秒寫道:
>
> I use django1.10
>
> i reference the official doc
> https://docs.djangoproject.com/en/1.10/intro/tutorial06/
>
> my project name:mysite
>
> structure:
>   
> - mysite-
>
>  - mysite - urls.py
>
>-views.py
>
> ...
>
>  - templates - index.html 
>
>  - images 
>  - static - mysite - assets - css - main.css
>  
> - js
>
> ...
> In my index.html
>
> add
>
> `{% load staticfiles % }
> `
>
> it said i have a Invalid block tag about TemplateSyntaxError
> ``
>
> views.py (about static files part)
> ```STATICFILES_DIRS = [
> os.path.join(BASE_DIR, "static"),
> '/mysite/static/',
> ]
> STATIC_URL = '/static/'
> STATIC_ROOT='/mysite/static/'```
>
> what's part should i notice?
>

-- 
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/8190791f-dbb7-426f-b7d1-d6227f9ffbfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i use href="{% static '/assets/css/main.css' %}
and the css worked
but i want to use the all files in assets
is there any other way to do it?

ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道:
>
> If you look at the html send by django, what is the href value ?
>
> 2016-09-11 19:15 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com 
> >:
>
>> i fixed usint STATIC_ROOD = '/static/'
>> it seems to no error
>> but when i connect to my runserver
>> the css of  assets just doesn't work
>>
>>
>> Jonathan Cheng於 2016年9月12日星期一 UTC+8上午1時04分22秒寫道:
>>
>>> here i explain , because  i just test how main.css work, finally i want 
>>> to use the assets and images .
>>> and i use the python mange.py collectstatic
>>> it showed 
>>>
>>> ImproperlyConfigured: The STATICFILES_DIRS setting should not contain 
>>>> the STATIC_ROOT setting 
>>>>
>>>
>>> ludovic coues於 2016年9月12日星期一 UTC+8上午12時53分08秒寫道:
>>>>
>>>> I mentionned tree because I have doubt about what "static - assets - 
>>>> css - main.css" means. If your path is really 
>>>> /mysite/static/assets/css/main.css, then you want >>> rel="stylesheet" text = 'html/css' href="{% static 
>>>> 'assets/css/main.css' %}" />. 
>>>>
>>>> At least with a debug configuration, django will search for static 
>>>> file in each apps' static directory for the path you used as arguments 
>>>> for static. 
>>>> With a production configuration, you should use manage.py 
>>>> collectstatic which will grab all static file and copy them in a 
>>>> single directory. 
>>>>
>>>> 2016-09-11 18:18 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> > 
>>>> > https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 
>>>> > 
>>>> > ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道: 
>>>> >> 
>>>> >> I have a hard time to read the paths you use. The command tree 
>>>> produce 
>>>> >> a nice tree view of a directory, it might help. You can also use 
>>>> >> service like http://paste2.org/ or https://gist.github.com/ to 
>>>> share 
>>>> >> it 
>>>> >> 
>>>> >> 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> >> > thx reply,but it just can see the original html with no css,is my 
>>>> path 
>>>> >> > setted correct? 
>>>> >> > 
>>>> >> > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: 
>>>> >> >> 
>>>> >> >> Have you tried to add a few newlines to be sure about which line 
>>>> is the 
>>>> >> >> issue ? 
>>>> >> >> 
>>>> >> >> Also, in you email, there is a space between % and } in the load 
>>>> >> >> staticfiles tag 
>>>> >> >> 
>>>> >> >> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> >> >> > I use django1.10 
>>>> >> >> > 
>>>> >> >> > i reference the official doc 
>>>> >> >> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
>>>> >> >> > 
>>>> >> >> > my project name:mysite 
>>>> >> >> > 
>>>> >> >> > structure: 
>>>> >> >> > 
>>>> >> >> > - mysite- 
>>>> >> >> > 
>>>> >> >> >  - mysite - urls.py 
>>>> >> >> > 
>>>> >> >> >-views.py 
>>>> >> >> > 
>>>> >> >> > ... 
>>>> >> >> > 
>>>> >> >> >  - templates - index.html 
>>>> >> >> > 
>>>> >> >> >  - images 
>>>> >> >> >  - static - mysite - assets - css - main.css 
>>>> >> >> > 
>>>> >> >> > - js 
>>>> >> >> > 
>>>> >> >> > ... 
>>>>

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i change into href="{% static '/assets/css/main.css' %}
and it worked
but if i want to use the all files in static
is there any way to do it?

ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道:
>
> If you look at the html send by django, what is the href value ?
>
> 2016-09-11 19:15 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com 
> >:
>
>> i fixed usint STATIC_ROOD = '/static/'
>> it seems to no error
>> but when i connect to my runserver
>> the css of  assets just doesn't work
>>
>>
>> Jonathan Cheng於 2016年9月12日星期一 UTC+8上午1時04分22秒寫道:
>>
>>> here i explain , because  i just test how main.css work, finally i want 
>>> to use the assets and images .
>>> and i use the python mange.py collectstatic
>>> it showed 
>>>
>>> ImproperlyConfigured: The STATICFILES_DIRS setting should not contain 
>>>> the STATIC_ROOT setting 
>>>>
>>>
>>> ludovic coues於 2016年9月12日星期一 UTC+8上午12時53分08秒寫道:
>>>>
>>>> I mentionned tree because I have doubt about what "static - assets - 
>>>> css - main.css" means. If your path is really 
>>>> /mysite/static/assets/css/main.css, then you want >>> rel="stylesheet" text = 'html/css' href="{% static 
>>>> 'assets/css/main.css' %}" />. 
>>>>
>>>> At least with a debug configuration, django will search for static 
>>>> file in each apps' static directory for the path you used as arguments 
>>>> for static. 
>>>> With a production configuration, you should use manage.py 
>>>> collectstatic which will grab all static file and copy them in a 
>>>> single directory. 
>>>>
>>>> 2016-09-11 18:18 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> > 
>>>> > https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 
>>>> > 
>>>> > ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道: 
>>>> >> 
>>>> >> I have a hard time to read the paths you use. The command tree 
>>>> produce 
>>>> >> a nice tree view of a directory, it might help. You can also use 
>>>> >> service like http://paste2.org/ or https://gist.github.com/ to 
>>>> share 
>>>> >> it 
>>>> >> 
>>>> >> 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> >> > thx reply,but it just can see the original html with no css,is my 
>>>> path 
>>>> >> > setted correct? 
>>>> >> > 
>>>> >> > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: 
>>>> >> >> 
>>>> >> >> Have you tried to add a few newlines to be sure about which line 
>>>> is the 
>>>> >> >> issue ? 
>>>> >> >> 
>>>> >> >> Also, in you email, there is a space between % and } in the load 
>>>> >> >> staticfiles tag 
>>>> >> >> 
>>>> >> >> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> >> >> > I use django1.10 
>>>> >> >> > 
>>>> >> >> > i reference the official doc 
>>>> >> >> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
>>>> >> >> > 
>>>> >> >> > my project name:mysite 
>>>> >> >> > 
>>>> >> >> > structure: 
>>>> >> >> > 
>>>> >> >> > - mysite- 
>>>> >> >> > 
>>>> >> >> >  - mysite - urls.py 
>>>> >> >> > 
>>>> >> >> >-views.py 
>>>> >> >> > 
>>>> >> >> > ... 
>>>> >> >> > 
>>>> >> >> >  - templates - index.html 
>>>> >> >> > 
>>>> >> >> >  - images 
>>>> >> >> >  - static - mysite - assets - css - main.css 
>>>> >> >> > 
>>>> >> >> > - js 
>>>> >> >> > 
>>>> >> >> > ... 
>>>>

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i use href="{% static '/assets/css/main.css' %}" 
and it worked 
but if i want to use the all files in static
is there any way to do?

ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道:
>
> If you look at the html send by django, what is the href value ?
>
> 2016-09-11 19:15 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com 
> >:
>
>> i fixed usint STATIC_ROOD = '/static/'
>> it seems to no error
>> but when i connect to my runserver
>> the css of  assets just doesn't work
>>
>>
>> Jonathan Cheng於 2016年9月12日星期一 UTC+8上午1時04分22秒寫道:
>>
>>> here i explain , because  i just test how main.css work, finally i want 
>>> to use the assets and images .
>>> and i use the python mange.py collectstatic
>>> it showed 
>>>
>>> ImproperlyConfigured: The STATICFILES_DIRS setting should not contain 
>>>> the STATIC_ROOT setting 
>>>>
>>>
>>> ludovic coues於 2016年9月12日星期一 UTC+8上午12時53分08秒寫道:
>>>>
>>>> I mentionned tree because I have doubt about what "static - assets - 
>>>> css - main.css" means. If your path is really 
>>>> /mysite/static/assets/css/main.css, then you want >>> rel="stylesheet" text = 'html/css' href="{% static 
>>>> 'assets/css/main.css' %}" />. 
>>>>
>>>> At least with a debug configuration, django will search for static 
>>>> file in each apps' static directory for the path you used as arguments 
>>>> for static. 
>>>> With a production configuration, you should use manage.py 
>>>> collectstatic which will grab all static file and copy them in a 
>>>> single directory. 
>>>>
>>>> 2016-09-11 18:18 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> > 
>>>> > https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 
>>>> > 
>>>> > ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道: 
>>>> >> 
>>>> >> I have a hard time to read the paths you use. The command tree 
>>>> produce 
>>>> >> a nice tree view of a directory, it might help. You can also use 
>>>> >> service like http://paste2.org/ or https://gist.github.com/ to 
>>>> share 
>>>> >> it 
>>>> >> 
>>>> >> 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> >> > thx reply,but it just can see the original html with no css,is my 
>>>> path 
>>>> >> > setted correct? 
>>>> >> > 
>>>> >> > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: 
>>>> >> >> 
>>>> >> >> Have you tried to add a few newlines to be sure about which line 
>>>> is the 
>>>> >> >> issue ? 
>>>> >> >> 
>>>> >> >> Also, in you email, there is a space between % and } in the load 
>>>> >> >> staticfiles tag 
>>>> >> >> 
>>>> >> >> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>>>> >> >> > I use django1.10 
>>>> >> >> > 
>>>> >> >> > i reference the official doc 
>>>> >> >> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
>>>> >> >> > 
>>>> >> >> > my project name:mysite 
>>>> >> >> > 
>>>> >> >> > structure: 
>>>> >> >> > 
>>>> >> >> > - mysite- 
>>>> >> >> > 
>>>> >> >> >  - mysite - urls.py 
>>>> >> >> > 
>>>> >> >> >-views.py 
>>>> >> >> > 
>>>> >> >> > ... 
>>>> >> >> > 
>>>> >> >> >  - templates - index.html 
>>>> >> >> > 
>>>> >> >> >  - images 
>>>> >> >> >  - static - mysite - assets - css - main.css 
>>>> >> >> > 
>>>> >> >> > - js 
>>>> >> >> > 
>>>> >> >> > ... 
>>>> >&

Re: Django Ticketing Application

2016-09-12 Thread Jonathan Adcock
You could try https://djangopackages.org/

On Monday, September 12, 2016 at 12:18:38 PM UTC+1, Alexandra wrote:
>
> Hi, could you please suggest other forums where I can find this 
> information?
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/744da0aa-fce5-45bc-b0e9-a12621e14a12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
i fixed usint STATIC_ROOD = '/static/'
it seems to no error
but when i connect to my runserver
the css of  assets just doesn't work


Jonathan Cheng於 2016年9月12日星期一 UTC+8上午1時04分22秒寫道:
>
> here i explain , because  i just test how main.css work, finally i want to 
> use the assets and images .
> and i use the python mange.py collectstatic
> it showed 
>
> ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the 
>> STATIC_ROOT setting 
>>
>
> ludovic coues於 2016年9月12日星期一 UTC+8上午12時53分08秒寫道:
>>
>> I mentionned tree because I have doubt about what "static - assets - 
>> css - main.css" means. If your path is really 
>> /mysite/static/assets/css/main.css, then you want > rel="stylesheet" text = 'html/css' href="{% static 
>> 'assets/css/main.css' %}" />. 
>>
>> At least with a debug configuration, django will search for static 
>> file in each apps' static directory for the path you used as arguments 
>> for static. 
>> With a production configuration, you should use manage.py 
>> collectstatic which will grab all static file and copy them in a 
>> single directory. 
>>
>> 2016-09-11 18:18 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>> > 
>> > https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 
>> > 
>> > ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道: 
>> >> 
>> >> I have a hard time to read the paths you use. The command tree produce 
>> >> a nice tree view of a directory, it might help. You can also use 
>> >> service like http://paste2.org/ or https://gist.github.com/ to share 
>> >> it 
>> >> 
>> >> 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>> >> > thx reply,but it just can see the original html with no css,is my 
>> path 
>> >> > setted correct? 
>> >> > 
>> >> > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: 
>> >> >> 
>> >> >> Have you tried to add a few newlines to be sure about which line is 
>> the 
>> >> >> issue ? 
>> >> >> 
>> >> >> Also, in you email, there is a space between % and } in the load 
>> >> >> staticfiles tag 
>> >> >> 
>> >> >> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
>> >> >> > I use django1.10 
>> >> >> > 
>> >> >> > i reference the official doc 
>> >> >> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
>> >> >> > 
>> >> >> > my project name:mysite 
>> >> >> > 
>> >> >> > structure: 
>> >> >> > 
>> >> >> > - mysite- 
>> >> >> > 
>> >> >> >  - mysite - urls.py 
>> >> >> > 
>> >> >> >-views.py 
>> >> >> > 
>> >> >> > ... 
>> >> >> > 
>> >> >> >  - templates - index.html 
>> >> >> > 
>> >> >> >  - images 
>> >> >> >  - static - mysite - assets - css - main.css 
>> >> >> > 
>> >> >> > - js 
>> >> >> > 
>> >> >> > ... 
>> >> >> > In my index.html 
>> >> >> > 
>> >> >> > add 
>> >> >> > 
>> >> >> > `{% load staticfiles % } 
>> >> >> > ` 
>> >> >> > 
>> >> >> > it said i have a Invalid block tag about TemplateSyntaxError 
>> >> >> > `` 
>> >> >> > 
>> >> >> > views.py (about static files part) 
>> >> >> > ```STATICFILES_DIRS = [ 
>> >> >> > os.path.join(BASE_DIR, "static"), 
>> >> >> > '/mysite/static/', 
>> >> >> > ] 
>> >> >> > STATIC_URL = '/static/' 
>> >> >> > STATIC_ROOT='/mysite/static/'``` 
>> >> >> > 
>> >> >> > what's part should i notice? 
>> >> >> > 
>> >> >> > -- 
>> >> >> > Y

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
thx i change into STATIC_ROOT='/static/'
it seems to no error
but when i connect to my runserver
the css of  assets just doesn't work

2016-09-12 0:44 GMT+08:00 ali Eblice <aliebl...@gmail.com>:

> your "mysite" folder and "static" folder are in a same directory but in
> your settings.py you wrote "STATIC_ROOT='/mysite/static/'" which says
> that static should be subdirectory of mysite which its not a subdirectory
> its in a same directory of mysite
>
>
> On Sunday, September 11, 2016 at 8:48:57 PM UTC+4:30, Jonathan Cheng wrote:
>>
>>
>> https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1
>>
>> ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道:
>>>
>>> I have a hard time to read the paths you use. The command tree produce
>>> a nice tree view of a directory, it might help. You can also use
>>> service like http://paste2.org/ or https://gist.github.com/ to share
>>> it
>>>
>>> 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>:
>>> > thx reply,but it just can see the original html with no css,is my path
>>> > setted correct?
>>> >
>>> > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道:
>>> >>
>>> >> Have you tried to add a few newlines to be sure about which line is
>>> the
>>> >> issue ?
>>> >>
>>> >> Also, in you email, there is a space between % and } in the load
>>> >> staticfiles tag
>>> >>
>>> >> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>:
>>> >> > I use django1.10
>>> >> >
>>> >> > i reference the official doc
>>> >> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/
>>> >> >
>>> >> > my project name:mysite
>>> >> >
>>> >> > structure:
>>> >> >
>>> >> > - mysite-
>>> >> >
>>> >> >  - mysite - urls.py
>>> >> >
>>> >> >-views.py
>>> >> >
>>> >> > ...
>>> >> >
>>> >> >  - templates - index.html
>>> >> >
>>> >> >  - images
>>> >> >  - static - mysite - assets - css - main.css
>>> >> >
>>> >> > - js
>>> >> >
>>> >> > ...
>>> >> > In my index.html
>>> >> >
>>> >> > add
>>> >> >
>>> >> > `{% load staticfiles % }
>>> >> > `
>>> >> >
>>> >> > it said i have a Invalid block tag about TemplateSyntaxError
>>> >> > ``
>>> >> >
>>> >> > views.py (about static files part)
>>> >> > ```STATICFILES_DIRS = [
>>> >> > os.path.join(BASE_DIR, "static"),
>>> >> > '/mysite/static/',
>>> >> > ]
>>> >> > STATIC_URL = '/static/'
>>> >> > STATIC_ROOT='/mysite/static/'```
>>> >> >
>>> >> > what's part should i notice?
>>> >> >
>>> >> > --
>>> >> > 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/ef2ea6eb-d1cb
>>> -40e2-abef-1af246e02e98%40googlegroups.com.
>>> >> > For more options, visit https://groups.google.com/d/optout.
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >> Cordialement, Coues Ludovic
>>> >> +336 148 743 42
>>> >
>>> > --
>>> > You received this message becaus

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
here i explain , because  i just test how main.css work, finally i want to 
use the assets and images .
and i use the python mange.py collectstatic
it showed 

ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the 
> STATIC_ROOT setting 
>

ludovic coues於 2016年9月12日星期一 UTC+8上午12時53分08秒寫道:
>
> I mentionned tree because I have doubt about what "static - assets - 
> css - main.css" means. If your path is really 
> /mysite/static/assets/css/main.css, then you want  rel="stylesheet" text = 'html/css' href="{% static 
> 'assets/css/main.css' %}" />. 
>
> At least with a debug configuration, django will search for static 
> file in each apps' static directory for the path you used as arguments 
> for static. 
> With a production configuration, you should use manage.py 
> collectstatic which will grab all static file and copy them in a 
> single directory. 
>
> 2016-09-11 18:18 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com 
> >: 
> > 
> > https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 
> > 
> > ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道: 
> >> 
> >> I have a hard time to read the paths you use. The command tree produce 
> >> a nice tree view of a directory, it might help. You can also use 
> >> service like http://paste2.org/ or https://gist.github.com/ to share 
> >> it 
> >> 
> >> 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
> >> > thx reply,but it just can see the original html with no css,is my 
> path 
> >> > setted correct? 
> >> > 
> >> > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: 
> >> >> 
> >> >> Have you tried to add a few newlines to be sure about which line is 
> the 
> >> >> issue ? 
> >> >> 
> >> >> Also, in you email, there is a space between % and } in the load 
> >> >> staticfiles tag 
> >> >> 
> >> >> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
> >> >> > I use django1.10 
> >> >> > 
> >> >> > i reference the official doc 
> >> >> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
> >> >> > 
> >> >> > my project name:mysite 
> >> >> > 
> >> >> > structure: 
> >> >> > 
> >> >> > - mysite- 
> >> >> > 
> >> >> >  - mysite - urls.py 
> >> >> > 
> >> >> >-views.py 
> >> >> > 
> >> >> > ... 
> >> >> > 
> >> >> >  - templates - index.html 
> >> >> > 
> >> >> >  - images 
> >> >> >  - static - mysite - assets - css - main.css 
> >> >> > 
> >> >> > - js 
> >> >> > 
> >> >> > ... 
> >> >> > In my index.html 
> >> >> > 
> >> >> > add 
> >> >> > 
> >> >> > `{% load staticfiles % } 
> >> >> > ` 
> >> >> > 
> >> >> > it said i have a Invalid block tag about TemplateSyntaxError 
> >> >> > `` 
> >> >> > 
> >> >> > views.py (about static files part) 
> >> >> > ```STATICFILES_DIRS = [ 
> >> >> > os.path.join(BASE_DIR, "static"), 
> >> >> > '/mysite/static/', 
> >> >> > ] 
> >> >> > STATIC_URL = '/static/' 
> >> >> > STATIC_ROOT='/mysite/static/'``` 
> >> >> > 
> >> >> > what's part should i notice? 
> >> >> > 
> >> >> > -- 
> >> >> > 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. 
> &

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng

https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1

ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道:
>
> I have a hard time to read the paths you use. The command tree produce 
> a nice tree view of a directory, it might help. You can also use 
> service like http://paste2.org/ or https://gist.github.com/ to share 
> it 
>
> 2016-09-11 17:58 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com 
> >: 
> > thx reply,but it just can see the original html with no css,is my path 
> > setted correct? 
> > 
> > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: 
> >> 
> >> Have you tried to add a few newlines to be sure about which line is the 
> >> issue ? 
> >> 
> >> Also, in you email, there is a space between % and } in the load 
> >> staticfiles tag 
> >> 
> >> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com>: 
> >> > I use django1.10 
> >> > 
> >> > i reference the official doc 
> >> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
> >> > 
> >> > my project name:mysite 
> >> > 
> >> > structure: 
> >> > 
> >> > - mysite- 
> >> > 
> >> >  - mysite - urls.py 
> >> > 
> >> >-views.py 
> >> > 
> >> > ... 
> >> > 
> >> >  - templates - index.html 
> >> > 
> >> >  - images 
> >> >  - static - mysite - assets - css - main.css 
> >> > 
> >> > - js 
> >> > 
> >> > ... 
> >> > In my index.html 
> >> > 
> >> > add 
> >> > 
> >> > `{% load staticfiles % } 
> >> > ` 
> >> > 
> >> > it said i have a Invalid block tag about TemplateSyntaxError 
> >> > `` 
> >> > 
> >> > views.py (about static files part) 
> >> > ```STATICFILES_DIRS = [ 
> >> > os.path.join(BASE_DIR, "static"), 
> >> > '/mysite/static/', 
> >> > ] 
> >> > STATIC_URL = '/static/' 
> >> > STATIC_ROOT='/mysite/static/'``` 
> >> > 
> >> > what's part should i notice? 
> >> > 
> >> > -- 
> >> > 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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%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 
> > "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/a699584c-d57f-4b84-a38b-fe03638caefd%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 
"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/6e864bf6-c12b-49bc-b906-d2c35a5e884b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
thx reply,but it just can see the original html with no css,is my path 
setted correct?

ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道:
>
> Have you tried to add a few newlines to be sure about which line is the 
> issue ? 
>
> Also, in you email, there is a space between % and } in the load 
> staticfiles tag 
>
> 2016-09-11 7:29 GMT+02:00 Jonathan Cheng <jonatha...@gmail.com 
> >: 
> > I use django1.10 
> > 
> > i reference the official doc 
> > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ 
> > 
> > my project name:mysite 
> > 
> > structure: 
> > 
> > - mysite- 
> > 
> >  - mysite - urls.py 
> > 
> >-views.py 
> > 
> > ... 
> > 
> >  - templates - index.html 
> > 
> >  - images 
> >  - static - mysite - assets - css - main.css 
> > 
> > - js 
> > 
> > ... 
> > In my index.html 
> > 
> > add 
> > 
> > `{% load staticfiles % } 
> > ` 
> > 
> > it said i have a Invalid block tag about TemplateSyntaxError 
> > `` 
> > 
> > views.py (about static files part) 
> > ```STATICFILES_DIRS = [ 
> > os.path.join(BASE_DIR, "static"), 
> > '/mysite/static/', 
> > ] 
> > STATIC_URL = '/static/' 
> > STATIC_ROOT='/mysite/static/'``` 
> > 
> > what's part should i notice? 
> > 
> > -- 
> > 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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%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 
"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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Import css in Django

2016-09-11 Thread Jonathan Cheng
I use django1.10

i reference the official doc
https://docs.djangoproject.com/en/1.10/intro/tutorial06/

my project name:mysite

structure:
  
- mysite-
   
 - mysite - urls.py

   -views.py

...

 - templates - index.html 
   
 - images 
 - static - mysite - assets - css - main.css
 
- js

...
In my index.html

add

`{% load staticfiles % }
`

it said i have a Invalid block tag about TemplateSyntaxError
``

views.py (about static files part)
```STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
'/mysite/static/',
]
STATIC_URL = '/static/'
STATIC_ROOT='/mysite/static/'```

what's part should i notice?

-- 
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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Team project via Git repo

2015-10-13 Thread Jonathan Querubina
This is a long shot, but, do you have .pyc files on the repository? If yes, try 
removing *.pyc

Sent from my iPhone

> On Oct 13, 2015, at 22:05, Jonathan Querubina <jota...@me.com> wrote:
> 
> No, if debug is true, you do not have to worry about statics yet
> 
> Are you activating the env before the runserver command?
> 
> Sent from my iPhone
> 
>> On Oct 13, 2015, at 21:56, Ralph Castain <r...@open-mpi.org> wrote:
>> 
>> 
>>> On Oct 13, 2015, at 5:42 PM, Jonathan Querubina <jota...@me.com> wrote:
>>> 
>>> Have you installed any dependencies via "pip” ?
>> 
>> Only Django itself was installed via “pip” - we went thru the binaries and 
>> edited the path. We also uninstalled Django and reinstalled it on the host 
>> using “pip”, but the behavior is the same.
>> 
>>> 
>>> If not and all the code has been done under your djando apps, the problem 
>>> could be on the git. Have you checked .gitignore ?
>> 
>> We don’t have a .gitignore at this time as we weren’t sure what should be 
>> ignored. We also tried just copying the environment (no Git involved), and 
>> had the same result. So my guess is that there is some static file or 
>> something that needs refreshing so Django recognizes the project.
>> 
>> The “welcome” page indicates that we have DEBUG=TRUE in our settings, but 
>> that we haven’t configured any URLs. Is the URL in a static file, perchance?
>> 
>> 
>>> 
>>> Sent from my iPhone
>>> 
>>>> On Oct 13, 2015, at 21:38, 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 thi

Re: Team project via Git repo

2015-10-13 Thread Jonathan Querubina
No, if debug is true, you do not have to worry about statics yet

Are you activating the env before the runserver command?

Sent from my iPhone

> On Oct 13, 2015, at 21:56, Ralph Castain <r...@open-mpi.org> wrote:
> 
> 
>> On Oct 13, 2015, at 5:42 PM, Jonathan Querubina <jota...@me.com> wrote:
>> 
>> Have you installed any dependencies via "pip” ?
> 
> Only Django itself was installed via “pip” - we went thru the binaries and 
> edited the path. We also uninstalled Django and reinstalled it on the host 
> using “pip”, but the behavior is the same.
> 
>> 
>> If not and all the code has been done under your djando apps, the problem 
>> could be on the git. Have you checked .gitignore ?
> 
> We don’t have a .gitignore at this time as we weren’t sure what should be 
> ignored. We also tried just copying the environment (no Git involved), and 
> had the same result. So my guess is that there is some static file or 
> something that needs refreshing so Django recognizes the project.
> 
> The “welcome” page indicates that we have DEBUG=TRUE in our settings, but 
> that we haven’t configured any URLs. Is the URL in a static file, perchance?
> 
> 
>> 
>> Sent from my iPhone
>> 
>>> On Oct 13, 2015, at 21:38, 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 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%40googlegro

Re: Team project via Git repo

2015-10-13 Thread Jonathan Querubina
Have you installed any dependencies via "pip" ?

If not and all the code has been done under your djando apps, the problem could 
be on the git. Have you checked .gitignore ?

Sent from my iPhone

> On Oct 13, 2015, at 21:38, 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 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/3A0F673C-020E-4EEA-BDE1-AAB35BBFBCD2%40me.com.
For more options, visit https://groups.google.com/d/optout.


Plugging in Require.js

2015-09-09 Thread Christos Jonathan Seth Hayward
I asked how to plug in Require.js at:

http://stackoverflow.com/questions/32483810/how-do-i-think-and-act-in-require-js-if-i-have-a-script-src-background-a

​What should I be doing, and what packages should I be using, to be able to
use Require.js?


Thanks,​


-- 
[image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/>
Christos Jonathan Seth Hayward, an Orthodox Christian author.

Amazon / Kindle <http://amazon.com/author/cjshayward> • *Author
<http://cjshayward.com/>* • Author Bio <http://jonathanscorner.com/author/>
 • *The Classic Orthodox Bible <http://classicorthodoxbible.com/>* • *Email
<christos.jonathan.hayw...@gmail.com>* • Facebook
<http://www.facebook.com/christos.jonathan.hayward> • Fan Page
<http://fan.cjshayward.com/>• Github
<https://github.com/JonathanHayward?tab=repositories> • Google Plus
<http://jonathanscorner.com/plus> • LinkedIn
<http://www.linkedin.com/in/jonathanhayward> • *Main Website
<http://jonathanscorner.com/>* • *Professional
<http://jonathanhayward.com/>* • Twitter
<http://twitter.com/JonathansCorner> • What's New?
<http://jonathanscorner.com/>

If you read just *one* of my books, you'll want *The Best of Jonathan's
Corner <http://tinyurl.com/best-of-jonathans-corner>* (Kindle
<http://tinyurl.com/best-jonathans-corner-kindle>).

-- 
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/CAE6_B5R0UoJq%2BsC-pLY6zbTi3m99F_eaFnuaf3c9gAxb9nT%3DNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Learning Python and Django and should I?? (I have a year of 10 or so hours a week)

2015-08-14 Thread Jonathan Baker
Have you written any Python or Ruby? If so, do you have a preference?
Both are high-level languages, and the dominant web framework for each
(Django and Rails) are mature and stable. I'd at least read and write
some code for each and see if the syntax of the language and the
semantics of the framework strike your fancy. Ruby didn't click with
me like Python did, so three and a half years after ditching PHP here
I am. I love how easy Python is to read, and I've thoroughly enjoyed
working with Django (esp. after Drupal, WordPress and a bit of
CodeIgniter).

Concerning jobs, I'm based in Denver, CO and there are many more RoR
opportunities here than Django. I can't speak for other markets, but
I'm moving to Oregon next year so I'll find out soon enough;)

As for debugging, the Django Debug Toolbar
(https://github.com/django-debug-toolbar/django-debug-toolbar) is
quite popular. That combined with vim-flake8
(https://github.com/nvie/vim-flake8) and PDB
(https://docs.python.aorg/2/library/pdb.html) get me out of most hairy
situations I find for myself.

Hope this helps a bit,
JDB

On Fri, Aug 14, 2015 at 3:20 PM, Rotimi Ajayi-Dopemu <rodop...@gmail.com> wrote:
> Hi all,
> I am sure this question has been beaten into the ground but hopefully I can
> get some specific insight so I don't waste time in the future. Thanks in
> advance.
>
> The question:
> I have a year to learn a new programming language for web application
> development. I will be learning concurrently with going to school so I have
> about 10 hrs a week give or take. So the question is this should I learn
> Ruby on Rails or Python/Django???
>
> Background Info about why:
> I am a student studying Cognitive Science and want to work as either a UX
> designer or a Full Stack Engineer, I am leaning towards Full Stack
> Engineering and designing more for the front end in my after hours. I don't
> have a serious girlfriend (lol) and my life is pretty simple so I know this
> is what I want to do. I am committed. I know PHP fairly well and can use
> Wordpress and Joomla for whatever. I am familiar with MVC through use of a
> popular PHP framework called Codeigniter. Oh yeah, I used C++ pretty heavily
> about 10 years ago building Windows Applications...and loved it.
>
> What I will be using it for:
> After I graduate in a year and after learning the language I decide on I
> plan to develop a full blown web application. I don't know if this is too
> ambitious but all I'm willing to say now is it is like Pintrest but not a
> clone. I have fully developed the concept for a long time now and will have
> the features down pat by then. My goal is to invest my time on a prototype
> and release it, then hopefully get with a team or even investors if it works
> and develop it more. If it doesn't work out then Plan B is to use my
> skill-set in a full time position with a company in a tech hub somewhere in
> the US. Plan B might turn into Plan A in a year depending on my money
> situation.
>
> So there are three aspects to this question: Should I learn Django/Python or
> Ruby on Rails? is Plan A(the web app) feasible with just me and
> Django/Python? How does Python fair in the work market?
>
> I know all this may seem like a lot to ask but this is really just a test of
> this forums activity. I have been pretty avid on staying with PHP or maybe
> going back to C++ because this HTML/CSS situation I usually work with these
> days tends to get on my nerves.
>
> Last thing to add for this thread (I swear) is: one thing that really irks
> me about web development is the lack of real debugging tools that work
> flawlessly. Maybe it is just I haven't learned them yet but I know in PHP
> you are stuck with using Xdebug through your browser (although I just found
> a new debugger that only works in recent versions of PHP) so if anyone could
> just give a 1+ to integrated debugging with Python Django that would be
> great.
>
> Thanks again if you read this far.
> Feel free to contact me if you have a similar web application in the works,
> I have no doubt there probably is.
>
> --
> 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/4c01a2c3-50f1-4123-b0b2-4197222d6595%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Jonathan D. Baker
https://voltaic.io

-- 
You received this message because you are subscribed to the Googl

Best Practices for Migrations in Reusable Apps?

2015-06-10 Thread Jonathan Barratt
Hi All,

I'm interested to know what the community's opinions are on how best to package 
migrations with reusable apps (I'm thinking of the built-in migrations, but it 
seems the same principles would apply for pre-1.8 south migrations).

My current approach is to squash all schema migrations each time a new one is 
generated so that new installs are smooth; we've seen issues arise from just 
keeping the individual migrations that accumulate the long way (in terms of 
both speed and bugs).

I figure existing users who upgrade can be expected to run their own make 
migrations if necessary, but perhaps I'm placing the burden of work on the 
wrong party...

If initial data is necessary, then it gets its own separate data migration - 
this seems to keep the code (and git history) cleaner IMO.

I'd greatly appreciate and criticism, suggestions or alternate approaches that 
occurs to you.

Thanks in advance,
Jonathan


-- 
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/146C30FE-903F-4823-916F-F50B03DFDCB5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-14 Thread Jonathan Barratt
> On 14 พ.ค. 2558, at 05:26, Tom Evans <tevans...@googlemail.com> wrote:
> 
>> On Thu, May 14, 2015 at 4:36 AM, reduxionist <jonathan.barr...@gmail.com> 
>> wrote:

>> The reason for those search results is that mpm-prefork does, however, spawn
>> a process per request,
> 
> No, really, it does not. It only spawns a new process when there are
> no available workers to process an incoming request, and you have not
> reached the maximum number of workers that you have configured it to
> start.

Oops, sorry, I was totally wrong about that.

> You can configure it to start all the worker processes you want
> when it starts up, and never to kill them off, and it will never spawn
> a new process.
> 
> Apache processes are small, unless you do daft things like embed your
> web application in each worker process (mod_php style). This is the
> main complaint "Apache is eating all my memory" - it isn't, your web
> application you've embedded into Apache is eating all your memory.
> 
> All of this is irrelevant for django, because with Apache you should
> use mod_wsgi in daemon mode, which separates out your web application
> processes from the web server.

>> I think the reason a lot of people seem to run mpm-prefork is just that it's
>> the default multi-processing module for Apache on most (all?) *nix platforms
>> and they don't know any better.
> 
> Quite. We run a pair of Apache 2.4 reverse proxies in front of all of
> our (400+) domains, serving around 40 million requests per day,
> providing SSL termination and static file serving. We use event MPM
> and we have it scaled to support a peak of 2048 simultaneous
> connections. Load on the server never goes above 0.2, memory usage
> never goes above 1GB for the entire OS + applications, the rest of the
> RAM is used by the OS to cache the aforementioned static files.
> 
> On our app servers we typically use Apache with worker MPM and
> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
> love some time to play around with a circusd + chausette + celery
> setup.
> 
> The choice of web server is, these days, irrelevant. If it uses too
> much memory or can't handle enough users, it is never the fault of the
> web server, but instead of your application and/or configuration.

Thanks for the awesome write-up Tom and for correcting my error, my apologies 
to all for contributing to any FUD!

Yours gratefully,
Jonathan

-- 
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/46CB380A-BBA2-4F78-8F7F-8DFC7A994859%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: getting tuples from http request.GET

2015-03-08 Thread Jonathan Querubina
You could use the same variable name on the querystring and call:

request.GET.getlist

For example, on a select multiple field ou checkbox

 John
Mobile & Web developer
+55(12)98864-1594

> On Mar 8, 2015, at 00:01, Sunil Sawant  wrote:
> 
> Thanks  Collin, you cut out the crap from from my code. Simple is beautiful :)
> 
>> On Friday, March 6, 2015 at 5:11:45 PM UTC-8, Collin Anderson wrote:
>> Hi,
>> 
>> Normally query arguments are separated by &. If you're able to send the data 
>> like this:
>> 
>> https://mydesktop.com/validator?hostname1=host1.example.com=ca=2.2.2.2=host2.example.com=wa=3.3.3.3
>> 
>> Then you could do something like:
>> 
>> data = []
>> i = 0
>> while True:
>> i += 1
>> try:
>> data.append((request.GET['hostname%s' % i], request.GET['location%s' 
>> % i], request.GET['ip%s' % i]))
>> except KeyError:
>> break
>> 
>> Collin
>> 
>>> On Wednesday, March 4, 2015 at 7:57:17 PM UTC-5, Sunil Sawant wrote:
>> 
>>> Hi Guys,
>>> 
>>> Pretty new to Django, but used it blindly and works wonders. But here is a 
>>> situation I am blocked at now for a new project
>>> 
>>> I request.GET the following URL
>>> 
>>> https://mydesktop.com/validator?hostname1=host1.example.com,location1=ca,ip1=2.2.2.2,hostname2=host2.example.com,location2=wa,ip2=3.3.3.3
>>> 
>>> Am using request.GET I want to get the output in a tuple or hash form as:
>>> 
>>> [{host1.example.com:[ca,2.2.2.2]},{host2.example.com:[wa,3.3.3.3]}]
>>> 
>>> 
>>> 
>>> Once I have this data I can process it further.
>>> 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/fbdcea09-29e8-4765-9f36-47539a387dbb%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/CA17689D-B76E-4ADA-8DBC-854180D7A7D6%40me.com.
For more options, visit https://groups.google.com/d/optout.


Re: initial dta for model in Django 1.7 or newer

2014-12-26 Thread Robert Jonathan Šimon
Hi,
I am very sorry, but I don't understand russian. Can you answer me in
english? And I am using Python 3.4.
Dne 26. 12. 2014 14:30 "Валерий Бовсуновский" <id290...@gmail.com>
napsal(a):

>
>
> четверг, 25 декабря 2014 г., 18:06:35 UTC+3 пользователь Robert Jonathan
> Šimon написал:
>>
>> Hi,
>> When i googled for this problem a found out, that with migrations in
>> Django 1.7, there is new way how it should be done, but i didnt understand
>> it how. Can anyone explain me the new way how to do it?
>> Thanks a lot.
>>
>
>
> python2.7 manage.py makemigrations
> python2.7 manage.py migrate
>
>
> makemigrations - проверяет есть ли новые таблицы
> migrate - создает таблицы или удаляет
>
> Напишите модель простую что бы протестировать
>
> class Home(models.Model):
> title = models.CharField(max_length=150)
> text = models.TextField(blank=True, null=True)
> date = models.DateTimeField(blank=True, null=True)
> def __unicode__(self):
> return self.title
>
>
>
> проведите две  команды
>
>
> python2.7 manage.py makemigrations
> python2.7 manage.py migrate
>
>
>
> Потом закомментируйте одну строку
>
>
> class Home(models.Model):
> title = models.CharField(max_length=150)
> #text = models.TextField(blank=True, null=True)
> date = models.DateTimeField(blank=True, null=True)
> def __unicode__(self):
> return self.title
>
>
>
> И опять две команды
> python2.7 manage.py makemigrations
> python2.7 manage.py migrate
>
> поле удалится
>  #text = models.TextField(blank=True, null=True)
>
> Что бы не было ошибок нужно всегда заполнять blank=True, null=True,
> смотреть документацию, иначе выдаст варианты.
>
> --
> 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/9i7Cf5ksaeE/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/dbd118f7-2410-4755-958f-c1e63f33ad56%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/dbd118f7-2410-4755-958f-c1e63f33ad56%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/CALsvucLRK_dCZk6YC9%2BCr6cQs3BgDqewfZ7X8kXZ%2Bwf6VzPLTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


initial dta for model in Django 1.7 or newer

2014-12-25 Thread Robert Jonathan Šimon
Hi,
When i googled for this problem a found out, that with migrations in Django 
1.7, there is new way how it should be done, but i didnt understand it how. 
Can anyone explain me the new way how to do it?
Thanks a lot.

-- 
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/07b1bd83-85cb-485d-891d-ba8d7bca763f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: eCommerce Search

2014-12-17 Thread Jonathan Baker
Also, check out: https://github.com/alex/django-filter

On Wed, Dec 17, 2014 at 2:11 PM, John Rodkey <jrodke...@gmail.com> wrote:
> Yes, that is what I'm looking for.  I'm new to the Django world and was
> curious if there is already a good existing package.  I will search for
> django faceted search.
>
>
> On Wednesday, December 17, 2014 2:30:13 PM UTC-6, werefrog wrote:
>>
>> Hi John,
>>
>> You might want to search for django+faceted+search. Is it what you're
>> looking for?
>>
>> Best regards
>>
>>
>> Le 17/12/2014 16:20, John Rodkey a écrit :
>> > Hi All, I apologize if this has been answered, but what is the best way
>> > to
>> > search/query a model based on filters.
>> >
>> > For example, say we are setting up a shoe site. What is the best way to
>> > allow customers to search for shoes by brand, color, size, and/or price.
>> > I
>> > would prefer to make these dropdowns in the templates, I'm just not sure
>> > how to build this functionality in the view.
>> >
>> > I would appreciate any direction.
>> >
>>
> --
> 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/d2097d0d-7a73-4910-9382-8136d58a05d6%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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/CAPMFOb7q0vxgApt6RfXKj2%3DvJWDe2YcRQ77Kh6p4brJz8Kb_pQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How can I add an attribute to each option in a django model form containing a foreign key?

2014-12-15 Thread Jonathan Dan

Hello,

I have two models:

 class Currency(models.Model):
...
available = models.BooleanField()

 class Offer(models.Model):
...
currency = models.ForeignKey('Currency')

I make a form from the Offer model:

 class OfferForm(ModelForm):
class Meta:
   model = Offer

How can I add an attribute tag with the value `currency.available` to
each `` from the `` `Currency` widget?

(I am also open to solutions using external apps (like
django-crispy-forms))

(This question has also been asked on stackoverflow:
http://stackoverflow.com/q/27474719/1011154 )

Best regards
Jonathan Dan

--
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/548F19D8.7010101%40student.tudelft.nl.
For more options, visit https://groups.google.com/d/optout.


django-ckeditor noop?

2014-12-05 Thread Christos Jonathan Seth Hayward
At
http://stackoverflow.com/questions/27321396/how-can-i-get-my-django-ckeditor-installation-to-recognize
I asked what I could do to get a RichTextField() to be displayed with a
CKeditor widget.

Any advice for what I should change?


Thanks,

-- 
[image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/>
Christos Jonathan Seth Hayward, an Orthodox Christian author.

Amazon / Kindle <http://amazon.com/author/cjshayward> • *Author
<http://cjshayward.com/>* • Author Bio <http://jonathanscorner.com/author/>
 • *The Classic Orthodox Bible <http://classicorthodoxbible.com/>* • *Email
<christos.jonathan.hayw...@gmail.com>* • Facebook
<http://www.facebook.com/christos.jonathan.hayward> • Fan Page
<http://fan.cjshayward.com/>• Github
<https://github.com/JonathanHayward?tab=repositories> • Google Plus
<http://jonathanscorner.com/plus> • LinkedIn
<http://www.linkedin.com/in/jonathanhayward> • *Main Website
<http://jonathanscorner.com/>* • *Professional
<http://jonathanhayward.com/>* • Twitter
<http://twitter.com/JonathansCorner> • What's New?
<http://jonathanscorner.com/>

If you read just *one* of my books, you'll want *The Best of Jonathan's
Corner <http://tinyurl.com/best-of-jonathans-corner>* (Kindle
<http://tinyurl.com/best-jonathans-corner-kindle>).

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


Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
And with that, I'm off and running!

Thank you for your help.

On Mon, Nov 24, 2014 at 4:05 PM, Carl Meyer <c...@oddbird.net> wrote:

> On 11/24/2014 03:00 PM, Carl Meyer wrote:
> > On 11/24/2014 02:56 PM, Christos Jonathan Seth Hayward wrote:
> >> Thanks so much!
> >>
> >> Could you confirm the invocation?
> >>
> >> cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi 0.0.0.0:
> >>
> >> usage: gunicorn [OPTIONS] [APP_MODULE]
> >>
> >> gunicorn: error: No application module specified.
> >
> > That's the right invocation, but you need your python path set up to
> > include the directory that has `manage.py` in it (when you actually run
> > a `manage.py` command, this happens automatically, but not when you run
> > gunicorn).
> >
> > There are a variety of ways that can be done, the simplest is to run
> > your gunicorn command from the same directory that contains `manage.py`
> > and set the PYTHONPATH env var:
> >
> > PYTHONPATH=`pwd` gunicorn cynthia.wsgi 0.0.0.0:
>
> Sorry, I was focused on the Python issues, didn't notice that you're
> trying to pass a bind address without using the `-b` option. This is
> what you want:
>
> PYTHONPATH=`pwd` gunicorn -b 0.0.0.0: cynthia.wsgi
>
> Carl
>
> --
> 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/5473AB99.8040101%40oddbird.net
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
[image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/>
Christos Jonathan Seth Hayward, an Orthodox Christian author.

Amazon / Kindle <http://amazon.com/author/cjshayward> • *Author
<http://cjshayward.com/>* • Author Bio <http://jonathanscorner.com/author/>
 • *The Classic Orthodox Bible <http://classicorthodoxbible.com/>* • *Email
<christos.jonathan.hayw...@gmail.com>* • Facebook
<http://www.facebook.com/christos.jonathan.hayward> • Fan Page
<http://fan.cjshayward.com/>• Github
<https://github.com/JonathanHayward?tab=repositories> • Google Plus
<http://jonathanscorner.com/plus> • LinkedIn
<http://www.linkedin.com/in/jonathanhayward> • *Main Website
<http://jonathanscorner.com/>* • *Professional
<http://jonathanhayward.com/>* • Twitter
<http://twitter.com/JonathansCorner> • What's New?
<http://jonathanscorner.com/>

If you read just *one* of my books, you'll want *The Best of Jonathan's
Corner <http://tinyurl.com/best-of-jonathans-corner>* (Kindle
<http://tinyurl.com/best-jonathans-corner-kindle>).

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


Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
Thanks so much!

Could you confirm the invocation?

cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi 0.0.0.0:

usage: gunicorn [OPTIONS] [APP_MODULE]

gunicorn: error: No application module specified.

cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi:application 0.0.0.0:

usage: gunicorn [OPTIONS] [APP_MODULE]

gunicorn: error: No application module specified.

cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi:cynthia 0.0.0.0:

usage: gunicorn [OPTIONS] [APP_MODULE]

gunicorn: error: No application module specified.


On Mon, Nov 24, 2014 at 3:45 PM, Carl Meyer <c...@oddbird.net> wrote:

>
>
> On 11/24/2014 02:38 PM, Christos Jonathan Seth Hayward wrote:
> > Ok; wonder if I should upgrade Django.
> >
> > I just ran a startproject earlier today (I can re-create it; I was just
> > trying to get it running and see the start page in my browser before
> going
> > further).
> >
> > cjsh@ps306627:~/cynthia$ find . -name \*.wsgi
>
> Your Django version is fine. The problem is that you're expecting to
> find a file with the `.wsgi` extension. The file Django generates is
> called `myproject/wsgi.py`, thus its dotted Python import path (which is
> what you pass to gunicorn) is `myproject.wsgi`.
>
> Carl
>
> --
> 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/5473A6EF.4090107%40oddbird.net
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
[image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/>
Christos Jonathan Seth Hayward, an Orthodox Christian author.

Amazon / Kindle <http://amazon.com/author/cjshayward> • *Author
<http://cjshayward.com/>* • Author Bio <http://jonathanscorner.com/author/>
 • *The Classic Orthodox Bible <http://classicorthodoxbible.com/>* • *Email
<christos.jonathan.hayw...@gmail.com>* • Facebook
<http://www.facebook.com/christos.jonathan.hayward> • Fan Page
<http://fan.cjshayward.com/>• Github
<https://github.com/JonathanHayward?tab=repositories> • Google Plus
<http://jonathanscorner.com/plus> • LinkedIn
<http://www.linkedin.com/in/jonathanhayward> • *Main Website
<http://jonathanscorner.com/>* • *Professional
<http://jonathanhayward.com/>* • Twitter
<http://twitter.com/JonathansCorner> • What's New?
<http://jonathanscorner.com/>

If you read just *one* of my books, you'll want *The Best of Jonathan's
Corner <http://tinyurl.com/best-of-jonathans-corner>* (Kindle
<http://tinyurl.com/best-jonathans-corner-kindle>).

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


Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
Ok; wonder if I should upgrade Django.

I just ran a startproject earlier today (I can re-create it; I was just
trying to get it running and see the start page in my browser before going
further).

cjsh@ps306627:~/cynthia$ find . -name \*.wsgi

cjsh@ps306627:~/cynthia$ python manage.py shell

Python 2.6.6 (r266:84292, Aug 12 2014, 07:57:07)

[GCC 4.4.5] on linux2

Type "help", "copyright", "credits" or "license" for more information.

(InteractiveConsole)

>>> import django

>>> dir(django)

['VERSION', '__builtins__', '__doc__', '__file__', '__name__',
'__package__', '__path__', 'conf', 'contrib', 'core', 'db', 'dispatch',
'forms', 'get_version', 'http', 'middleware', 'shortcuts', 'template',
'templatetags', 'test', 'utils', 'views']

>>> django.VERSION

(1, 6, 5, 'final', 0)

>>>

​Further suggestions?


Thanks,

On Mon, Nov 24, 2014 at 3:24 PM, Carl Meyer <c...@oddbird.net> wrote:

> Hi,
>
> On 11/24/2014 02:19 PM, Christos Jonathan Seth Hayward wrote:
> > From
> >
> http://stackoverflow.com/questions/27113466/how-can-i-deploy-django-gunicorn-under-apache-proxy
> > :
> >
> > 've run through the documentation and am hitting the same pages over and
> > over again. At present I've found documentation to run off an existing
> > myapp.wsgi file, but documentation for how to make an appropriate wsgi
> file
> > is a little harder to find.
> >
> > If I want to make, proxied by Apache, the equivalent of, on an older
> > version of Gunicorn etc.:
> >
> > python manage.py run_gunicorn 0.0.0.0:
> >
> > what should I be doing to supply a WSGI file for:
> >
> > gunicorn project.wsgi:application
>
> That depends a bit on your version of Django. For any Django version
> since 1.4, 'django-admin.py startproject' should generate a wsgi.py file
> in your project. If your project doesn't have one, you can run
> 'startproject' to quickly see what one should look like and copy it into
> your project.
>
> Carl
>
> --
> 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/5473A21F.8050801%40oddbird.net
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
[image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/>
Christos Jonathan Seth Hayward, an Orthodox Christian author.

Amazon / Kindle <http://amazon.com/author/cjshayward> • *Author
<http://cjshayward.com/>* • Author Bio <http://jonathanscorner.com/author/>
 • *The Classic Orthodox Bible <http://classicorthodoxbible.com/>* • *Email
<christos.jonathan.hayw...@gmail.com>* • Facebook
<http://www.facebook.com/christos.jonathan.hayward> • Fan Page
<http://fan.cjshayward.com/>• Github
<https://github.com/JonathanHayward?tab=repositories> • Google Plus
<http://jonathanscorner.com/plus> • LinkedIn
<http://www.linkedin.com/in/jonathanhayward> • *Main Website
<http://jonathanscorner.com/>* • *Professional
<http://jonathanhayward.com/>* • Twitter
<http://twitter.com/JonathansCorner> • What's New?
<http://jonathanscorner.com/>

If you read just *one* of my books, you'll want *The Best of Jonathan's
Corner <http://tinyurl.com/best-of-jonathans-corner>* (Kindle
<http://tinyurl.com/best-jonathans-corner-kindle>).

-- 
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/CAE6_B5RwmAdAmotBkmmARKZAED%3DKZyjeUk4a_Xz%3Dux%3DbA0d%2BiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Christos Jonathan Seth Hayward
From
http://stackoverflow.com/questions/27113466/how-can-i-deploy-django-gunicorn-under-apache-proxy
:

've run through the documentation and am hitting the same pages over and
over again. At present I've found documentation to run off an existing
myapp.wsgi file, but documentation for how to make an appropriate wsgi file
is a little harder to find.

If I want to make, proxied by Apache, the equivalent of, on an older
version of Gunicorn etc.:

python manage.py run_gunicorn 0.0.0.0:

what should I be doing to supply a WSGI file for:

gunicorn project.wsgi:application

Thanks,
-- 
[image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/>
Christos Jonathan Seth Hayward, an Orthodox Christian author.

Amazon / Kindle <http://amazon.com/author/cjshayward> • *Author
<http://cjshayward.com/>* • Author Bio <http://jonathanscorner.com/author/>
 • *The Classic Orthodox Bible <http://classicorthodoxbible.com/>* • *Email
<christos.jonathan.hayw...@gmail.com>* • Facebook
<http://www.facebook.com/christos.jonathan.hayward> • Fan Page
<http://fan.cjshayward.com/>• Github
<https://github.com/JonathanHayward?tab=repositories> • Google Plus
<http://jonathanscorner.com/plus> • LinkedIn
<http://www.linkedin.com/in/jonathanhayward> • *Main Website
<http://jonathanscorner.com/>* • *Professional
<http://jonathanhayward.com/>* • Twitter
<http://twitter.com/JonathansCorner> • What's New?
<http://jonathanscorner.com/>

If you read just *one* of my books, you'll want *The Best of Jonathan's
Corner <http://tinyurl.com/best-of-jonathans-corner>* (Kindle
<http://tinyurl.com/best-jonathans-corner-kindle>).

-- 
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/CAE6_B5SUNHzCEjoC%3D7y9tqWq-m%3DSWkYayqaQ6PNqy9BdXVqOAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.7 - help with change in "Save as new" behavior when related inlines are marked to be deleted

2014-11-14 Thread Jonathan Morgan
re: "There shouldn't be a delete box for unsaved items, right?"

This is a special case - you are taking an existing record and "Save as 
new"-ing (or however you say that), so there are existing associated 
records that you are copying as well.  But, in this case, I think the user 
would change a few of those items, then would get rid of any subsequent 
ones that are not needed by clicking the "Delete" checkbox next to them.  
In the original record, all items are saved.  In the new record, however, 
after "Save as new", none of the child records are saved, and only some are 
intended to be kept, while some are intended to be discarded.

As far as I know, if you just do "Save as new", then delete un-wanted 
records in a subsequent edit of the new record, everything works fine.

On Wednesday, November 12, 2014 3:42:43 PM UTC-5, Collin Anderson wrote:
>
> Hello,
>
> That does seem odd. Are you using a custom form or custom template at all?
>
> There shouldn't be a delete box for unsaved items, right?
>
> Collin
>
>

-- 
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/36ad9cfd-3c7b-4f9b-80a4-2cf9a0223da0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.7 - help with change in "Save as new" behavior when related inlines are marked to be deleted

2014-11-14 Thread Jonathan Morgan
Hello,

Thanks for replying!  Sorry for delayed response.

I am not using custom forms or custom templates.

It looks like, with "Save as new", django first makes a full copy of the 
base record and all the child records, including those that are marked for 
deletion, and then it subsequently tries to delete the ones that are marked 
for deletion before it saves everything, to avoid creating-then-deleting 
the records marked for deletion.  This makes sense.

In 1.7, deletion of child records fails because it appears to hash the 
child records as part of this processing, but the child records have not 
been saved to the database, so do not have an ID, so cannot be hashed.

This behavior of throwing an exception on attempts to hash objects with no 
ID is a relatively recent change, documented in this commit from 8/14/2013:

https://github.com/django/django/commit/6af05e7a0f0e4604d6a67899acaa99d73ec0dfaa

I am not sure what release this commit is first in, and I don't know too 
much about the core django code at work here.  If that commit was included 
in a version earlier than 1.7, then it might be a combination of it and 
changes to the save functionality to add hashing that are causing this 
problem.  If it was only introduced in 1.7, then it could be that this 
change is the cause of this problem, and the higher-level code that 
implements "Save as new" might not have been changed to deal with this case.

I'm happy to help as I can, but not sure how to proceed from here.

Thanks,

Jon

On Wednesday, November 12, 2014 3:42:43 PM UTC-5, Collin Anderson wrote:
>
> Hello,
>
> That does seem odd. Are you using a custom form or custom template at all?
>
> There shouldn't be a delete box for unsaved items, right?
>
> Collin
>
>

-- 
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/7a8a17f7-9f78-4279-8cb2-ed69b685e07e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django 1.7 - help with change in "Save as new" behavior when related inlines are marked to be deleted

2014-11-07 Thread Jonathan Morgan
Hello,

I have an Event model (for an event like a concert or a play) that can have 
many Event_Dates (different showing dates and times of the concert of 
play).  The model relation is implemented with a ForeignKey from the 
Event_Date model to the Event.

In the django admins, I have the Event_Dates included as an inline in the 
Event admin page.  The inline code:

class EventDateInline( admin.StackedInline ):

model = Event_Date
extra = 2
fk_name = 'event'
fieldsets = [
( None,
{
'fields' : [ 'start_date', 'start_time', 'end_time' ]
}
),
( "Optional End Date and Description",
{
'fields' : [ 'end_date', 'description' ],
'classes' : ( "collapse", )
}
),
]

#-- END EventDateInline StackedInline class --#

And the code where the inline is included in the Event:

inlines = [
#EventPresenterInline,
EventDateInline,
EventImageInline,
]


Pretty standard stuff based on what I know of django.

When the users of this application need to make a new Event that is an 
annual update of an event that is put on once each year (the Nutcracker, 
for instance - multiple performances every December), they go to last 
year's Event in the admin, check the "delete" checkbox next to all but one 
of the dates, then use the "Save as new" button to make a new Event.

This worked fine in django versions 1.2 through 1.6.  A new event was 
created with one new date.  In 1.7, when one does this, one gets the 
following error:

TypeError at /path/to/event/edit/

Model instances without primary key value are unhashable

Request Method: POST
Request URL:http://example.com/path/to/event/edit/
Django Version: 1.7.1
Exception Type: TypeError
Exception Value:

Model instances without primary key value are unhashable

Exception Location:   
 /path/to/virtualenv/lib/python2.7/site-packages/django/db/models/base.py 
in __hash__, line 485
Python Executable:  /usr/bin/python
Python Version: 2.7.8 


In looking online, the one post I found that might be related is:

http://stackoverflow.com/questions/26081146/django-1-7-passing-around-unsaved-instances-throws-unhashable-exception

But in my case, while there is a signal associated with Event (on save, it 
looks up related Event Presenters, creates a string list of their names, 
then places that string in a field in the Event), it isn't anywhere in the 
stack trace for the error (below).

Initially, if anyone could help me figure out if this is a behavior that 
has changed in django versus one that might be related to my code, I'd 
appreciate it.  I tried disabling all the signals in my application (there 
are 4 - I removed them from my code-base entirely, then rebooted the server 
to make sure apache and wsgi were looking at the current code) and the 
problem persisted.

I honestly was surprised that it used to work, am trying to figure out what 
to tell the user.  For now, "Save as new" where one does not remove any 
Event_Dates works, so I advised the user to just do that, then update dates 
as needed in the new record.

Any help will be greatly appreciated.

Thanks,

Jon

==
stack trace:
==

Traceback:
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response
  111. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in wrapper
  584. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view
  105. response = view_func(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/views/decorators/cache.py"
 
in _wrapped_view_func
  52. response = view_func(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/sites.py" 
in inner
  204. return view(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in change_view
  1457. return self.changeform_view(request, object_id, form_url, 
extra_context)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapper
  29. return bound_func(*args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view
  105. response = view_func(request, *args, **kwargs)
File 
"/path/to/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py" 
in bound_func
  25. return func.__get__(self, type(self))(*args2, 
**kwargs2)
File 

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

2014-10-13 Thread Jonathan S
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.


HTML 5 input

2014-10-01 Thread Robert Jonathan Šimon
Is there an upside downs of using new HTML inputs? Why is Django using old 
"type="text"" in field DateTimeField, if Django can use 
"type="datetime-local"". So why use old and obsolete way? I am just curious.

-- 
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/a1fe0a0b-3491-4071-9fd8-1b2858ff3195%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: display the elements from a database in a forms

2014-09-18 Thread Jonathan Pentecost
Are you using Django models?

On Thursday, 18 September 2014 02:36:53 UTC+10, Devin Cky wrote:
>
>
> 2 months ago yes !! please i need your help .. it's very importante for 
> me !!!
>

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


Re: Writing your first Django App Part 1

2014-09-02 Thread Jonathan Querubina
Just tupe in. Do not worry. 

Is just for learning about the shell and its power

Sent from my iPhone

> On Sep 2, 2014, at 20:07, Max Nathaniel Ho  wrote:
> 
> I'm following the instructions in the tutorial but am stuck at this part.
> 
> We are told to type in "python manage.py shell" and explore the database API. 
> 
> Thereafter there is a chunk of code that is presented. 
> 
> Am I supposed to type it into my Command Prompt box, and when I do, it will 
> be saved automatically? 
> 
> Where can I find the codeos so that I edit the codes in the future?
> 
> 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/7c4092e5-e8d4-4d15-8065-0f8139d0743f%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/F1D9152A-339E-4169-A51B-6CEBFCDBC816%40me.com.
For more options, visit https://groups.google.com/d/optout.


Re: hosting django app

2014-08-22 Thread Jonathan Querubina
dreamhost.com

Sent from my iPhone

> On Aug 22, 2014, at 05:25, ngangsia akumbo  wrote:
> 
> my boss uses php to build web apps
> 
> he is n9ot very convince that django can be very cheap in hosting as php.
> 
> is there any way i can host a django app whic is as cheap as php?
> -- 
> 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/30d329d4-04c6-46cb-bc9a-76844e15d90a%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/F99A6567-922B-43CE-B9E5-1EA2F2049D35%40me.com.
For more options, visit https://groups.google.com/d/optout.


Re: urls not maching

2014-07-13 Thread Jonathan Querubina
It seems tha you are using blog// (two slashes) on the url. Try blog/

Sent from my iPhone

> On Jul 13, 2014, at 6:52, ngangsia akumbo  wrote:
> 
> 
> 
> Here is the similar probe
> 
> views File
> # Create your views here.
> from blog.models import Post
> from django.shortcuts import render_to_response
> from django.template import RequestContext
> 
> def news_index(request):
> posts = Post.objects.all().order_by('published_date')
> context = {'posts': posts}
> return render_to_response('index.html', context, 
> context_instance=RequestContext(request))
> 
> 
> def news_detail(request, blogslug):
> posts = Post.objects.get(slug=blogslug)
> context = {'posts': posts}
> return render_to_response('news_detail.html', context, 
> context_instance=RequestContext(request))
> 
> Model File
> 
> from django.db import models
> 
> # Create your models here.
> 
> class Reporter(models.Model):
> name = models.CharField(max_length=60, blank=True)
> tell = models.IntegerField(blank=True, null=True)
> location = models.CharField(max_length=50, blank=True, null=True)
> address = models.TextField(max_length=250)
> 
> 
> class Post(models.Model):
> title = models.CharField(max_length=100)
> slug = models.SlugField(unique=True)
> published_date = models.DateTimeField(auto_now_add=True)
> image = models.ImageField(upload_to='static/blog')
> content = models.TextField()
> repoter = models.ForeignKey(Reporter)
> 
> 
> def __unicode__(self):
> return self.title
> 
> PROJECT/URLS
> 
> from django.conf.urls import patterns, include, url
> 
> #enable the admin:
> from django.contrib import admin
> admin.autodiscover()
> 
> urlpatterns = patterns('',
>
> url(r'^blog/', include('blog.urls')),
> url(r'^admin/', include(admin.site.urls)),
> )
> 
> 
> APP/URL
> from django.conf.urls import patterns, url
> from blog import views
> 
> urlpatterns = patterns('',
> 
> url(r'^$', views.news_index, name='news_index'),
> 
> WHEN I TYPE 127.0.0.1:8000/blog it outputs the first url in this file as a 
> series of links.
> url(r'^(?P\d+)/$', views.news_detail, name='news_detail'),
> When i clik on the links this second url breaks down, giving me the error 
> below
> 
> )
> 
> 
> Page not found (404)
> 
> Request Method:   GET
> Request URL:  http://127.0.0.1:8000/blog//
> Using the URLconf defined in rango.urls, Django tried these URL patterns, in 
> this order:
> 
> ^blog/ ^$ [name='news_index']
> ^blog/ ^(?P\d+)/$ [name='news_detail']
> ^admin/
> The current URL, blog//, didn't match any of these.
> 
> You're seeing this error because you have DEBUG = True in your Django 
> settings file. Change that to False, and Django will display a standard 404 pa
> 
> 
> Please i really need help 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/e7a715a2-252f-4db7-ad6d-ce1aa721916c%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/2C3BF0E3-21B7-48D4-B6A7-9BF83EB7A4DC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: MySQL-python on ubuntu?

2014-07-09 Thread Jonathan Querubina
Do

apt-get install python-dev
apt-get install libmysqlclient-dev

And then

apt-get install python-mysqldb



On Jul 9, 2014, at 9:57 AM, François Schiettecatte  
wrote:

> Hi
> 
> I am installing django on Ubuntu and have a question about installing 
> MySQL-python?
> 
> I know I can get install it on CentOS/Fedora/Red Hat with this:
> 
>   yum -y install MySQL-python
> 
> but I cant find the MySQL-python package on apt-get? Is it in there under a 
> different name? I can find 'python-mysqldb' but not sure if it is the same?
> 
> Any suggestions greatly appreciated.
> 
> Thanks
> 
> François
> 
> -- 
> 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/08F54026-8F7B-4BA2-A805-2F5AA9F7D4CC%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/AE561199-5610-43BF-9695-A4CD9AFCE404%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: User related objects

2014-07-02 Thread Jonathan Querubina
My problem is doing this on django-admin.

Thanks!

On Jul 2, 2014, at 8:31 AM, Lachlan Musicman <data...@gmail.com> wrote:

> There are a couple of ways to do it, filtered queries are the obvious solution
> 
> https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters
> 
> But it would require that your model have either a group or owner
> permission set.
> 
> (eg
> class MyModel(models.Model):
>   permission_level = ForeignKey(PermissionGroup)
> or
>   owner = ForeignKey(User)
> )
> 
> This has some good examples too
> 
> http://www.django-rest-framework.org/api-guide/permissions
> 
> 
> cheers
> L.
> 
> 
> On 2 July 2014 21:21, Jonathan Querubina <john.chro...@gmail.com> wrote:
>> Hi guys,
>> 
>> I need to  customize my admin to show only the data related to the user who
>> inserted.
>> 
>> Example: When a user log in, the admin shows only the posts inserted by this
>> user.
>> 
>> AFAIK, django only set permissions my model, not by objects.
>> 
>> Is there a way (or a pip package) to implement this?
>> 
>> Thanks!
>> 
>> 
>>  Att//
>> 
>> --
>> 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/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> -- 
> The idea is that a beautiful image is frameable. Everything you need
> to see is there: It’s everything you want, and it’s very pleasing
> because there’s no extra information that you don’t get to see.
> Everything’s in a nice package for you. But sublime art is
> unframeable: It’s an image or idea that implies that there’s a bigger
> image or idea that you can’t see: You’re only getting to look at a
> fraction of it, and in that way it’s both beautiful and scary, because
> it’s reminding you that there’s more that you don’t have access to.
> It’s now sort of left the piece itself and it’s become your own
> invention, so it’s personal as well as being scary as well as being
> beautiful, which is what I really like about art like that.
> ---
> Adventure Time http://theholenearthecenteroftheworld.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/CAGBeqiM%2B5Eb8LxUv8N7cW7st8jesJ8Ec-m0wMj8WJAi3JC1YwA%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/7F5940A4-31FF-474D-AC18-2430B3688213%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: User related objects

2014-07-02 Thread Jonathan Querubina
Is there a way to set the ForeignKey(User) or ForeignKey(PermissionGroup) 
automatically by the logged user?

On Jul 2, 2014, at 8:31 AM, Lachlan Musicman <data...@gmail.com> wrote:

> There are a couple of ways to do it, filtered queries are the obvious solution
> 
> https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters
> 
> But it would require that your model have either a group or owner
> permission set.
> 
> (eg
> class MyModel(models.Model):
>   permission_level = ForeignKey(PermissionGroup)
> or
>   owner = ForeignKey(User)
> )
> 
> This has some good examples too
> 
> http://www.django-rest-framework.org/api-guide/permissions
> 
> 
> cheers
> L.
> 
> 
> On 2 July 2014 21:21, Jonathan Querubina <john.chro...@gmail.com> wrote:
>> Hi guys,
>> 
>> I need to  customize my admin to show only the data related to the user who
>> inserted.
>> 
>> Example: When a user log in, the admin shows only the posts inserted by this
>> user.
>> 
>> AFAIK, django only set permissions my model, not by objects.
>> 
>> Is there a way (or a pip package) to implement this?
>> 
>> Thanks!
>> 
>> 
>>  Att//
>> 
>> --
>> 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/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> -- 
> The idea is that a beautiful image is frameable. Everything you need
> to see is there: It’s everything you want, and it’s very pleasing
> because there’s no extra information that you don’t get to see.
> Everything’s in a nice package for you. But sublime art is
> unframeable: It’s an image or idea that implies that there’s a bigger
> image or idea that you can’t see: You’re only getting to look at a
> fraction of it, and in that way it’s both beautiful and scary, because
> it’s reminding you that there’s more that you don’t have access to.
> It’s now sort of left the piece itself and it’s become your own
> invention, so it’s personal as well as being scary as well as being
> beautiful, which is what I really like about art like that.
> ---
> Adventure Time http://theholenearthecenteroftheworld.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/CAGBeqiM%2B5Eb8LxUv8N7cW7st8jesJ8Ec-m0wMj8WJAi3JC1YwA%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/E662808C-4910-4113-9270-1351D3765AE4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


User related objects

2014-07-02 Thread Jonathan Querubina
Hi guys,

I need to  customize my admin to show only the data related to the user who 
inserted.

Example: When a user log in, the admin shows only the posts inserted by this 
user.

AFAIK, django only set permissions my model, not by objects.

Is there a way (or a pip package) to implement this?

Thanks!


 Att//

-- 
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/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


TDD

2014-05-31 Thread Jonathan Querubina
Guys,

Could anyone send me a link for a good tutorial on django TDD?

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/21274350-53F1-489B-8546-159C6FF7ED10%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i get all values of a field

2014-05-23 Thread Jonathan Querubina
Hi dota and java,

If your model for the categories is Category, you would use:

Category.objects.all()

Sent from my iPad

> On May 23, 2014, at 23:23, dotaandj...@gmail.com wrote:
> 
> i can't find a more effective method from the documentation,but thank you all 
> the same
> 
> 在 2014年5月23日星期五UTC+8下午11时12分13秒,sacrac写道:
>> 
>> Hi, you read the documentation? 
>> https://docs.djangoproject.com/en/1.6/ref/models/querysets/
>> 
>> 
>>> On Fri, May 23, 2014 at 6:36 AM,  wrote:
>>> In Models i declare Novel: name,category
>>> table structure:
>>> ---
>>> id|   name   |category
>>> ---
>>> 
>>> 
>>> now i want to get all category,but i have no idea,who can help me?
>>> 
>>> my english is poor,please don't joke me
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to django-users...@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/27a36b70-7f89-4a02-97d5-a5e27789068e%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/17e7d1fb-b004-4141-b30b-7578fcf72c2e%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/4800DB60-6DD7-43A1-9B1F-2E518C56242F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial to deploy (with install instructions) = django+gunicorn+nginx

2014-05-23 Thread Jonathan Querubina
I have tryied a lot of them, and this one was the salvation

http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

Thanks Rob!

On May 23, 2014, at 12:17 PM, carlos <crocha09...@gmail.com> wrote:

> Hi, Digital Ocean have many tutorial 
> begginner : 
> https://www.digitalocean.com/community/articles/how-to-deploy-a-local-django-app-to-a-vps
> advanced: 
> https://www.digitalocean.com/community/articles/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn
> 
> Cheers
> 
> 
> On Fri, May 23, 2014 at 8:04 AM, Rob Skidmore <robskidmor...@gmail.com> wrote:
> Found this after a digging for a bit. Might help.
> 
> http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
> 
> 
> On Friday, May 23, 2014 4:36:23 AM UTC-6, Jonathan Querubina wrote:
> Hi guys, i am on my first deploy and loosing my hair over this. 
> 
> Could anyone send me a tutorial on how to make this deploy? 
> 
> I am on DigitalOcean, but their tutorial doesnt work, even if i use all the 
> same configuration, virtualenv names and so on... 
> 
> Thanks guys! 
> 
> 
> -- 
> 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/050612a2-c67b-4835-8a04-7bcd269b831d%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/CAM-7rO2fS-de9uxjg2rbQ2JqmCBuUmyzG8pmZ%3D5sw4uX%2BxGReQ%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/27FD68FB-B805-47C8-A793-5C8548E7C297%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Tutorial to deploy (with install instructions) = django+gunicorn+nginx

2014-05-23 Thread Jonathan Querubina
Hi guys, i am on my first deploy and loosing my hair over this.

Could anyone send me a tutorial on how to make this deploy?

I am on DigitalOcean, but their tutorial doesnt work, even if i use all the 
same configuration, virtualenv names and so on...

Thanks guys!

-- 
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/1AEC575B-8FDF-4CB2-8F36-27B9054F61AD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to connect Django to Cassandra Data base?

2014-05-09 Thread Jonathan Baker
To build upon Babatunde's answer, you can find more information here:
https://code.djangoproject.com/wiki/NoSqlSupport


On Fri, May 9, 2014 at 12:57 PM, Babatunde Akinyanmi
<tundeba...@gmail.com>wrote:

> You have to search google for a third party cassandra backend app as
> Django does not support nosql by default.
> On 9 May 2014 17:56, "youssef simo" <youssef.aitya...@gmail.com> wrote:
>
>> I have a project witch i have to develop with Django using Cassandra data
>> base, i looked in documentation but there is just docs for mysql, sklite
>> and postgres database not for Cassandra. I am looking for a sample way to
>> connect Django to Cassandra:
>>
>> I know i have to set the database config in file setting.py:
>>
>>
>> "ENGINE": "django.db.backends.cassandra",
>> "NAME": "test",
>> "USER": "",
>> "PASSWORD": "",
>> "HOST": "127.0.0.1",
>>
>> but it throws me an error: Error was: No module named
>> django_cassandra.base
>>
>> Is there any one can help me ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/50464f28-0b2b-49ed-982c-b71715cda2f2%40googlegroups.com<https://groups.google.com/d/msgid/django-users/50464f28-0b2b-49ed-982c-b71715cda2f2%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/CA%2BWjgXMZVJvnpp6%2B46qTpaCeuxbvdokep_vYURkrie-Sc2zPFQ%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CA%2BWjgXMZVJvnpp6%2B46qTpaCeuxbvdokep_vYURkrie-Sc2zPFQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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/CAPMFOb4CzCYoQ7X3pGjhkpPoxgqN8pTkgfzqwZ%3DrdAro0rU9DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Registration in 1.8

2014-05-09 Thread Jonathan Baker
With the official Django release at 1.6.4, I wouldn't assume that third
party packages are 1.7.x compliant, much less 1.8.x. (actually, I haven't
even heard of 1.8 yet, and it's not on
https://github.com/django/django/releases). Getting the hang of the ins and
outs of 1.7.x is a great idea, but Django will always be ahead of the
third-party packages developed on top of it. Some third-party maintainers
wait for official releases, anyway.

JDB


On Fri, May 9, 2014 at 11:33 AM, erip  wrote:

> Hello all,
>
> I'm new to Django.
>
> Really new.
>
> Like... 3 days new.
>
> I already completed the Poll app, but I wanted to be a bit more
> adventurous with my Django-ing, so I tried to play around with the
> django-registration and django-authentication stuff. However, I'm having a
> hell of a time in 1.8 getting it to work properly.
>
> Does anyone have some resources? I can also send my current code if anyone
> cares enough to help.
>
> Thanks all,
> erip
>
> --
> 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/2c8e1918-958f-4770-bdc1-bf223d605339%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/CAPMFOb62YN%2BmmziOmqBGHqn_Tt%2BWpKkRuTSWo-bPE57EgHAc0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Hide default permission in Django admin form

2014-05-06 Thread Robert Jonathan Šimon
I looked up the answer 
(http://stackoverflow.com/questions/6062655/remove-or-hide-default-permissions-from-django),
 
it worked, but suddenly it stopped working, i am not sure, what i did or if 
I reinstaled something. I have this solution:

from django.contrib import admin
from django.contrib.auth.models import Permission
from django.contrib.auth.models import User, Group
from django.contrib.auth.admin import GroupAdmin, UserAdmin
from django.contrib.auth.forms import UserChangeForm

#
# In the models listed below standard permissions "add_model", 
"change_model"
# and "delete_model" will be created by syncdb, but hidden from admin 
interface.
# This is convenient in case you use your own set of permissions so the list
# in the admin interface wont be confusing.
# Feel free to add your models here. The first element is the app name 
(this is
# the directory your app is in) and the second element is the name of your 
model
# from models.py module of your app (Note: both names must be lowercased).
#
MODELS_TO_HIDE_STD_PERMISSIONS = (
("auth", "permission"),
("auth", "group"),
("auth", "user"),
("contenttypes", "contenttype"),
("sessions", "session"),
("sites", "site"),
("admin", "logentry"),
("mainpage","novinkymodel"),
("mainpage", "komentarknovinkymodel"),
("mainpage", "clovek"),
("mainpage", "ucitel"),
("mainpage", "trida"),
("mainpage", "predmety"),
("mainpage", "administrator"),
("mainpage", "student"),
("mainpage", "rodic"),
("kalendar", "udalost"),
("fotogalerie", "slozka"),
("fotogalerie", "fotka"),
("south", "migrationhistory")
)

def _get_corrected_permissions():
perms = Permission.objects.all()
for app_name, model_name in MODELS_TO_HIDE_STD_PERMISSIONS:
perms = perms.exclude(content_type__app_label=app_name, 
codename='add_%s' % model_name)
perms = perms.exclude(content_type__app_label=app_name, 
codename='change_%s' % model_name)
perms = perms.exclude(content_type__app_label=app_name, 
codename='delete_%s' % model_name)
return perms

class MyGroupAdminForm(forms.ModelForm):

class Meta:
model = Group

permissions = forms.ModelMultipleChoiceField(
_get_corrected_permissions(),
widget=admin.widgets.FilteredSelectMultiple(('permissions'), False),
help_text = 'Hold down "Control", or "Command" on a Mac, to select 
more than one.'
)

class MyGroupAdmin(GroupAdmin):

form = MyGroupAdminForm

class MyUserChangeForm(UserChangeForm):

user_permissions = forms.ModelMultipleChoiceField(
_get_corrected_permissions(),
widget=admin.widgets.FilteredSelectMultiple(('user_permissions'), 
False),
help_text = 'Hold down "Control", or "Command" on a Mac, to select 
more than one.'
)

class MyUserAdmin(UserAdmin):

form = MyUserChangeForm

admin.site.unregister(Group)
admin.site.register(Group, MyGroupAdmin)
admin.site.unregister(User)
admin.site.register(User, MyUserAdmin)



I am using Django 1.6.4 and Python 3.4. This code is in my app and file 
admin.py

-- 
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/2f5c18da-d3ef-45d9-9e30-fb4f8837fb47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can I set up Debian x86_64 so a Django project sees django.contrib.staticfiles?

2014-04-23 Thread Christos Jonathan Seth Hayward
I have a new Debian VPS, and a Django project that I am trying to deploy is
not seeing django.contrib.staticfiles.*. Doing a "pip install
django-staticfiles" has not observably changed things.

What is the best way to have things running well enough that such Django
projects will run?

Thanks,


-- 
[image: Christos Jonathan Seth Hayward] <http://jonathanscorner.com/>
Christos Jonathan Seth Hayward, an Orthodox Christian author.

Amazon / Kindle <http://amazon.com/author/cjshayward> • *Author
<http://cjshayward.com/>* • Author Bio <http://jonathanscorner.com/author/>
 • *Email <christos.jonathan.hayw...@gmail.com>* •
Facebook<http://www.facebook.com/christos.jonathan.hayward>
 • Fan Page <http://fan.cjshayward.com/> • Google
Plus<http://jonathanscorner.com/plus>
 • LinkedIn <http://www.linkedin.com/in/jonathanhayward> • *Professional
<http://jonathanhayward.com/>* • Twitter<http://twitter.com/JonathansCorner>
 • *Web <http://jonathanscorner.com/>* • What's
New?<http://jonathanscorner.com/>
If you read just *one* of my books, you'll want *The Best of Jonathan's
Corner <http://www.amazon.com/dp/1478219912>*.

-- 
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/CAE6_B5SMaj3tbjbz5-JKMkhZJ%3DGLYE1-RpkxAENKVRmx_fVwZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ajax post problem

2014-04-17 Thread Jonathan Querubkna
Or:

var dataForm = new FormData( $("form")[0] );

That way you can send even file fields. Serialize do not support file fields 
AFAIK

Jonathan
Diretor de Tecnologia
+55(12)98864-1594

Sent from my iPhone

> On Apr 17, 2014, at 17:25, Joseph Mutumi <jjmut...@gmail.com> wrote:
> 
> You could try using $("form").serialize() to get the form inputs in
> the ajax data. But from the URL it looks like your HTML is somehow
> rendering badly. The form action is coming out as '/newmarkets/search/
> method='
> 
> Kind regards
> 
>> On 4/17/14, willyhakim <willyh...@gmail.com> wrote:
>> Hi everyone?
>> 
>> I am trying to use ajax to do the following
>> 
>> 1)User inputs a number.
>> 2) I use ajax to return a query list into the same page.
>> 
>> Here is my code
>> and I keep getting this error
>> 
>> Page not found (404)  Request Method: GET  Request URL:
>> http://127.0.0.1:8000/newmarkets/search/%20method=?csrfmiddlewaretoken=VkKvStx1qGZOM1YxzM8xenGDbYRBnMPA
>> 
>> 
>> Using the URLconf defined in exportAbroad.urls, Django tried these URL
>> patterns, in this order:
>> 
>>   1. ^$ [name='index']
>>   2. ^about/$ [name='about']
>>   3. ^pricing/$ [name='pricing']
>>   4. ^market_research_tool/$ [name='market_research_tool']
>>   5. ^newmarkets/ ^$ [name='index']
>>   6. ^newmarkets/ ^search/$ [name='search']
>>   7. ^admin/
>>   8. ^accounts/
>>   9. ^static/(?P.*)$
>> 
>> The current URL, newmarkets/search/ method=, didn't match any of these.
>> 
>> *views.py*
>> def index(request):
>> context = RequestContext(request)
>> return render_to_response('newmarkets/index.html', context)
>> 
>> def search(request):
>> if request.is_ajax() and request.method=='POST':
>> UserHSnumber = request.POST['UserHSnumber']
>> country_list = Imports.objects.filter(hs_number= UserHSnumber)[1:11]
>> hsdescript = Products.objects.get(hs_number=UserHSnumber)
>> data = {'markets': country_list, 'hsdescript': hsdescript}
>> mimetype='application/json'
>> else:
>> raise Http404
>> return HttpResponse(json.dumps(data), mimetype)
>> 
>> 
>> *HTML*
>> 
>> {%block body_block%}
>> 
>> 
>>  What is your product's H.S number?
>> 
>>
>> {% csrf_token %}
>>  
>>  Submit
>>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> *ajax.js*
>> 
>> 
>> 
>> 
>> 
>> *$(document).ready(function() { $('#hs').click(function(){ $.ajax({
>> type:"POST", url:"/newmarkets/search/",
>> data:{"userHSnumber":$("#search").val()}, dataType: "json",
>> success:function(data){ alert(data.message); } }); });// CSRF code
>> function getCookie(name) {var cookieValue = null;var i =
>> 0;if (document.cookie && document.cookie !== '') {var
>> cookies = document.cookie.split(';');for (i; i <
>> cookies.length; i++) {var cookie =
>> jQuery.trim(cookies[i]);// Does this cookie string begin
>> with the name we want?if (cookie.substring(0, name.length +
>> 
>> 1) === (name + '=')) {cookieValue =
>> decodeURIComponent(cookie.substring(name.length + 1));
>> break;}}}return cookieValue;
>> 
>> }var csrftoken = getCookie('csrftoken');function
>> csrfSafeMethod(method) {// these HTTP methods do not require CSRF
>> protectionreturn (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));}
>> 
>>  $.ajaxSetup({crossDomain: false, // obviates need for sameOrigin
>> testbeforeSend: function(xhr, settings) {if
>> (!csrfSafeMethod(settings.type)) {
>> xhr.setRequestHeader("X-CSRFToken", csrftoken);}}
>> }); });*
>> 
>> 
>> 
>> 
>> --
>> 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/2132e3e5-9795-416d-9306-0b09a1698c6b%40googlegroups.com.
>> For mo

STATIC and MEDIA

2014-03-29 Thread Jonathan Querubina
Guys

What is the best way to configure and make accessible via URL the STATIC and 
the MEDIA uri?

I can`t seem to find a good way, and get so many errors for the both being 
equal.

Can someone send me an example of this configs?

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/7C03A25B-2634-4FDD-A4B2-B6F13CEA699D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Multiupload Field

2014-03-15 Thread Jonathan Querubina
Camilo,

I can`t use inline (i tryied) because the user has to select file by file, not 
all the same time

On Mar 15, 2014, at 1:58 PM, Camilo Torres <camilotorr...@gmail.com> wrote:

> 
> On Saturday, March 15, 2014 11:18:05 AM UTC-4:30, Jonathan Querubina wrote:
> how can i have a Multiupload Field on a Model for the Django Admin? 
> 
> I Found this: https://github.com/TND/django-files-widget 
> Hello,
> 
> I don't fully understand your needs, but may be you can use inlines:
> https://docs.djangoproject.com/en/1.6/ref/contrib/admin/#inlinemodeladmin-objects
> 
> Regards,
> Camilo
> 
> -- 
> 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/4d360c3b-b977-4f6c-b626-1e5bb238a3ea%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/98A9E3A3-A659-4B90-A97F-B9BCBFA8F76D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Admin Multiupload Field

2014-03-15 Thread Jonathan Querubina
Hi guys,

Maybe this is a noob question, but how can i have a Multiupload Field on a 
Model for the Django Admin?

I Found this: https://github.com/TND/django-files-widget

And sounds amazing, but i can`t get Pillow installed on my mac (10.9 / Xcode 
5.1)

Any of you have this problem?

There`s an alternative?

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/66E5D0D6-9CE8-4118-B485-7F60F19B0B05%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-14 Thread Jonathan Baker
Does that mean that the default="" functionality is implemented by the ORM,
instead of in the database layer?


On Fri, Mar 14, 2014 at 5:16 PM, Shawn Milochik <shawn.m...@gmail.com>wrote:

> No, no syncdb required. The default applies to newly-created instances,
> not existing ones.
>
> --
> 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/CAOzwKwH-5UNR7ajWb%2B-w%3DepQRSUooEk%3DA-gwAjAhE8vtUT%3DA_Q%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAOzwKwH-5UNR7ajWb%2B-w%3DepQRSUooEk%3DA-gwAjAhE8vtUT%3DA_Q%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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/CAPMFOb7Go_gbCZFJVE4T5Mt4t8D3F1w-g5%2BfGKnRuQkgqGdvnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Timeseries Data Collection as a Reusable App

2014-03-12 Thread Jonathan Morgan
On the model side, to facilitate a generic visualization layer, you could 
also consider an abstract parent class where you standardize time series 
information that isn't the data.

For my time series data, I have this:

https://github.com/jonathanmorgan/django_time_series

I built a few django time-series models, then started to abstract out the 
parts that were the same across the models.  This includes:

- a Time_Period model to hold a set of defined time periods, if your time 
periods are more complex than simply time increments (for example, I did 
time-series of reddit activity within subreddits, broken out by hour, and 
also categorized into being within 14 days before and after a certain date 
- so before-1, before-2, before-3, ..., after-1, after-2, after-3, ...).

- an AbstractTimeSeriesDataModel that includes basic information on a time 
period (start and end datetime, time period index, a separate aggregate 
index in case you have something like my before and after, and so have 
after-1, which is actually number 327 overall, etc.), plus the ability to 
set and hold ten different generic filters (so you can mark a given time 
period as having contained links to news, for example, using filter_1, and 
store a count of matches within the period in match_count_1, or use 
filter_2 and match_count_2 to note a particular time-series period had X 
posts related to a particular topic), and base methods for doing a lookup 
and retrieving an instance.


Then, for a particular data set, you extend this abstract class and add in 
columns you want to track within a given time period 
(see https://github.com/jonathanmorgan/reddit_data for an example - the 
model Subreddit_Time_Series_Data is a much more complete example than 
Domain_Time_Series_Data).

An abstract base class like this would give you the common elements of 
time-series data on which you could start to build a generic visualizer, 
and also then give you the flexibility to add data as needed.  You could 
probably just use a simple naming convention to reveal added columns as 
data ("tsdata_").

You could also probably add generic data fields to this abstract model, but 
it didn't seem to be useful for me when I built this, since I was capturing 
many fields per time series, and I kept having to add fields as our 
research led to more questions.


Also worth noting, if you go with a relational database (I personally like 
relational databases for complex, relational data) and might have millions 
of rows, postgresql is much easier to get reasonable performance out of 
than mysql.

On Tuesday, March 11, 2014 10:42:24 AM UTC-5, RLange wrote:
>
> I'm currently working on an app for browsing and visualizing time-series 
> data. Each point of time-series data may be a mix of Strings, Floats, and 
> Ints. In my current design, I have a separate model for each of my data 
> types, and I have been writing a new view for each one. In other words, my 
> app is strongly coupled to the structure of the models. *Ideally*, my app 
> would use some sort of generic abstraction of a time-series model such that 
> adding new types of data is a simple settings.py configuration, and the 
> views for browse/visualize would be free. 
>
> I see a few possible avenues to accomplish this. None seems clearly better 
> than any other. My database is MySQL. Any feedback is helpful!
>
>1. Use django-mutant (or equivalent) to make new models on the fly. 
>However I would really only need to make models at initialization time, 
> not 
>at runtime.
>2. Instead of a column for each dimension of the data, use a Blob or 
>Text type for headers and one for data (a hack for variable-length data. 
>makes intelligent queries nearly impossible)
>3. Forget about pluggability and continue developing under the 
>assumption that this app will never leave "in-house"
>
>
> This is a deliberately vague question since it is about a vague topic: 
> abstraction. I can provide more details about my specific use case, but 
> that seems to defeat the purpose of writing a generic app.
>
> Thank you,
> RLange
>

-- 
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/e44b8c7e-b0bf-4942-9567-537e4b2d1e7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: URL Namespaces

2014-03-05 Thread Jonathan Baker
Much like module namespacing, they allow you to group subitems in more
logical and descriptive ways while preventing naming collisions. So, if a
Django project has a blog, with a list of Posts at /blog/posts/, a sensible
url name for that pattern might be "post_list" (and using url names in your
application is a good thing). Now, say the same project also exposes a
public API, which includes includes Posts at the endpoint
/api/v1/blog/posts/. Since using url names is a good thing, what would you
name the API endpoint while not clobbering the already-defined 'post_list'
url name? Sure, something like 'api_post_list' might be acceptable for the
endpoint I just described, but I prefer the namespaced version
'api:post_list' for a few reasons:

1) You can define a namespace one time when you include a collection of URL
patterns into the top-level urls.py
2) Because you only have to do this once, changing namespaces is a matter
of changing one thing in one place
3) each url pattern in the namespace url pattern collection has no idea
it's even been namespaced, which means you can go on defining the url names
without having to remember some convention for preventing naming collisions
(since django takes care of the for you by following the namespace:url_name
pattern across the board).

Admittedly, this isn't very useful on small projects, but if you encounter
a situation like the one above (or your project grows very large), then the
potential for naming collisions very quickly becomes a reality.

Hope this helps,
Jonathan


On Wed, Mar 5, 2014 at 4:25 AM, anubhav joshi <anubhav9...@gmail.com> wrote:

> Can anyone explain how URL Namespaces work in django.
> Some examples would be great.
> (Apart from those in the docs.)
>
> Regards,
> Anubhav Joshi
>
> --
> 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/1d59cdb2-d375-493d-88ae-da2ece757eee%40googlegroups.com<https://groups.google.com/d/msgid/django-users/1d59cdb2-d375-493d-88ae-da2ece757eee%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPMFOb68DHThkFMW2mPtNPLW2cs4pA4XOVcYi-PygPpWCvgkAw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Ajax Request on Admin Edit Form

2014-03-05 Thread Jonathan Querubina
Hi guys.

How can i edit the Admin Default Edit Form on django to insert my custom JS on 
the page?

I mean, when i am editing a model, i need to insert some JS code on it

Is this possible?

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/26F9D3F2-917C-44A9-B926-C4185C74EC4F%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble with Django in production server.

2014-03-01 Thread Jonathan D. Baker
Instead of hard-coding paths, check out os.path, os.abspath and os.sep (and the 
rest of the os module) for such needs. I usually declare a PROJECT_ROOT var at 
the top of my settings.py using the aforementioned os module, and then hang 
paths (like your db path) off of that instead of building each path 
individually.

Glad you figured it out.

Sent from my iPhone

> On Mar 1, 2014, at 5:41 PM, Omar Acevedo  wrote:
> 
> To see if it worked, and yes it did!
> So, I'm just having trouble with the paths.
> I'm using a virtual environment.
> So I guess I'll have to deal with the paths.
> Thank you a lot anyways!!! :)
> 
> 
>> On Sat, Mar 1, 2014 at 8:39 PM, Omar Acevedo  wrote:
>> I explicitly wrote '/home/catacafe/.env/env/lib/python2.7/db.sqlite3' in the 
>> NAME option of the DATABASES dictionary.
> 
> -- 
> 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/CAH_X0gMnjh%2BOy5AQC2rw_LtKEjnWU-YVY_yBH3AzTMoSP%2BCiXw%40mail.gmail.com.
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67FC5368-10B8-4534-A059-FE1CD467CB26%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble with Django in production server.

2014-03-01 Thread Jonathan Baker
Are you using multiple settings files, for example: dev.py, pro.py, etc.?
Are you sure that the settings file you're using is configured to use the
database on your production server?


On Sat, Mar 1, 2014 at 5:12 PM, Omar Acevedo <oma...@gmail.com> wrote:

> Yes!
>
>
> On Sat, Mar 1, 2014 at 8:11 PM, Jonathan Baker <
> jonathandavidba...@gmail.com> wrote:
>
>> When you ran the 'syncdb' management command, was 'auth_user' listed in
>> the output as a table that was created?
>>
>>
>> On Sat, Mar 1, 2014 at 3:52 PM, Omar Acevedo <oma...@gmail.com> wrote:
>>
>>> Hello people, I'm having an issue in/with Django, which is on a shared
>>> hosting, and I'm using virtualenv and fastcgi.  (<- saying this, just in
>>> case it helps in something)
>>>
>>> I'm getting
>>> "OperationalError at /admin/
>>> no such table: auth_user"
>>> after entering my credentials (username & pw) set when asked after
>>> running the syncdb.
>>> Yes, I created a project (django-admin.py startproject the_project),
>>>  then ran python manage.py syncdb.
>>> So it's supposed (which it says it does) to create the tables for the
>>> admin, but still, I'm getting that error when going to the admin through
>>> mydomain.com/admin.
>>>
>>> I'm a first-timer hosting a django app, so, what else I'm supposed to
>>> know, to do?
>>>
>>> When I put Debug to False (DEBUG = False) inside the settings.py file
>>> and my email in the ADMINS tuple (inside settings.py) I do get this error
>>> message to my email.
>>> Which is (I'm posting it, to see if someone can tell me what's going
>>> on.):
>>>
>>>  'HTTP_CONNECTION': 'close',
>>>  'HTTP_COOKIE': 'csrftoken=Ds5T9Lx4JLgO9m6vCu0EEeLX4tVHr7dH',
>>>  'HTTP_HOST': 'thisisnottherealdomain .com',
>>>  'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64)
>>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',
>>>  'HTTP_X_FORWARDED_FOR': '##.###.###.###',
>>>  'HTTP_X_REAL_IP': '##.###.###.###',
>>>  'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
>>>  'PATH_INFO': u'/',
>>>  'PATH_TRANSLATED': 'redirect:/dispatch.fcgi/',
>>>  'QUERY_STRING': '',
>>>  'REDIRECT_STATUS': '200',
>>>  'REDIRECT_UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>>>  'REDIRECT_URL': '/',
>>>  'REMOTE_ADDR': '##.###.###.###',
>>>  'REMOTE_PORT': '39403',
>>>  'REQUEST_METHOD': 'GET',
>>>  'REQUEST_URI': '/',
>>>  'SCRIPT_FILENAME': '/home/somename/public_html/dispatch.fcgi',
>>>  'SCRIPT_NAME': u'',
>>>  'SERVER_ADDR': '###.##.##.###',
>>>  'SERVER_ADMIN': 'webmaster @ thisisnottherealdomain .com',
>>>  'SERVER_NAME': 'thisisnottherealdomain .com',
>>>  'SERVER_PORT': '80',
>>>  'SERVER_PROTOCOL': 'HTTP/1.0',
>>>  'SERVER_SIGNATURE': '',
>>>  'SERVER_SOFTWARE': 'Apache',
>>>  'UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>>>  'wsgi.errors': >> 0x7f0b2868bf50>,
>>>  'wsgi.input': >> 0x7f0b2868bf90>,
>>>  'wsgi.multiprocess': False,
>>>  'wsgi.multithread': True,
>>>  'wsgi.run_once': False,
>>>  'wsgi.url_scheme': 'http',
>>>  'wsgi.version': (1, 0)}>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>>
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/3afc2a85-5bf1-4170-ace2-bd789babdb33%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>  --
>> 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/VXpy867egD8/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 we

Re: Trouble with Django in production server.

2014-03-01 Thread Jonathan Baker
When you ran the 'syncdb' management command, was 'auth_user' listed in the
output as a table that was created?


On Sat, Mar 1, 2014 at 3:52 PM, Omar Acevedo  wrote:

> Hello people, I'm having an issue in/with Django, which is on a shared
> hosting, and I'm using virtualenv and fastcgi.  (<- saying this, just in
> case it helps in something)
>
> I'm getting
> "OperationalError at /admin/
> no such table: auth_user"
> after entering my credentials (username & pw) set when asked after running
> the syncdb.
> Yes, I created a project (django-admin.py startproject the_project),  then
> ran python manage.py syncdb.
> So it's supposed (which it says it does) to create the tables for the
> admin, but still, I'm getting that error when going to the admin through
> mydomain.com/admin.
>
> I'm a first-timer hosting a django app, so, what else I'm supposed to
> know, to do?  
>
> When I put Debug to False (DEBUG = False) inside the settings.py file and
> my email in the ADMINS tuple (inside settings.py) I do get this error
> message to my email.
> Which is (I'm posting it, to see if someone can tell me what's going on.):
>
>  'HTTP_CONNECTION': 'close',
>  'HTTP_COOKIE': 'csrftoken=Ds5T9Lx4JLgO9m6vCu0EEeLX4tVHr7dH',
>  'HTTP_HOST': 'thisisnottherealdomain .com',
>  'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64)
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',
>  'HTTP_X_FORWARDED_FOR': '##.###.###.###',
>  'HTTP_X_REAL_IP': '##.###.###.###',
>  'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
>  'PATH_INFO': u'/',
>  'PATH_TRANSLATED': 'redirect:/dispatch.fcgi/',
>  'QUERY_STRING': '',
>  'REDIRECT_STATUS': '200',
>  'REDIRECT_UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>  'REDIRECT_URL': '/',
>  'REMOTE_ADDR': '##.###.###.###',
>  'REMOTE_PORT': '39403',
>  'REQUEST_METHOD': 'GET',
>  'REQUEST_URI': '/',
>  'SCRIPT_FILENAME': '/home/somename/public_html/dispatch.fcgi',
>  'SCRIPT_NAME': u'',
>  'SERVER_ADDR': '###.##.##.###',
>  'SERVER_ADMIN': 'webmaster @ thisisnottherealdomain .com',
>  'SERVER_NAME': 'thisisnottherealdomain .com',
>  'SERVER_PORT': '80',
>  'SERVER_PROTOCOL': 'HTTP/1.0',
>  'SERVER_SIGNATURE': '',
>  'SERVER_SOFTWARE': 'Apache',
>  'UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>  'wsgi.errors':  0x7f0b2868bf50>,
>  'wsgi.input':  0x7f0b2868bf90>,
>  'wsgi.multiprocess': False,
>  'wsgi.multithread': True,
>  'wsgi.run_once': False,
>  'wsgi.url_scheme': 'http',
>  'wsgi.version': (1, 0)}>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3afc2a85-5bf1-4170-ace2-bd789babdb33%40googlegroups.com
> .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPMFOb5PJn_uLvVYrDyBiwQ0Y97CGtL4YnxM8DDyASRLxKHXKA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django with rabbit (but without async celery) - can be done?

2014-02-25 Thread Jonathan Baker
Could you write a RESTful API in your Django project, and then issue POST
requests to that from a middleman script that the mq could communicate with?

JDB


On Tue, Feb 25, 2014 at 8:28 AM, Alon Nisser  wrote:

> I need to implement a quite simple Django server that server some http
> requests *and *listens to a rabbitmq message queue that streams
> information into the Django app (that should be written to the db). the
> data *must* be written to the db in a synchronized order , So I can't use
> the obvious celery/rabbit configuration.  I was told that there is no way
> to do this in the same Django project. since Django would listen to http
> requests on It's process. and It can't handle another process to listen for
> Rabbit - forcing me to to add Another python/django project for the
> rabbit/db writes part - working with the same models The http bound django
> project works with.. You can smell the trouble with this config from here.
> .. Any Ideas how to solve this?
>
> 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/794bf8ca-a15b-40da-97c2-b3a416a35fe0%40googlegroups.com
> .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPMFOb4ky-J0JCo2eU61wBR-CTiFpcATd5VMFtVM4GC0bv3DXw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Accessing a python function from a blog post stored in the db?

2014-02-25 Thread Jonathan Baker
This sounds like a good fit for an inclusion tag. Since you need a bit of
markup around the images for the slider functionality, it'd be nice to keep
that markup in a separate template so you could use the image slider in
multiple places like, say, a post detail page as well as a dashboard. Then,
anytime you wanted to create image slider, in your template you could
simply do something like:

{% load image_extras %}

...
{% image_slider post.image_set %}
...

Docs:
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#inclusion-tags

JDB


On Mon, Feb 24, 2014 at 11:39 PM, Dennis Marwood wrote:

> Hi. I am looking for some advice on the best way to approach the
> following:
>
> I am pulling my blog posts out of my db. Inside of the posts I want to use
> an image scroller ( http://cssdeck.com/labs/css3-image-slider ), but I
> don't want to write all of the boilerplate surrounding each image every
> time.
>
> The idea I have is a template filter but that just seems wrong. What's
> the proper way to handle this?
>
> Ideally, I would just add some bit in my post like css_slider({loc:
> loc_pic_1, desc: "blah blah"}, {loc: loc_pic_1, desc: "blah"}...)
>
> --
> 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/d38e2a00-5ae9-4e8e-8333-0677cc206a5e%40googlegroups.com
> .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPMFOb6iPJvUWGeLWkogmx5Bj4X22aNz8bN6pHSKqXm7hN-gyw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: API rest for https://docs.djangoproject.com/en/dev/intro/tutorial01/ help

2014-02-20 Thread Jonathan Baker
It appears that you're using the Django Rest Framework, and if that's the
case then you need to reference the section on serializer relations:
http://www.django-rest-framework.org/api-guide/relations


On Thu, Feb 20, 2014 at 3:53 PM, Antonio Villavicencio <apo...@gmail.com>wrote:

> I am trying just to do an API REST with the project of:
> https://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> specifically with the model of Question
>
> class Question(models.Model):
> question_text = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> class Choice(models.Model):
> question = models.ForeignKey(Question)
> choice_text = models.CharField(max_length=200)
> votes = models.IntegerField(default=0)
>
>
> I want to apply a serializer with question's choices but I don't know how
> to do it
>
> class QuestionSerializer(serializers.HyperlinkedModelSerializer):
> class Meta:
> model = Question
> fields = (*'id', 'question_text'*, ? )
>
>
> I need some suggestion to solve this problem.
>
> thanks in advance
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a2b02a3d-f5bf-4a78-b848-48b0e076d5f3%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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/CAPMFOb5f1VDmSk75sRAe6Egs%2BHb3h2zVyJ3KE6AOLJzBKei31Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django multiple model from one form submit

2014-02-19 Thread Jonathan Querubina
You can use an admin custom insert form

With stackedinline


Jonathan Querubina

Diretor de Tecnologia
+55(12)98864-1594
www.phocus.com.br

> On Feb 19, 2014, at 19:24, Henrique Oliveira <henriqueollive...@gmail.com> 
> wrote:
> 
> Hi there,
> 
> I have the model below:
> 
> class Ticket(models.Model):
> REAL = 'R'
> FREE = 'F'
> TYPES = (
> (REAL, 'Real'),
> (FREE, 'Free'),
>  )
>amount = models.DecimalField()
> user = models.ForeignKey(User)
> 
> 
> class Pick(models.Model):
> ticket_id = models.ForeignKey(Ticket)
> number = models.CharField(max_length=4)
> 
> Many Tickets can be created on the same submit depending on the ticket type.
> 
> how can do that
> 
> i have attached a mockup 
> 
> Cheers
> -- 
> 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/d3d1cdf8-0097-4323-9a4f-660dfc8c7b84%40googlegroups.com.
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/834BB0F1-AFC5-4C20-A222-32650E0A7DD0%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django + PostgresSQL. I'm a newbie.

2014-02-14 Thread Jonathan Querubina
And he is using gTranslate, for sure. Maybe he is not aware of what he wants... 

Віталій: Search Google First


Jonathan Querubina

Diretor de Tecnologia
+55(12)98864-1594
www.phocus.com.br

> On Feb 14, 2014, at 18:10, "C. Kirby" <mist...@gmail.com> wrote:
> 
> The topics you are asking about are all over Google. Please do a little work 
> before asking here. No one want to do your research for you, or re-type what 
> is already available to you.
> If you have searched google and don't understand a reference then you should 
> ask specifically about what you don't understand here.
> 
>> On Friday, February 14, 2014 1:42:18 PM UTC-6, Віталій Лисенко wrote:
>> As work in the Postgres Sql in Django. Give a link to the desired site or 
>> explain in detail.
> 
> -- 
> 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/5025cec6-d366-4412-a72c-94dcdc4198ea%40googlegroups.com.
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/466AC694-F7EE-48C3-A806-B4009C3F7DE2%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: is_valid

2014-02-14 Thread Jonathan Querubina
blank = True on the model field

On Feb 14, 2014, at 8:53 AM, fabricio  wrote:

> how do i django not validate some fields
> 
> -- 
> 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/8df99d36-44ea-43a8-ba34-8853ac5dd263%40googlegroups.com.
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7A824B9D-D052-4022-ADE3-5ABCA7FF046D%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Tutorial 5 - First Tests

2014-02-13 Thread Jonathan Baker
st database, so the following will be run against the existing database
>>>> and the output may differ slightly depending on what polls you already
>>>> created."
>>>>
>>>> That's from the section you linked to, and it clearly explains that a
>>>> test database will not be created. Two sections below that is
>>>> https://docs.djangoproject.com/en/1.6/intro/tutorial05/#t
>>>> esting-our-new-view which demonstrates how to create test cases that
>>>> inherit from TestCase that can be found and executed by the Django test
>>>> runner which will also handle creating the test database for you.
>>>>
>>>> JDB
>>>>
>>>>
>>>> On Thu, Feb 13, 2014 at 10:20 AM, Paul Sermon 
>>>> <pauls...@googlemail.com>wrote:
>>>>
>>>>> yes I am running through the manage.py shell (although initially I did
>>>>> not).
>>>>>
>>>>> I am doing the section: https://docs.djangoproject.com/en/1.6/intro/
>>>>> tutorial05/#the-django-test-client
>>>>> On the response.content line, I get back a line listing the polls made
>>>>> earlier.
>>>>>
>>>>> And I presume that is why the test from the next section fail, because
>>>>> they are picking up the entries from the database, rather than the test
>>>>> database.
>>>>>
>>>>> I am on windows 7, if that makes any difference.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thursday, February 13, 2014 2:58:37 PM UTC, jondbaker wrote:
>>>>>
>>>>>> Are you running your tests on the command line using:
>>>>>>
>>>>>> $ python manage.py test polls
>>>>>>
>>>>>> ...or are you trying to run them from a Python shell? It'd be helpful
>>>>>> if you could provide the internal link to the area of the page you linked
>>>>>> to that you're experiencing the failure at, as well as the output of the
>>>>>> error you're receiving and the command that causes it.
>>>>>>
>>>>>> JDB
>>>>>>
>>>>>>
>>>>>> On Thu, Feb 13, 2014 at 3:19 AM, Paul Sermon <pauls...@googlemail.com
>>>>>> > wrote:
>>>>>>
>>>>>>> This is the tutorial: https://docs.djangoproject.com/en/1.6/intro/
>>>>>>> tutorial05/
>>>>>>>
>>>>>>> I've followed the tutorials pretty much to the letter since tutorial
>>>>>>> one.
>>>>>>>
>>>>>>> Thanks for the help!
>>>>>>>
>>>>>>> -Paul
>>>>>>>
>>>>>>>
>>>>>>> On Wednesday, February 12, 2014 10:33:16 PM UTC, jondbaker wrote:
>>>>>>>
>>>>>>>> You're correct in thinking that tests use a test database that is
>>>>>>>> independent of your formally defined project database. Without knowing
>>>>>>>> exactly which Django tutorials you are referring to, I can only assume 
>>>>>>>> that
>>>>>>>> perhaps you:
>>>>>>>>
>>>>>>>> 1) Have defined initial_data.json fixtures
>>>>>>>> 2) Have defined other fixtures that your tests are referencing
>>>>>>>> (likely in their setUp method)
>>>>>>>>
>>>>>>>> If none of the items above are correct, feel free to provide a link
>>>>>>>> to the tutorial you're going through and I'll take a look.
>>>>>>>>
>>>>>>>> JDB
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Feb 12, 2014 at 2:33 PM, Paul Sermon <
>>>>>>>> pauls...@googlemail.com> wrote:
>>>>>>>>
>>>>>>>>> So I'm working my way through the Django tutorials, and have got
>>>>>>>>> as far as the view tests.  It seems that when running the test client,
>>>>>>>>> rather than returning data from an empty test database (is this what 
>>>>>>>>> is
>>>>>>>>> meant to happen?) it is returning polls from the existing database, 
>>>>>>>>> which
&

Re: Django Tutorial 5 - First Tests

2014-02-13 Thread Jonathan Baker
m the database, rather than the test
>>> database.
>>>
>>> I am on windows 7, if that makes any difference.
>>>
>>>
>>>
>>>
>>> On Thursday, February 13, 2014 2:58:37 PM UTC, jondbaker wrote:
>>>
>>>> Are you running your tests on the command line using:
>>>>
>>>> $ python manage.py test polls
>>>>
>>>> ...or are you trying to run them from a Python shell? It'd be helpful
>>>> if you could provide the internal link to the area of the page you linked
>>>> to that you're experiencing the failure at, as well as the output of the
>>>> error you're receiving and the command that causes it.
>>>>
>>>> JDB
>>>>
>>>>
>>>> On Thu, Feb 13, 2014 at 3:19 AM, Paul Sermon 
>>>> <pauls...@googlemail.com>wrote:
>>>>
>>>>> This is the tutorial: https://docs.djangoproject.com/en/1.6/intro/
>>>>> tutorial05/
>>>>>
>>>>> I've followed the tutorials pretty much to the letter since tutorial
>>>>> one.
>>>>>
>>>>> Thanks for the help!
>>>>>
>>>>> -Paul
>>>>>
>>>>>
>>>>> On Wednesday, February 12, 2014 10:33:16 PM UTC, jondbaker wrote:
>>>>>
>>>>>> You're correct in thinking that tests use a test database that is
>>>>>> independent of your formally defined project database. Without knowing
>>>>>> exactly which Django tutorials you are referring to, I can only assume 
>>>>>> that
>>>>>> perhaps you:
>>>>>>
>>>>>> 1) Have defined initial_data.json fixtures
>>>>>> 2) Have defined other fixtures that your tests are referencing
>>>>>> (likely in their setUp method)
>>>>>>
>>>>>> If none of the items above are correct, feel free to provide a link
>>>>>> to the tutorial you're going through and I'll take a look.
>>>>>>
>>>>>> JDB
>>>>>>
>>>>>>
>>>>>> On Wed, Feb 12, 2014 at 2:33 PM, Paul Sermon <pauls...@googlemail.com
>>>>>> > wrote:
>>>>>>
>>>>>>> So I'm working my way through the Django tutorials, and have got as
>>>>>>> far as the view tests.  It seems that when running the test client, 
>>>>>>> rather
>>>>>>> than returning data from an empty test database (is this what is meant 
>>>>>>> to
>>>>>>> happen?) it is returning polls from the existing database, which has the
>>>>>>> polls created in the previous tutorials.  This means the tests that 
>>>>>>> expect
>>>>>>> empty result sets fail.
>>>>>>>
>>>>>>> Any idea why it would be doing this?  Am I correct in thinking the
>>>>>>> test should create it's own empty database to test 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...@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/e1782c5f-d8e7
>>>>>>> -4fc6-93d8-88d01aafbd4f%40googlegroups.com.
>>>>>>> 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...@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/
>>&

Re: Django Tutorial 5 - First Tests

2014-02-13 Thread Jonathan Baker
"setup_test_environment()<https://docs.djangoproject.com/en/1.6/topics/testing/advanced/#django.test.utils.setup_test_environment>
installs
a template renderer which will allow us to examine some additional
attributes on responses such as response.context that otherwise wouldn't be
available. Note that this method *does not* setup a test database, so the
following will be run against the existing database and the output may
differ slightly depending on what polls you already created."

That's from the section you linked to, and it clearly explains that a test
database will not be created. Two sections below that is
https://docs.djangoproject.com/en/1.6/intro/tutorial05/#testing-our-new-viewwhich
demonstrates how to create test cases that inherit from TestCase that
can be found and executed by the Django test runner which will also handle
creating the test database for you.

JDB


On Thu, Feb 13, 2014 at 10:20 AM, Paul Sermon <paulser...@googlemail.com>wrote:

> yes I am running through the manage.py shell (although initially I did
> not).
>
> I am doing the section:
> https://docs.djangoproject.com/en/1.6/intro/tutorial05/#the-django-test-client
> On the response.content line, I get back a line listing the polls made
> earlier.
>
> And I presume that is why the test from the next section fail, because
> they are picking up the entries from the database, rather than the test
> database.
>
> I am on windows 7, if that makes any difference.
>
>
>
>
> On Thursday, February 13, 2014 2:58:37 PM UTC, jondbaker wrote:
>
>> Are you running your tests on the command line using:
>>
>> $ python manage.py test polls
>>
>> ...or are you trying to run them from a Python shell? It'd be helpful if
>> you could provide the internal link to the area of the page you linked to
>> that you're experiencing the failure at, as well as the output of the error
>> you're receiving and the command that causes it.
>>
>> JDB
>>
>>
>> On Thu, Feb 13, 2014 at 3:19 AM, Paul Sermon <pauls...@googlemail.com>wrote:
>>
>>> This is the tutorial: https://docs.djangoproject.com/en/1.6/
>>> intro/tutorial05/
>>>
>>> I've followed the tutorials pretty much to the letter since tutorial one.
>>>
>>> Thanks for the help!
>>>
>>> -Paul
>>>
>>>
>>> On Wednesday, February 12, 2014 10:33:16 PM UTC, jondbaker wrote:
>>>
>>>> You're correct in thinking that tests use a test database that is
>>>> independent of your formally defined project database. Without knowing
>>>> exactly which Django tutorials you are referring to, I can only assume that
>>>> perhaps you:
>>>>
>>>> 1) Have defined initial_data.json fixtures
>>>> 2) Have defined other fixtures that your tests are referencing (likely
>>>> in their setUp method)
>>>>
>>>> If none of the items above are correct, feel free to provide a link to
>>>> the tutorial you're going through and I'll take a look.
>>>>
>>>> JDB
>>>>
>>>>
>>>> On Wed, Feb 12, 2014 at 2:33 PM, Paul Sermon 
>>>> <pauls...@googlemail.com>wrote:
>>>>
>>>>> So I'm working my way through the Django tutorials, and have got as
>>>>> far as the view tests.  It seems that when running the test client, rather
>>>>> than returning data from an empty test database (is this what is meant to
>>>>> happen?) it is returning polls from the existing database, which has the
>>>>> polls created in the previous tutorials.  This means the tests that expect
>>>>> empty result sets fail.
>>>>>
>>>>> Any idea why it would be doing this?  Am I correct in thinking the
>>>>> test should create it's own empty database to test 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...@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/e1782c5f-d8e7-4fc6-93d8-88d01aafbd4f%40goog
>>>>> legroups.com.
>>>>> For more options, visit https://

Re: Django Tutorial 5 - First Tests

2014-02-13 Thread Jonathan Baker
Are you running your tests on the command line using:

$ python manage.py test polls

...or are you trying to run them from a Python shell? It'd be helpful if
you could provide the internal link to the area of the page you linked to
that you're experiencing the failure at, as well as the output of the error
you're receiving and the command that causes it.

JDB


On Thu, Feb 13, 2014 at 3:19 AM, Paul Sermon <paulser...@googlemail.com>wrote:

> This is the tutorial:
> https://docs.djangoproject.com/en/1.6/intro/tutorial05/
>
> I've followed the tutorials pretty much to the letter since tutorial one.
>
> Thanks for the help!
>
> -Paul
>
>
> On Wednesday, February 12, 2014 10:33:16 PM UTC, jondbaker wrote:
>
>> You're correct in thinking that tests use a test database that is
>> independent of your formally defined project database. Without knowing
>> exactly which Django tutorials you are referring to, I can only assume that
>> perhaps you:
>>
>> 1) Have defined initial_data.json fixtures
>> 2) Have defined other fixtures that your tests are referencing (likely in
>> their setUp method)
>>
>> If none of the items above are correct, feel free to provide a link to
>> the tutorial you're going through and I'll take a look.
>>
>> JDB
>>
>>
>> On Wed, Feb 12, 2014 at 2:33 PM, Paul Sermon <pauls...@googlemail.com>wrote:
>>
>>> So I'm working my way through the Django tutorials, and have got as far
>>> as the view tests.  It seems that when running the test client, rather than
>>> returning data from an empty test database (is this what is meant to
>>> happen?) it is returning polls from the existing database, which has the
>>> polls created in the previous tutorials.  This means the tests that expect
>>> empty result sets fail.
>>>
>>> Any idea why it would be doing this?  Am I correct in thinking the test
>>> should create it's own empty database to test 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...@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/e1782c5f-d8e7-4fc6-93d8-88d01aafbd4f%
>>> 40googlegroups.com.
>>> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4031d95b-7f80-4839-a25a-800649e33cf1%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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/CAPMFOb7T4DpbwtMvtmiuzVfA2QsuoyJansjFLurDUPg2uKyD4g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Tutorial 5 - First Tests

2014-02-12 Thread Jonathan Baker
You're correct in thinking that tests use a test database that is
independent of your formally defined project database. Without knowing
exactly which Django tutorials you are referring to, I can only assume that
perhaps you:

1) Have defined initial_data.json fixtures
2) Have defined other fixtures that your tests are referencing (likely in
their setUp method)

If none of the items above are correct, feel free to provide a link to the
tutorial you're going through and I'll take a look.

JDB


On Wed, Feb 12, 2014 at 2:33 PM, Paul Sermon wrote:

> So I'm working my way through the Django tutorials, and have got as far as
> the view tests.  It seems that when running the test client, rather than
> returning data from an empty test database (is this what is meant to
> happen?) it is returning polls from the existing database, which has the
> polls created in the previous tutorials.  This means the tests that expect
> empty result sets fail.
>
> Any idea why it would be doing this?  Am I correct in thinking the test
> should create it's own empty database to test 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/e1782c5f-d8e7-4fc6-93d8-88d01aafbd4f%40googlegroups.com
> .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPMFOb6_fAf2rR_FeX9fvTbcUg8W_su_5NM0%2BJkebNht5%2BEO3g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Checkboxes collection instead of a multiple select

2014-02-12 Thread Jonathan Querubina
Tom,

Thanks for the feedback!

This can be used on the admin form?

On Feb 6, 2014, at 12:48 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Thu, Feb 6, 2014 at 11:15 AM, Jonathan Querubina
> <john.chro...@gmail.com> wrote:
>> Hi guys,
>> 
>> How do i show a collection of checkboxes instead of a multiple select?
>> 
>> Thanks!
> 
> Sounds like you want to change the widget on a form:
> 
> https://docs.djangoproject.com/en/1.6/ref/forms/widgets/
> 
> Specifically, changing it from a SelectMultiple widget to a
> CheckboxSelectMultiple:
> 
> https://docs.djangoproject.com/en/1.6/ref/forms/widgets/#checkboxselectmultiple
> 
> Cheers
> 
> Tom
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAFHbX1%2B7xxQYugLU8M%3DBq58pbfyZhF1WAHa31NpJr1xDsxcKgQ%40mail.gmail.com.
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9C46C8FF-60DE-4D1E-A0B0-E7E519917FBE%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


  1   2   3   4   5   6   >