Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread Sam Brown
Im sure there are performance metrics out there to prove the ORM will not be the bottleneck. But I’ve never seen it slow things down when I’ve employed a timer on operation Also, ive recently ran into some of the limitations of drf and am looking into moving to an api that can be less coupled

Re: Navbar

2023-05-18 Thread tintu john sam
you have add the css and js links to your main html file.. On Thu, May 18, 2023 at 11:44 AM Michael Edet wrote: > Please help > > On Sun, 14 May 2023, 18:17 Michael Edet, wrote: > >> I have been having issues with my navbar and I'm using bootstrap >> >> The first one is what I want >> The

i want to use .db file in django application

2023-01-03 Thread Sam Stephen
How can i connect employee.db file to django? can any1 please help or share any tutorial -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

as_* helpers (e.g. as_p as_div) for display (read "not in a form")

2022-12-14 Thread Sam Brown
anyone know of a non-form helper like as_p? Same question posted on stackoverflow here <https://stackoverflow.com/questions/74790679/django-as-p-method-equivalent-for-non-form-display-only-use-cases> Thanks, Sam Brown -- You received this message because you are subscribed to the Google

Re: Perform a join in 5 tables or more than that USIN ORM

2022-01-30 Thread Sam Chaffy
Yes you can What’s your model look like ? On Sun, Jan 30, 2022 at 7:26 AM narendra...@gmail.com < narendrathapa...@gmail.com> wrote: > hello folks, > any django ex[ert here, I want to know if anybody can do multiple join > more than 5 tables at once using ORM >

Re: Is there a function that returns common elements in multiple lists

2022-01-25 Thread Sam Chaffy
You can use sets On Tue, Jan 25, 2022 at 7:47 AM bnmng wrote: > Hello, > > Is there a built in function that compares two or more lists and returns > elements common to all? > > like this: > > def in_both( list_a, list_b ): > list_c=[] > for value in list_a: > if value in list_b: >

Re: can Django replace PHP ?

2021-06-28 Thread Sam Chaffy
Django gives you a builtin admin panel for free. Enjoy On Mon, Jun 28, 2021 at 3:49 PM Boris Pérez wrote: > Hi friend...u can do everything u need in django...without use php... > Greetings > > > 2021-06-28 10:23 GMT-04:00, Luis Zárate : > > Hi, you can create several web applications with

Re: Filtering fields in http response data from http request url ?

2021-05-31 Thread Sam Chaffy
Using django rest framework, create a serializer class and specify the right field you want to display at the end. Please check this link https://www.django-rest-framework.org/api-guide/serializers/ On Sun, May 30, 2021 at 10:03 PM Mottaz Hegaze wrote: > Using Django Rest Framework , you can

Joining two unrelated tables via the ORM with m-to-m relationship?

2020-12-14 Thread Sam Clark
ere a way to achieve ForeignObject type functionality but with many to many relationships? Any help would be greatly appreciated. Thanks! -Sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: run terminal code inside project

2020-11-05 Thread Mory Sam
? > > You can call management commands from inside django - but it doesn't > really make any sense to do so. Especially the migrate command? > > So what is it you want to do? Then perhaps we can help you with a solution? > > Regards, > > Andréas > > > Den ons

run terminal code inside project

2020-11-04 Thread Mory Sam
hi all How to use django terminal codes inside your project code example : " python manage.py migrate " code run inside views.py , not terminal thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

run terminal code inside project

2020-11-04 Thread Mory Sam
hi all How to use Digingo terminal codes inside your project code? example : "python manage.py migrate" code run inside views.py ,not terminal? thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: unable Integrating Djongo 1.3.1 with django 2.2.10

2020-03-20 Thread Sam Chaffy
Install pymongo package by > pip install pymongo or, better practice make a virtual environment directory where all your dependencies will be installed. > python -m venv myvenv (assuming you name it myvenv) If you are in Windows activate virtual environment with: > cd in directory where

Re: Active Open Source Project to contribute to

2020-03-10 Thread Sam Perera
Hi Johnson, i am also a django beginner who is looking for a website development project. if you are interested, then we can start a project and update our knowledge. Thank you and looking forward to hear from you. Sam On Wed, Mar 11, 2020 at 10:28 AM Johnson wrote: > Hi friends, I'm a dja

Creating serializer for foreign key of foreign key

2020-03-07 Thread Sam
I have 3 models. Question, Choice, and ChoiceColor. class Question(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) question= models.CharField(max_length=200) class Choice(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE)

passing a parameter through CreateView to a be an initial value in a form

2020-02-19 Thread Sam Hefer
Hey Patric, Have a look at stackoverflow. https://stackoverflow.com/a/60273100/7063031 I used form_valid in the createview to get the form instance field, passed the pk through the URL to the template, then used get_context in the view so the template can get the pk from the URL. You’ll

Re: How to pass pk through URL to CreateView

2020-02-18 Thread Sam Hefer
Hi Phil, I did find a solution to my query. Have a look at my post on stackoverflow: https://stackoverflow.com/a/60273100/7063031 Thanks, Sam > On 19/02/2020, at 3:21 AM, Phil Kauffman wrote: > >  > Hello, > > Did you get any headway on this issue? I'm a

Re: Production deployments and Version Control for DJango projects

2020-02-14 Thread Sam Hefer
Bitbucket is great if you don’t like Git env. It has a great interface. Thanks, Sam > On 15/02/2020, at 4:34 PM, Ram wrote: > >  > Hi, > > I'm currently having development server with Digital Ocean for our Django > based web site. We are currently copying new cod

How to pass pk through URL to CreateView

2020-02-14 Thread Sam Hefer
estions/59404263/passing-the-pk-from-url-to-createview-form-valid I would really appreciate some help. Thanks, Sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an e

How to load an instance in class based views using form_valid

2020-01-12 Thread Sam Hefer
0 I'm trying to build a form that automatically fills some fields in a class based create view that lets logged in users create a Job. However, I can't seem to find the correct way of doing this for fields that aren't the user (eg. request.user). So the create view is trying to get a

Django Formset, how to define multiple many to many fields and create a formset

2020-01-03 Thread Sam Hefer
): return reverse('jobs:detail', kwargs={'pk': self.pk}) Could someone show me how to define this relationship as well as how to create the formset for it? Thanks, Sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

Re: Trouble with Django Generic List view

2020-01-01 Thread Sam Hefer
; > On Wednesday, January 1, 2020 at 5:02:13 PM UTC-5, Sam Hefer wrote: >> >> Hi, >> >> I'm having some issues with displaying a filtered list in a template. >> >> My View: >> >> class MyJobs(ListView): >> model = Job >> templa

Trouble with Django Generic List view

2020-01-01 Thread Sam Hefer
(for all users) and the field reference doesn't show anything (jobs.company_name is always empty). Have I missed something? Thanks, Sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: job search

2019-08-20 Thread Sam W
I'm sorry. But knowing Python alone is not enough. I know Python and Django really well, still can't find a job for more than six months. You need to know Solid Python programming, python framework (Django (DRF) & Flask), Docker and Kubernetes, AWS or Azure, Front-end development (React

tinymce no module exists

2019-08-04 Thread Sam W
Add it to the installed apps INSTALLED_APPS = ( ... 'tinymce', ) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: can anyone help me to solve the following error in django-vue integration

2019-08-02 Thread Sam W
Did you add 'corsheaders', to the settings file? The Error is very clear: *npm ERR! frontend@1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`* Install : pip install django-cors-headers Then add: 'corsheaders',to the INSTALLED_APPS inside settings file in Django

Re: can anyone help me to solve the following error in django-vue integration

2019-08-02 Thread Sam W
Did you add 'corsheaders', to the settings file? Follow this link: https://pypi.org/project/django-cors-headers/ On Thursday, August 1, 2019 at 10:18:11 PM UTC-5, Pradeep Singh wrote: > > F:\django-vue project\djangoVueProject\frontend\webpack.config.js:81 > 'vue$': 'vue/dist/vue.esm.js'

Re: Drag and drop

2019-08-02 Thread Sam W
Use Javascript or jQuery check out this link: https://simpleisbetterthancomplex.com/tutorial/2016/11/22/django-multiple-file-upload-using-ajax.html *10 jQuery File Upload Plugins:* https://www.sitepoint.com/10-jquery-file-uploads/ On Friday, August 2, 2019 at 10:00:44 AM UTC-5, Django Dojo

Re: django-vue

2019-08-01 Thread Sam W
*Udemy * The Complete Guide to Django REST Framework and Vue JS https://www.udemy.com/the-complete-guide-to-django-rest-framework-and-vue-js/ On Thursday, August 1, 2019 at 2:46:10 AM UTC-5, Pradeep Singh wrote: > > can anyone sugget me django-vue tutorial > -- You received this message

Re: Only for specific region

2019-07-30 Thread Sam W
Use IP2LOCATION to detect the location of the user IP address then you can show pages based on it On Monday, July 29, 2019 at 8:07:07 PM UTC-5, Sebastian Jung wrote: > > Hello, > > I want that my Website only German user can Open it and another User from > Others Region a template Show, that

Defining Models outside models.py

2019-07-25 Thread Sam Taiwo
Hi everyone, I know there are currently 3 ways to define a model in Django 1) Define it directly in the models.py file 2) Define it directly in a models package in the same directory as your other app files 3) Define it somewhere completely different and just import the models into the

Re: Sign Up by using E-mail id

2019-07-24 Thread Sam W
This is the official page. It is really simple to follow: https://docs.djangoproject.com/en/2.2/topics/auth/default/ On Wednesday, July 24, 2019 at 5:27:37 AM UTC-5, Soumen Khatua wrote: > > Hi Folks, > I want to create one signup page where end-user can SignUp and LogIn by > using their

Re: Sign Up by using E-mail id

2019-07-24 Thread Sam W
Check this one out: Django Authentication with just an email and password (no username required!) https://medium.com/@ramykhuffash/django-authentication-with-just-an-email-and-password-no-username-required-33e47976b517 On Wednesday, July 24, 2019 at 5:27:37 AM UTC-5, Soumen Khatua wrote: > > Hi

Re: integrate vue js with django

2019-07-15 Thread Sam W
*Use Django REST framework for Django and Vue.axios for vuejs* *Example: * https://medium.com/@jrmybrcf/how-to-build-a-project-with-django-vuejs-create-a-rest-api-endpoint-b57374a89661 On Monday, July 15, 2019 at 12:10:48 AM UTC-5, Pradeep Singh wrote: > > can anyone tell me how to integrate

Re: Minimum Hardware requirement - reg

2019-06-25 Thread Sam Taiwo
I think think the first advice is way off base in two ways. 1) It's not clumsy to have 8 apps if that is the the structure of the project that makes each part encapsulated and reusable. 2) 30 concurrent users in one app can be more demanding than 1000 in another. It really depends on what each

Re: Any open source project for beginner to start with ?

2019-05-15 Thread Sam Taiwo
o the task, then continue to stretch yourself by building bigger applications till you feel comfortable to come back and contribute. I feel like Django is the best place to start, considering it will be the framework you will have the most experience with till date. Kind Regards Sam On Wed, May 15, 2019

Re: Django Upload multiple files without using Django forms or models

2019-05-13 Thread Sam W
Yes long time ago .. follow this tutorial https://simpleisbetterthancomplex.com/tutorial/2016/11/22/django-multiple-file-upload-using-ajax.html On Monday, May 13, 2019 at 10:00:24 AM UTC-5, christophe szczepanski wrote: > > *do solved your problem ? , i have the same ?* > > > *Thank you :)* > --

Re: ReportLab or Xhtml2pdf Please can any one guide me to convert the rendered in html to pdf

2019-04-19 Thread Sam W
Use java then use py4j or Jython to call java method... https://www.baeldung.com/pdf-conversions-java On Fri, Apr 19, 2019, 1:11 PM Irfan Khan wrote: > hi, > i stucked in converting the pdf file from html > can an one suggest me even any other possibility instead of using python >

Django Upload multiple files without using Django forms or models

2019-04-14 Thread Sam W
I want to upload multiple files to the system (Local folder) without using Django forms or models. For a single file, everything works just fine and the file get saved to a local media folder under the project. But when I changed the function from {request.FILES['images'] } To

Re: Web Push Notification in Django

2019-03-26 Thread Sam W
This one is very simple: https://www.pushbots.help/install-pushbots-in-your-app-or-website/web-pages/add-pushbots-to-your-web-page On Monday, March 25, 2019 at 11:28:43 AM UTC-5, Aayush Bhattarai wrote: > > *I am working on blog project and I wanted to add Web Push Notification in > Django. I

Re: Django REST custom registration

2019-03-25 Thread Sam W
Similar question in Stackoverflow: https://stackoverflow.com/questions/24791110/django-allauth-how-to-set-user-to-active-only-after-e-mail-verification/24809190 On Monday, March 25, 2019 at 4:17:11 AM UTC-5, shubham joshi wrote: > > How can I create sign up form in such a way that..once a form

Re: Web Push Notification in Django

2019-03-25 Thread Sam W
Web Push Notification Package for Django: https://github.com/safwanrahman/django-webpush On Monday, March 25, 2019 at 11:28:43 AM UTC-5, Aayush Bhattarai wrote: > > *I am working on blog project and I wanted to add Web Push Notification in > Django. I have researched a lot. I have not found

Re: custom registration form

2019-03-25 Thread Sam W
Similar question in Stackoverflow: https://stackoverflow.com/questions/24791110/django-allauth-how-to-set-user-to-active-only-after-e-mail-verification/24809190 On Monday, March 25, 2019 at 7:52:57 AM UTC-5, Shubham Joshi wrote: > > How can I create sign up form in such a way that..once a form

Re: log out a user when user closes tab or browser

2019-03-21 Thread Sam W
closing a tab will not log you out >> also it depends on the browser (firefox seemed in the past to ignore this) >> >> On Thu, 21 Mar 2019 at 05:34, Sam W > >> wrote: >> >>> Is there a way in Django to log out a user when user closes tab or >>>

Re: log out a user when user closes tab or browser

2019-03-21 Thread Sam W
_CLOSE works for me > but only when you close the browswer, closing a tab will not log you out > also it depends on the browser (firefox seemed in the past to ignore this) > > On Thu, 21 Mar 2019 at 05:34, Sam W > > wrote: > >> Is there a way in Django to log out a user wh

log out a user when user closes tab or browser

2019-03-20 Thread Sam W
Is there a way in Django to log out a user when user closes tab or browser? This one "SESSION_EXPIRE_AT_BROWSER_CLOSE =True" Doesn't work -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Channels & WebSocket - failed: Error during WebSocket handshake: Unexpected response code: 403

2019-03-11 Thread Sam Taiwo
I'm not sure, but it looks like you are trying to connect to a localhost which is fine locally but not in production. You probably need to change your frontend code to route properly. This is all speculation as you have not shown your application code, I don't think you'll get many good answers...

Re: how to create a Django project without using an IDE, but using the django-admin startproject command

2019-03-10 Thread Sam Taiwo
Make sure your virtual environment is activated, you have to activate it each time you create a new terminal. Also contrary to what someone else said, you can use django-admin anywhere, while you must be in the correct directory to run the manage.py file On Sun, Mar 10, 2019, 07:38 abel otugeme

Re: Django credit card redaction app - - MultiValueDictKeyError

2019-03-07 Thread Sam Taiwo
I would be careful how you pass the data on get, somewhere in your front end code you are probably not passing the data through as you expected. Instead of using .GET, use .GET.get to get your data. This will either return the value you want, or none. I think you have made the error of not passing

Re: django vue javascript integration

2019-03-01 Thread Sam W
Why don't you use Django REST framework ? Try this : How to Integrate Vue.js with Django Rest Framework? https://www.techiediaries.com/django-rest-vuejs/ On Friday, March 1, 2019 at 11:36:37 AM UTC-6, Tomas Garijo wrote: > > Hello group, > > I have a huge problems to integrate a vue javascript

Re: django vue javascript integration

2019-03-01 Thread Sam W
Why don't you use Django REST framework ? On Friday, March 1, 2019 at 11:36:37 AM UTC-6, Tomas Garijo wrote: > > Hello group, > > I have a huge problems to integrate a vue javascript file in one template, > only for testing, I'm searching on google but unfortuny I can't find anything. > I have a

Re: Problems with first program

2019-03-01 Thread Sam W
The error is very clear "IndentationError: expected an indented block" Use PyCharm IDE OR Visual Studio Code. Also, never use Keyboard Spacebar for indentation , always use Tab for indentation. TO solve your problem take the question_text to the beginning of the line then hit the Tab once.

Re: Tutorials Needed

2019-03-01 Thread Sam W
This YouTube Channel is really good Taught by Corey Schafer https://www.youtube.com/watch?v=UmljXZIypDc Python Django Tutorial: It has more than 17 videos about Django. On Thursday, February 28, 2019 at 12:54:06 PM UTC-6, Madhav Rajmohan wrote: > > Friends, > I am Madhav Rajmohan

Re: REST Framework alternatives

2019-02-05 Thread Sam Taiwo
What validation does he specifically need? He could probably get away with writing a few helper functions himself! On Tue, Feb 5, 2019, 17:50 Miguel Ángel Cumpa Ascuña < miguel.cumpa.asc...@gmail.com wrote: > Django tastypie > good luck! >

ChannelsLiveServerTestCase Apps are not loaded error

2018-12-31 Thread Sam Taiwo
I am trying to follow the 4 part channels tutorial, however I am getting an error on the last part where we run selenium to test against a live server. It's not the end of the world as I can still run the server with no problems, however it limits my ability to test which is a shame. I have the

how to access binary file which is outside project folder

2018-02-28 Thread sam kavuri
I am new to Django and trying to access binary file which is outside project folder and open it in the browser. When i try to do that it is saying Cross-Origin Request is blocked (Reason: CORS header 'Access-Control-Allow-Origin missing). Somebody, please help on this. -- You received this

Django generate bar chart by reading CSV file data

2018-01-16 Thread sam kavuri
Hi, I am new to Django and working on some web project. I want to generate a dynamic bar chart (using Chart Js library) by reading CSV file data. Could you please somebody help on this... -- You received this message because you are subscribed to the Google Groups "Django users" group. To

collectstatic with ManifestStaticFilesStorage post-processing unchanged files

2017-03-24 Thread Django Sam
*Versions* Django 1.10.5 Python 3.4.5 *settings.py:* STATIC_URL = '/static/' STATIC_ROOT = '/srv/myproject_static/' STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' *Issue:* When I run collectstatic some (not all) files will be post-processed even though

Re: Decrease amount of identical "Email reports"

2017-01-09 Thread Sam Walters
Hi Presumably you have had a look at logging docs and its not good enough? https://docs.djangoproject.com/en/1.10/topics/logging/ With these sort of project requirements the way i have solved this in the past is to: *Work out who needs to receive certain messages. Draw a grid with all useful

Re: Test, RunPython, Datamigrations with Django 1.7.5

2015-03-04 Thread sam
Well, answer is here: https://docs.djangoproject.com/en/1.7/topics/testing/overview/#rollback-emulation Need to use serialized_rollback = True in TransactionTestCase Le mercredi 4 mars 2015 18:24:34 UTC+1, sam a écrit : > > Hello, > > I have an issue trying to run tests. > My

Test, RunPython, Datamigrations with Django 1.7.5

2015-03-04 Thread sam
Hello, I have an issue trying to run tests. My application use a migration to have default fixtures (created using migrations.RunPython from a migration file). The problem is when I launch manage.py test, the fixtures from the migration are created on the "production" database and not on the

Re: Foreign key User on migration‏

2014-08-04 Thread Sam Contapay
I downloaded the latest code from stable/1.7.x branch and this problem no longer exists. On Monday, August 4, 2014 8:06:00 AM UTC-7, Sam Contapay wrote: > > Hi, > > I tried adding a foreign key to a model in a Django app I'm building to > learn 1.7. I am using Python 3.4 a

Foreign key User on migration‏

2014-08-04 Thread Sam Contapay
Hi, I tried adding a foreign key to a model in a Django app I'm building to learn 1.7. I am using Python 3.4 and Django 1.7c2 #blog/models.py from django.contrib.auth.models import User from django.db import models class Comment(models.Model): user = models.ForeignKey(User, blank=True,

Re: Errors Using Pip In Powershell to Download Django

2014-07-17 Thread Sam Lai
Can you provide some console output so we can see what commands you're entering and what the actual output is? On 17 July 2014 04:06, Malik Rumi wrote: > Yesterday I tried to get the 1.7rc1 and got the error 'file contains no > section headers'. I assumed this was because

Re: Geodjango and Python 3.3

2014-03-27 Thread Sam Lai
hon3 > https://pypi.python.org/pypi/GDAL/ > https://pypi.python.org/pypi/Shapely (Infers Geos) > > Thanks, > Alex > > On 03/25/2014 05:34 PM, Sam Lai wrote: >> I'm developing a site using Python 3.3, Django, Geodjango and >> PostgreSQL. It is a bit tricky getting all

Re: IntegrityError --- NOT NULL constraint failed: books_book.publication_date

2014-03-26 Thread Sam Walters
Did you perhaps change the schema of the database after you had created it. Eg: added null=True as a constraint after creating the table? If so check the db sheme using: python manage.py sqlall It sounds simple enough. You will have to go into the db shell and update your schema manually.

Re: Geodjango and Python 3.3

2014-03-25 Thread Sam Lai
I'm developing a site using Python 3.3, Django, Geodjango and PostgreSQL. It is a bit tricky getting all the libraries to work, but the stack does work. I installed GEOS using OSGeo4W, but I had to explicitly specify the GEOS_LIBRARY_PATH and GDAL_LIBRARY_PATH in settings.py. On 25 March 2014

Re: [ELI5] how to deploy django

2014-03-03 Thread Sam Lai
On 4 March 2014 14:36, Walter Wang wrote: > I tried my best to follow the various guides out there, but the official > documentation here > https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/ has > different instructions than the instructions here, >

Re: help with GEOS and PROJ.4 in windows 7

2014-02-16 Thread Sam Lai
Did you try the steps listed in the geodjango documentation, specifically https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#osgeo4w and the following step to configure the environment? If you did and it didn't work, what was the error? On 16 February 2014 05:55, Nicholas Perez

Re: virtualenv on Windows

2014-01-29 Thread Sam Lai
Oops, my memory failed me. They don't work with pip, but they do work with easy_install, which virtualenvs have as well (at least mine do). http://stackoverflow.com/a/5442340/150999 For example, easy_install C:\Users\sam\Downloads\Pygments-1.6.win-amd64-py2.7.exe On 29 January 2014 16:27

Re: virtualenv on Windows

2014-01-28 Thread Sam Lai
> However, even after downloading from that site they cannot be installed > manually into a virtualenv! Only pip can do that. You can install the packages from http://www.lfd.uci.edu/~gohlke/pythonlibs/ by simply running - pip install ... from inside your virtualenv. Those .exe files are

Re: UnicodeDecodeError in python manage.py flush

2014-01-20 Thread Sam Lai
It looks like you have named one of your model classes with a name that contains a non-ASCII character. Stick with class names with only a-z, A-Z, 0-9 characters and see if that helps. On 21 January 2014 10:29, Edgar Reyes wrote: > Hi, I'm looking in google search

Re: Exception on start django server in windows 7

2014-01-20 Thread Sam Lai
It's due to the accent on the e in your username. This is a 'bug' in the way Python works with the Windows command prompt. Long story short, just move the 'Python' directory out from your Desktop to somewhere just on your C:\ drive (so your username isn't in the path) and everything will work,

Re: How to make a dynamic list in Django

2014-01-10 Thread Sam Walters
/7335780/how-to-post-a-django-form-with-ajax-jquery Hope this helps cheers sam On Fri, Jan 10, 2014 at 2:44 PM, Frank Jaworski <fdjphoenix1...@gmail.com>wrote: > Hello, > > Essentially I am trying to take some pre-existing data for a user, > populate a "list" with it,

Re: Getting GIS Working - possible kernel32 problem

2013-10-25 Thread Sam Lai
Can you try running 'python.exe manage.py runserver' outside of PyCharm, i.e. in the Command Prompt/PowerShell? I've got a similar setup, although on Windows 7, and it works. Instead of setting environment variables, I added the following parameters into my settings.py to indicate the location of

Re: Tests not loading initial_data fixtures

2013-10-03 Thread Sam Lai
Ah, turns out all you have to do is specify - fixtures = [ 'initial_data' ] ... in the TestCase and it'll load all the initial_data fixtures from all apps. Still a bit odd that loading initial_data fixtures isn't the default in tests though. On 3 October 2013 16:49, Sam Lai <sam

Tests not loading initial_data fixtures

2013-10-03 Thread Sam Lai
. Thanks, Sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to dj

Re: Bootstrap - django-bootstrap3 or django-crispy-forms

2013-09-26 Thread Sam Lai
Yep. django-bootstrap-* and django-crispy-forms only provide helpers for outputting HTML with bootstrap CSS classes. Neither are really necessary to use Bootstrap (just makes it slightly easier), which is applied through HTML and CSS and Django doesn't place any restrictions on how your HTML/CSS

Re: Script to move django 1.4.3 to 1.5.1

2013-09-01 Thread Sam Walters
The worst change i've had to make was a long time ago when we had to send CSRF Token with Ajax calls because of a security exploit. Had to write an entire regular expression and apply it to multiple template files. Took perhaps 40 minutes. However i can see some of the really old django snippets

Re: What client side html layout tools are people using to speed up template development?

2013-07-30 Thread Sam Walters
;20 web designer tools" and you'll get >> one of those blog posts that lists them all. >> >> And if you have time check out this list https://github.com/** >> dypsilon/frontend-dev-**bookmarks<https://github.com/dypsilon/frontend-dev-bookmarks>. >> It's trul

What client side html layout tools are people using to speed up template development?

2013-07-29 Thread Sam Walters
Its not specific to django however i have a few small projects on the horizon where i could really save time spent on the things im not good at: Graphic design CSS layouts, choosing fonts, colours that look good. What are the tools people are using for this these days? What are strong points of

Re: Understanding an existing big web application written in Django

2013-06-06 Thread Sam Walters
Hi In addition to what has already been said. Make use of command line search tools. Hoe to search through all the python files using BASH is a good example. eg: In one of my projects i have to find all the places where a particular class is called or instantiated: 'LocationAirfieldLookup'

Re: Django Development Server Root URL...

2013-06-04 Thread Sam Solomon
Daniel is correct. One more point though, there are cases where you may want to use the full url instead of just "/django_project/", in which case, you should use settings.BASE_URL or {{ request.get_host }}. To use either of those in the template, the template would need to be rendered with a

Re: current transaction is aborted, commands ignored until end of transaction block

2013-05-30 Thread Sam Solomon
Hmm, yeah, Ryan could be onto something, but that doesn't really help figure out the root cause (which likely was an error that existing before upgrading but just went ignored). What should help get to the root issue is checking out the postgresql log file (for me:

Re: [Bulk] Re: Template Inheritance doubt

2013-05-20 Thread Sam Solomon
If you are mainly using this for splitting stuff into multiple files, here is what we do to accomplish the same thing but keep it so that templates always inherit base.html instead of sidebar.html: base.html: {% extends 'header.html' %} {% block main %} {% endblock main %} header.html:

Re: unique not working as expected

2013-05-10 Thread Sam Solomon
My guess is that unique=True was added after the table was created using syncdb. I'm guessing that most companies that use Django professionally use South ( http://south.aeracode.org/) to make schema changes easier. Without South, you would have to keep the database in sync with the code

Fetching data from related tables

2013-05-09 Thread Sam
I have 3 tables: Continent, Country and Story. Country has ForeignKey(Continent) and Story has ManyToManyField(Country, blank=True) field. What I need is to get a list of countries which at least have one story belonging to it, and I need these countries grouped by continents. How can I

Re: Installing django-allauth

2013-05-02 Thread Sam Solomon
Hello, What version of allauth are you trying to install and where did you get it from? https://github.com/pennersr/django-allauth/tree/0.10.0/allauth/socialaccount/migrations is the most recent version on pypi and has more than 2 migrations. Could it be that you have another app installed

Re: django-newsletter, cron job not working

2013-04-17 Thread Sam Walters
Hi In addition to the previous advice i would also check /etc/init.d/cron to see if the daemon is running. make sure you have the correct date+time settings in your shell eg: 'date' command. also run some sort of primitive debug command like: * * * * * touch "/tmp/$(date +\%d-\%m-\%Y-\%T)" for a

Re: How do I display image in admin list?

2013-04-15 Thread Sam Solomon
Oh and I just noticed you added "Also, some images could be blank/None" Instead of 'if obj.id:' you can simply do 'if obj.id and obj.photo:' On Monday, April 15, 2013 10:52:11 AM UTC-7, Sam Solomon wrote: > > One small correction, in 'list_display' it should be 'admin_photo' (or

Re: How do I display image in admin list?

2013-04-15 Thread Sam Solomon
One small correction, in 'list_display' it should be 'admin_photo' (or I'd probably put 'display_photo' (see #1 below)), not 'photo'. Some other tricks: 1) If you don't want to clog up your Model class, you can put the function in your ModelAdmin class. 2) If you add "readonly_fields =

Re: should we develop apps based on urls?

2013-04-12 Thread Sam Solomon
ld someone be looking at a page that has a link while you are deploying the code and then the link will take them to a 404? - Is it in a search engine somewhere that will then be used by a user to try to reach your site? Sam On Wednesday, April 10, 2013 11:41:28 PM UTC-7, Mulianto wro

Re: [SPAM] Implementing User login expiration

2013-04-09 Thread Sam Solomon
Depending on if the expiration is a temporary thing or if you actually want to permanently deactivate the user, this may be even simpler and database efficient (and is what we use to ban users): class DeactivateUserMiddleware(object): def process_request(self, request): if

Re: Creating a admin-field, containing checkboxes. The data of this fields is stored in the string format

2013-04-08 Thread Sam Solomon
Not sure exactly what the issue is, but this may be handy (either as a replacement or as an example of doing something somewhat similar): https://github.com/disqus/django-bitfield I believe on most machines the maximum is 63 "flags" though so you will likely only be able to use it as an

Re: I screwed up my django site using touch

2013-03-08 Thread Sam Solomon
Here is something that may help: import importlib from django.conf import settings for app in settings.INSTALLED_APPS: views_name = "%s.views" % app try: importlib.import_module(views_name) except ImportError: pass except: print "Could not import %s" %

Re: Extending the base file depending on User type

2013-03-06 Thread Sam Solomon
Tom Evans has probably the correct answer for you, but another thing that I've done (maybe not 100% applicable in this case) is to have a default base and then make it extendable from views when necessary: {% extends base_template|default:"base.html" %} This sounds like it isn't applicable in

Re: StreamingHttpResponse into a Template

2013-02-28 Thread Sam Solomon
Not sure if this is what you meant by "we'll probably keep the javascript reloading to process junks, waiting for the support of celery", but one option without celery is to have the initial request save a bunch of "PendingEmail" objects in the database and then redirect you to a

Re: Easiest Way to Deploy Django?

2013-02-23 Thread Sam Walters
Hi Helping people get started at work with PostgreSQL ad the most common problem coming from MySQL users is they have trouble connecting to the database: setting up hg_hba.conf and some of the basic operations are different to MySQL which confuses them. I dont think there is an easiest way.

Re: Django and mod_wsgi serving different apps from separate virtual hosts on the same server

2013-02-07 Thread Sam Solomon
s a network one. > > Sam - I sincerely appreciate your help in (a) verifying that my syntax > looked good, and (b) describing some new ways of setting up mod_wsgi. > > - Rob > > On Feb 7, 2013, at 1:23 PM, robertlnewman wrote: > > Okay no worries. Just thought you mi

Re: Django and mod_wsgi serving different apps from separate virtual hosts on the same server

2013-02-07 Thread Sam Solomon
Regarding having WSGIDaemonProcess outside of vhosts, as explained in the comment I added, it allows you to use the same process to handle requests from multiple vhosts. As for the rest, I honestly don't remember why or where they came from, I just know that this is probably not all that common

  1   2   3   4   5   6   >