Re: Newbie question

2021-06-07 Thread Lalit Suthar
try form.save(commit=False) On Mon, 7 Jun 2021 at 22:10, Moose Smith <47kanga...@gmail.com> wrote: > I have a table which holds simple data like addresses. Created a form > which displays the records in the form and allows the user to select a > record "address" to edit. > > I want this edit

Newbie question

2021-06-07 Thread Moose Smith
I have a table which holds simple data like addresses. Created a form which displays the records in the form and allows the user to select a record "address" to edit. I want this edit function to be generic so it will work on any table without me having to define fields etc... and using

Re: Newbie question : running the makemigrations command in the terminal

2019-03-30 Thread kamibarut609
@jgi...@caktusgroup.com Thank you for your help, I received some help on Stackoverflow. @ Krishna Tulsyan Thank you for your help, I received some help on Stackoverflow. On Friday, 29 March 2019 12:37:05 UTC+1, Krishna Tulsyan wrote: > > Hi, > can you provide the folder structure of your app,

Re: Newbie question : running the makemigrations command in the terminal

2019-03-29 Thread Krishna Tulsyan
Hi, can you provide the folder structure of your app, and apps.py file ensure that the name of the app is 'munichlivin_app' and name of the class in apps.py is 'MunichLivingConfig' On Thursday, March 28, 2019 at 9:05:46 PM UTC+5:30, kamiba...@gmail.com wrote: > > Hello, > > (Newbie here): I am

Re: Newbie question : running the makemigrations command in the terminal

2019-03-28 Thread jgibson
>From your settings file: > munichliving_app.apps.MunichLivingConfig > > That makes me think that the structure of your project looks something like this: \munichliving_app\manage.py \munichliving_app\apps\MunichLivingConfig\ \munichliving_app\apps\MunichLivingConfig\models.py

Re: Newbie question : running the makemigrations command in the terminal

2019-03-28 Thread kamibarut609
On Thursday, 28 March 2019 16:35:46 UTC+1, kamiba...@gmail.com wrote: > > Hello, > > (Newbie here): I am trying to run the makemigrations icommand in my > terminal. You will find here below the three relevant files, the third one > showing the errors displayed in > the terminal. > > My

Newbie question : running the makemigrations command in the terminal

2019-03-28 Thread kamibarut609
Hello, (Newbie here): I am trying to run the makemigrations icommand in my terminal. You will find here below the three relevant files, the third one showing the errors displayed in the terminal. My settings.py file: https://pastebin.com/raw/xLpX0Zfg My models.py file:

Re: Newbie question, start server with hostname

2017-02-08 Thread Dylan Reinhold
You don't include the http:// python manage.py runserver hostname:8000 or put the IP address in the hostname area/ Dylan On Wed, Feb 8, 2017 at 12:29 PM, hippohippo wrote: > Dear all, > > I am a new comer on Django. I was able to to run start server by command >

Newbie question, start server with hostname

2017-02-08 Thread hippohippo
Dear all, I am a new comer on Django. I was able to to run start server by command as below yesterday. python manage.py runserver http:/hostname:8000 However today, it submit the error as CommandError: "http://te172.24.221.137:8000/; is not a valid port number or address:port pair. Can

Re: Newbie question - data structure for game

2016-10-30 Thread Derek
You'll probably need jQuery. Bear in mind "size" is not absolute as it will depend on font family and font height. On Sunday, 30 October 2016 01:27:59 UTC+2, Ken Albright wrote: > > Sounds good. Thanks for the advice. Now if I could only figure out how to > get forms to expand and contract to

Re: Newbie question - data structure for game

2016-10-29 Thread Stephanie Statsmann
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 post to this group, send email to django-users@googlegroups.com.

Re: Newbie question - data structure for game

2016-10-29 Thread Ken Albright
Sounds good. Thanks for the advice. Now if I could only figure out how to get forms to expand and contract to match the size of the quote... Thanks. On Friday, October 28, 2016 at 5:00:14 PM UTC-7, Ken Albright wrote: > > I'm just learning Python and Django so please be gentle... > > I've

Re: Newbie question - data structure for game

2016-10-29 Thread Yaşar Arabacı
I am also quite new to django, but I will go with something like this; class Quote(models.Model): quote= models.CharField(max_length=100) class EncryptedQuote(models.Model) quote = models.ForeignKey(Quote, on_delete=models.CASCADE) encrypted_quote = models.CharField(max_length=100)

Re: Newbie question - data structure for game

2016-10-29 Thread Bob Gailer
On Oct 28, 2016 7:59 PM, "Ken Albright" wrote: > > I'm just learning Python and Django so please be gentle... > > I've written a quote decryption game (like you see in the newspaper) in Python. I'd like to put it on a web page with Django. However, I'm not sure of the best way

Newbie question - data structure for game

2016-10-28 Thread Ken Albright
I'm just learning Python and Django so please be gentle... I've written a quote decryption game (like you see in the newspaper) in Python. I'd like to put it on a web page with Django. However, I'm not sure of the best way to structure the data. The original quote and the encrypted quote need

Re: Newbie question regarding uninstalling Django system-wide.

2016-07-13 Thread Leo
Thanks Mike On Tuesday, July 12, 2016 at 8:03:18 PM UTC-4, Mike Dewhirst wrote: > > On 13/07/2016 1:55 AM, Leo wrote: > > I am learning how to use Django. With my first attempt I did not use a > > virtual environment instead installed Django system-wide. Now I have > > learned to utilize

Re: Newbie question regarding uninstalling Django system-wide.

2016-07-12 Thread Mike Dewhirst
On 13/07/2016 1:55 AM, Leo wrote: I am learning how to use Django. With my first attempt I did not use a virtual environment instead installed Django system-wide. Now I have learned to utilize virtual environments. Can you help me learn how to uninstall the system-wide Django instance? Also, I

Newbie question regarding uninstalling Django system-wide.

2016-07-12 Thread Leo
I am learning how to use Django. With my first attempt I did not use a virtual environment instead installed Django system-wide. Now I have learned to utilize virtual environments. Can you help me learn how to uninstall the system-wide Django instance? Also, I can't recall if I used pip or

Re: newbie question

2015-03-20 Thread Tom Lockhart
> The Python functions I wish to execute use numpy and other Python packages I > would like like to convert to JavaScript. As has been suggested, the tutorial is where you want to start. By the time you finish part 4 you will have a good idea how to bypass references to a data model and use

Re: newbie question

2015-03-20 Thread Vincent Davis
On Friday, March 20, 2015, john wrote: > Maybe another way to reply to your question is to break down how it would > work normally. > There are two sides of this question - the server side and the client side. > > In general client side stuff is done in javascript. >

Re: newbie question

2015-03-20 Thread john
Maybe another way to reply to your question is to break down how it would work normally. There are two sides of this question - the server side and the client side. In general client side stuff is done in javascript. Server side requests are done in python. So you have to decide where you want

Re: newbie question

2015-03-20 Thread VMD
On Friday, March 20, 2015 at 11:09:57 AM UTC-6, David Gleba wrote: > > > You don't actually need python or django to get form input and do > something with the input. > My function is not as simple as adding two numbers and for various reasons I am not interested in using Javascript. I just

Re: newbie question

2015-03-20 Thread john
I'm not aware that you can use javascript in views.py. In the Template - I believe you mean. Johnf On 03/20/2015 09:35 AM, David Gleba wrote: Also, I am not an expert in Django yet, but I think you can use html and javascript in views. -- You received this message because you are subscribed

Re: newbie question

2015-03-20 Thread David Gleba
I will try to answer your question here another way. I searched google for: form to add two numbers I see: http://stackoverflow.com/questions/14496531/adding-two-numbers-using-javascript This example uses an HTML form and javascript to perform the task on the input. You don't actually need

Re: newbie question

2015-03-20 Thread VMD
On Friday, March 20, 2015 at 9:58:23 AM UTC-6, David Gleba wrote: > > Does part 3 of the tutorial cover how to make a form, get the values > without storing them in a database, perform the arithmetic and then display > the result? I didn't see that in there. > I don't what to store them in a

Re: newbie question

2015-03-20 Thread David Gleba
Does part 3 of the tutorial cover how to make a form, get the values without storing them in a database, perform the arithmetic and then display the result? I didn't see that in there. On Thursday, March 19, 2015 at 11:58:14 AM UTC-4, Andrew Farrell wrote: > > The other commenters are right

Re: newbie question

2015-03-19 Thread Andrew Farrell
The other commenters are right that reading the tutorial is a good use of your time. https://docs.djangoproject.com/en/1.7/intro/tutorial03/ is the section relevant to your question. On Thu, Mar 19, 2015 at 10:39 AM, Javier Guerra Giraldez wrote: > On Wed, Mar 18, 2015 at

Re: newbie question

2015-03-19 Thread Javier Guerra Giraldez
On Wed, Mar 18, 2015 at 9:41 PM, VMD wrote: > I have skimmed the tutorial and didn't find (notice) the answer. Why not > point me to an answer to my question? that's exactly the point. your question assumes Django works in some specific way, and there should be a

Re: newbie question

2015-03-19 Thread VMD
On Wednesday, March 18, 2015 at 12:51:22 PM UTC-6, Avraham Serour wrote: > > short - use a view > > follow the tutorial, yes you will learn how to store and retrieve values > from a database, and I understand that you don't need that yet but the > tutorial is very brief, you won't waste your

Re: newbie question

2015-03-18 Thread Avraham Serour
short - use a view follow the tutorial, yes you will learn how to store and retrieve values from a database, and I understand that you don't need that yet but the tutorial is very brief, you won't waste your time with advanced topics you don't need On Wed, Mar 18, 2015 at 8:08 PM, VMD

newbie question

2015-03-18 Thread VMD
New to django and web frameworks in general. The tutorial is great for database type apps but I want to solve a different problem to start with and am kinda stuck. All I want to do is allow a user to input a value(s) and return the output of a python function using that value(s). Could someone

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Thank you Daniel, I didn't know this! I am going to lookup how to use session. Thanks! On Monday, 19 January 2015 17:13:10 UTC+8, Daniel Roseman wrote: > > On Monday, 19 January 2015 07:28:14 UTC, Cheng Guo wrote: >> >> Hello, >> >> I am new to Django and I have run into an issue with views.py.

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Hello James: Thank you very much for spending the time reading and answering this question, really appreciated! I complete understand your suggestion of overriding the "save" method in the "UploadFile" to generate the id before saving. Thank you for pointing this out. On the other hand, I

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Hello James: Thank you very much for spending the time reading and answering this question, really appreciated! I complete understand your suggestion of overriding the "save" method in the "UploadFile" to generate the id before saving. Thank you for pointing this out. On the other hand, I

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Daniel Roseman
On Monday, 19 January 2015 07:28:14 UTC, Cheng Guo wrote: > > Hello, > > I am new to Django and I have run into an issue with views.py. I > understand that there is a function behind each view. For a view that I am > currently writing, it accepts a file upload from user and stores the file >

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread James Schneider
I wouldn't decorate them as class methods. You would want to call them from the objects themselves. For the save_to_disk() method, I was actually referring to the Django save() method ( https://docs.djangoproject.com/en/1.7/topics/db/models/#overriding-predefined-model-methods ). As you have it

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
So in my case, I need to generate a unique id for the file and save it to disk. I have a model called UploadFile, so you recommend to add two class methods to the UploadFile model, like the following? class UploadFile(models.Model): @classmethod def generate_id(): pass

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread James Schneider
I second moving some (or most) of the functionality to models.py. For instance, calculating the SHA value should be done as part of the model's save() function, not done in the view. Convention dictates that the only code that is placed in the view itself should be logic related to prepping the

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, thanks! On Monday, 19 January 2015 15:46:40 UTC+8, Mike Dewhirst wrote: > > On 19/01/2015 6:28 PM, Cheng Guo wrote: > > Hello, > > > > I am new to Django and I have run into an issue with views.py. I > > understand that there is a function behind each view. For a view that I > > am

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, 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

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Daniel França
If the operations are model related, why don't move some of those functions to models.py. On Mon 19 Jan 2015 at 08:46 Mike Dewhirst wrote: > On 19/01/2015 6:28 PM, Cheng Guo wrote: > > Hello, > > > > I am new to Django and I have run into an issue with views.py. I > >

Re: Newbie question: How to avoid a very long view function?

2015-01-18 Thread Mike Dewhirst
On 19/01/2015 6:28 PM, Cheng Guo wrote: Hello, I am new to Django and I have run into an issue with views.py. I understand that there is a function behind each view. For a view that I am currently writing, it accepts a file upload from user and stores the file on the server. To do that, I need

Newbie question: How to avoid a very long view function?

2015-01-18 Thread Cheng Guo
Hello, I am new to Django and I have run into an issue with views.py. I understand that there is a function behind each view. For a view that I am currently writing, it accepts a file upload from user and stores the file on the server. To do that, I need to: 1. check the file extension is

Re: Template Not Applying - Django Polls Tutorial (Newbie Question)

2014-12-29 Thread Ken Wayne
That was it... On Friday, December 26, 2014 4:45:13 PM UTC-6, Collin Anderson wrote: > > Hi, > > This one comes up a lot. It's confusing because {% block title %} is the > _html_ , the title of the browser tab. > > You want to change {% block branding %}. > > Collin > > On Tuesday, December 23,

Re: Template Not Applying - Django Polls Tutorial (Newbie Question)

2014-12-26 Thread Collin Anderson
Hi, This one comes up a lot. It's confusing because {% block title %} is the _html_ , the title of the browser tab. You want to change {% block branding %}. Collin On Tuesday, December 23, 2014 5:18:49 PM UTC-6, Ken Wayne wrote: > > Hmmm, that is one of the directories I tried, >

Re: Template Not Applying - Django Polls Tutorial (Newbie Question)

2014-12-23 Thread Ken Wayne
Hmmm, that is one of the directories I tried, C:\Python34\Scripts\mysite\templates\admin with the file base_site.html On 12/23/2014 5:07 PM, Néstor wrote: You might need to make for admin mysite/templates/admin/base_site.html for regular html files for the polls only

Re: Template Not Applying - Django Polls Tutorial (Newbie Question)

2014-12-23 Thread Néstor
You might need to make for admin mysite/templates/admin/base_site.html for regular html files for the polls only mysite/polls/templates/polls/index.html That is how I got it to work. Good luck!!! :-) On Tue, Dec 23, 2014 at 2:13 PM, Ken Wayne wrote: > Windows 8 > Django

Template Not Applying - Django Polls Tutorial (Newbie Question)

2014-12-23 Thread Ken Wayne
Windows 8 Django 1.7.1 Python 3.4.2 Google Chrome Version 39.0.2171.95 m Bottom of part 2 of the the tutorial https://docs.djangoproject.com/en/1.7/intro/tutorial02/ it indicates how to customize the admin template but when I follow the directions it doesn't show any change in my browser.

Re: Newbie question on serving static files from apache

2014-11-15 Thread Daniel Roseman
On Saturday, 15 November 2014 03:13:37 UTC, pythonista wrote: > > I am using django 1.7 and apache. > > I do not understand the instructions on the django tutorial. > > The files were delivered as expected in debug mode and locally from the > django web server. > > > Can someone provide me with a

Newbie question on serving static files from apache

2014-11-14 Thread pythonista
I am using django 1.7 and apache. I do not understand the instructions on the django tutorial. The files were delivered as expected in debug mode and locally from the django web server. Can someone provide me with a simple example or link to a site. Thanks -- You received this message

Re: Newbie Question: Django Tutorial Part 4 - Exception Issue

2014-10-01 Thread Daniel Rus Morales
My pleasure ;) Enjoy coding! On 01 Oct 2014, at 22:04, zaiks0105 wrote: > Daniel, > > I appreciate your help. I got drifted away yesterday and got back to it > today. I found my mistake: a fricking typo. My polls/detail.html look for > 'error_message' while I spelt

Re: Newbie Question: Django Tutorial Part 4 - Exception Issue

2014-10-01 Thread zaiks0105
Daniel, I appreciate your help. I got drifted away yesterday and got back to it today. I found my mistake: a fricking typo. My polls/detail.html look for 'error_message' while I spelt 'error_messge' in my views.py. So the error msg was never shown though the page was redirected properly.

Re: Newbie Question: Django Tutorial Part 4 - Exception Issue

2014-09-29 Thread Daniel Rus Morales
No, that’s not the cause, the lack of it would be. That line shows the content of ‘error_message' when it does exist and has a value other than None. But if you have it in your template the error must be somewhere else in your code. Must be a simple syntax mistake you didn’t notice, either in

Re: Newbie Question: Django Tutorial Part 4 - Exception Issue

2014-09-29 Thread zaiks0105
I do. Is that line causing the behavior? On Monday, September 29, 2014 7:15:47 AM UTC-4, Daniel Rus Morales wrote: > > Hi Zaiks0105, > > Do you have the following line in "your polls/templates/polls/detail.html”? > > {% if error_message %}{{ error_message }}{% endif %} > > > On 29 Sep 2014, at

Re: Newbie Question: Django Tutorial Part 4 - Exception Issue

2014-09-29 Thread Daniel Rus Morales
Hi Zaiks0105, Do you have the following line in "your polls/templates/polls/detail.html”? {% if error_message %}{{ error_message }}{% endif %} On 29 Sep 2014, at 12:48, zaiks0105 wrote: > Hi, > > I am following Django official tutorial and have unanswered issue at part 4,

Newbie Question: Django Tutorial Part 4 - Exception Issue

2014-09-29 Thread zaiks0105
Hi, I am following Django official tutorial and have unanswered issue at part 4, https://docs.djangoproject.com/en/1.7/intro/tutorial04/. Here is the exception handling code, except (KeyError, Choice.DoesNotExist): # Redisplay the question voting form. return

Re: Newbie question about Django and Python versions.

2014-09-08 Thread Andrey Consalter
Thanks Russ, that clarifies a lot! Nice to see guys like you helping newcomers! -- You received this message because you 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: Newbie question about Django and Python versions.

2014-09-08 Thread Russell Keith-Magee
Hi Andrey, On Tue, Sep 9, 2014 at 4:30 AM, Andrey Consalter wrote: > Hi there, > > I've been studying programming with Python 2.7 and Django 1.6, and a few > days ago Django 1.7 was release and with it, the new tutorial that I had > just started. > What you guys would

Re: Newbie question about Django and Python versions.

2014-09-08 Thread Michael A. Martin
Is anyone else trying out 1.7? I do a jython manage.py runserver 8080 and then it seems to want to render but isn't. > On Sep 8, 2014, at 1:30 PM, Andrey Consalter wrote: > > Hi there, > > I've been studying programming with Python 2.7 and Django 1.6, and a few days >

Newbie question about Django and Python versions.

2014-09-08 Thread Andrey Consalter
Hi there, I've been studying programming with Python 2.7 and Django 1.6, and a few days ago Django 1.7 was release and with it, the new tutorial that I had just started. What you guys would recommend? Keep working with my current environment or update it? How this updates work? How "deep" are

How to simplify this code - newbie question

2014-06-30 Thread Michael Lind Hjulskov
Hi :o) I would like to simplify *get_rating* to fewer lines of code: class Product(AbstractProduct): ... just a little info about the model fields ... title = charfield parent = foreignkey(Product, related_name='variants') rating = a float def is_group - return True if it is

Re: Newbie question about django-cas

2014-02-19 Thread wasingej
The problem is fixed. Thanks esauro :) Jared -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group,

Re: Newbie question about django-cas

2014-02-19 Thread Esau Rodriguez
Hi there, you have to put the absolute url for CAS_SERVER_URL try CAS_SERVER_URL=http://login.oregonstate.edu-dev/login (or https) Regards, Esau Rodriguez. On Wed, Feb 19, 2014 at 6:04 PM, wasingej wrote: > Hello. > > I am trying to put together a little test

Re: Newbie question about django-cas

2014-02-19 Thread Tobias Ramos
try to set your login url to: http://127.0.0.1:8000/accounts/login while you testing. Tobias On 19 February 2014 15:04, wasingej wrote: > Hello. > > I am trying to put together a little test application which allows a user > to log in to a CAS server and then

Newbie question about django-cas

2014-02-19 Thread wasingej
Hello. I am trying to put together a little test application which allows a user to log in to a CAS server and then redirects them back to the site after they have logged in. I have followed the instructions on this page: https://bitbucket.org/cpcc/django-cas/overview. The URL for my

Re: Newbie Question - Where to store application constants?

2014-02-19 Thread Mark Phillips
Kirby, You have a good point. However, in this use case I am dealing with a jewelry store buying gold at their "market" rate. It is not the same as owning gold and the value changes based on a published (ie available through an API) rate. The jewelry store market rate for gold changes slowly, and

Re: Newbie Question - Where to store application constants?

2014-02-17 Thread C. Kirby
I would suggest that your example, the price of gold, isn't a constant. If you want to treat it as such then I agree with the above answers. However, you could also look around for APIs that publish commodities values and actually pull the real values in real (or semi real) time. -- You

Re: Newbie Question - Where to store application constants?

2014-02-15 Thread Camilo Torres
To round this, for the price of gold, and if you are using the django.contrib.admin interface, you can use Django Solo or similar singleton model. That way you can edit your "business properties" within the admin interface: https://pypi.python.org/pypi/django-solo On Friday, February 14, 2014

Re: Newbie Question - Where to store application constants?

2014-02-14 Thread Mark Phillips
Thanks! Very clear and helpful. Mark On Feb 14, 2014 9:54 AM, "Bill Freeman" wrote: > It depends on the complexity of the issue. > > The price of gold does fluctuate. On the grounds that I might want to > change it more often than I would want to ssh in, edit a file, and

Re: Newbie Question - Where to store application constants?

2014-02-14 Thread Bill Freeman
It depends on the complexity of the issue. The price of gold does fluctuate. On the grounds that I might want to change it more often than I would want to ssh in, edit a file, and restart, I would tend to put price of gold in the database, that is, in a model of which there may only be one

Newbie Question - Where to store application constants?

2014-02-14 Thread Mark Phillips
Where should one put application specific constants - those that change sometimes(1) and those that never change? For example, I am creating a simple inventory application for my mother's estate. Several quotes for her jewelry are based on the weight of the jewelry and the current price of gold.

Re: Newbie question: first project can't connect to MySQL

2013-08-09 Thread Robert
I got the same problem. I solved it just now. http://stackoverflow.com/questions/18150858/operationalerror-2002-cant-connect-to-local-mysql-server-through-socket-v On Thursday, February 5, 2009 1:41:21 AM UTC+8, Kevin Audleman wrote: > > Hello everyone, > > I am running through the tutorial and

Re: [newbie question] python manage syncdb doesn't create all the tables. Models has been splitted up.

2013-05-09 Thread crosa
I found the error. The application wasn't in the INSTALLED_APP in the settings file! On Thursday, May 9, 2013 2:13:19 PM UTC+2, Mike Dewhirst wrote: > > On 9/05/2013 10:04pm, crosa wrote: > > Hi guys, > > > > I'm testing django in order to build a little application. This > > application

Re: [newbie question] python manage syncdb doesn't create all the tables. Models has been splitted up.

2013-05-09 Thread Mike Dewhirst
On 9/05/2013 10:04pm, crosa wrote: Hi guys, I'm testing django in order to build a little application. This application will have several models, so I've decided to split up them, in order to do this more readable (Any other form to do this?) When I run python manage.py syncdb, the models

[newbie question] python manage syncdb doesn't create all the tables. Models has been splitted up.

2013-05-09 Thread crosa
Hi guys, I'm testing django in order to build a little application. This application will have several models, so I've decided to split up them, in order to do this more readable (Any other form to do this?) When I run python manage.py syncdb, the models tables have not been created, and I

Re: Newbie question: session-length data storage best practices?

2013-01-21 Thread Nikolas Stevenson-Molnar
Upon a second glance, it looks like the clearsession command will only have an effect as of Django 1.5. For <=1.4 if you're using the DB backend, you could always clear them out yourself with a query: now = datetime.datetime.now() Session.objects.filter(expire_date__lt=now).delete() _Nik On

Re: Newbie question: session-length data storage best practices?

2013-01-21 Thread Nikolas Stevenson-Molnar
Hi Spork, See this section of the sessions docs: https://docs.djangoproject.com/en/1.4/topics/http/sessions/#clearing-the-session-table While it mentions file and db backends specifically, I assume the cache backend would work similarly. I.e., you need to periodically run a cleanup of session

Re: Newbie question: session-length data storage best practices?

2013-01-21 Thread testbackupacct
Nik, My concerns are about security. I have some sensitive data associated with each user's session, and I'd like to make sure it is deleted when the user logs out or their session times out or closes their browser window. There's also some other clean up actions I'd like to do under the same

Re: Newbie question: session-length data storage best practices?

2013-01-19 Thread Nikolas Stevenson-Molnar
If I understand correctly, you just need to set SESSION_EXPIRE_AT_BROWSER_CLOSE = True in your settings: https://docs.djangoproject.com/en/1.4/topics/http/sessions/#browser-length-sessions-vs-persistent-sessions When the user closes their browser, the session ends. True, the associated data isn't

Re: Newbie question: session-length data storage best practices?

2013-01-19 Thread testbackupacct
Ok, you've made a very convincing argument. I really haven't spent much time thinking about scalability -- obviously it's time for me to do so! Thanks for taking the time to respond. Spork -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Newbie question: session-length data storage best practices?

2013-01-19 Thread Javier Guerra Giraldez
On Sat, Jan 19, 2013 at 3:03 PM, wrote: > If I'm reading the session docs correctly, if I add the data to the session > object, it'll get persisted, which I don't want. i think you _do_ want it to be persisted. remember that HTTP is a stateless protocol. to have it

Newbie question: session-length data storage best practices?

2013-01-19 Thread testbackupacct
Hi, I've got some data that I'll need read/write access to for the length of an authenticated session's lifetime. But once that browser tab is closed or the user logs out or the user session times out, I want that data to disappear. If I'm reading the session docs correctly, if I add the data

Re: Newbie question: first project can't connect to MySQL

2012-10-05 Thread Javier Guerra Giraldez
On Fri, Oct 5, 2012 at 3:02 PM, Kurtis Mullins wrote: > Also, if memory serves me correctly, MySQL may be setup to allow connections > from 127.0.0.1 but not Localhost AFAIK, there are at least three different ways to connect to a local server, each can be

Re: Newbie question: first project can't connect to MySQL

2012-10-05 Thread Kurtis Mullins
Also, if memory serves me correctly, MySQL may be setup to allow connections from 127.0.0.1 but not Localhost On Fri, Oct 5, 2012 at 2:45 PM, Mohamad Efazati wrote: > Hi afshin > localhost is kind of pointer to 127.0.0.1, maybe in /etc/hosts or other > thing you overwrite

Re: Newbie question: first project can't connect to MySQL

2012-10-05 Thread Mohamad Efazati
Hi afshin localhost is kind of pointer to 127.0.0.1, maybe in /etc/hosts or other thing you overwrite it. so 127.0.0.1 is source and always work. 2012/10/4 Afshin Mehrabani > Hey Kevin, > > Thanks for your correct reply, I had this problem also but after changing > host

Re: Newbie question: first project can't connect to MySQL

2012-10-04 Thread Afshin Mehrabani
Hey Kevin, Thanks for your correct reply, I had this problem also but after changing host from "localhost" to "127.0.0.1" problem solved, But why? what's the different between 'localhost' and '127.0.0.1'? On Wednesday, February 4, 2009 9:15:32 PM UTC+3:30, Kevin Audleman wrote: > > I found

Re: Newbie question - setting a model form foriegn key

2012-10-02 Thread Laxmikant Gurnalkar
Hi, I think yes, Otherwise database will raise an integrity error, like Foreign key violates the not null constraint. *--Laxmikant* *G.* On Tue, Oct 2, 2012 at 12:51 PM, Keir Lawson wrote: > Thanks for your reply :-) > > So there's no way to use a model form to

Re: Newbie question - setting a model form foriegn key

2012-10-02 Thread Keir Lawson
Thanks for your reply :-) So there's no way to use a model form to proccess the quest and manually set just the FK of it? Keir On Tuesday, October 2, 2012 6:18:21 AM UTC+1, Laxmikant Gurnalkar wrote: > > Sorry, see again!! > > def payments_view(request, contact_id): > payment = Payment() >

Re: Newbie question - setting a model form foriegn key

2012-10-01 Thread Laxmikant Gurnalkar
Sorry, see again!! def payments_view(request, contact_id): payment = Payment() contact = contact.objects.filter(id=contact_id) if contact: payment.contact = contact[0] payment.save() I dont think you are looking for this kind of thing : cheers On Tue, Oct 2, 2012

Re: Newbie question - setting a model form foriegn key

2012-10-01 Thread Laxmikant Gurnalkar
def payments_view(request, contact_id): payment = Payment() payment.contact = contact[0] rctx = RequestContext(request,{ > 'contact': contact, 'payments': payments, 'form' : PaymentForm() > }) > return render_to_response('CRMSite/contact_payments.html',rctx) > On

Newbie question - setting a model form foriegn key

2012-10-01 Thread Keir Lawson
Sorry if this is a dumb question, just picking up Django. I've set up a payments form, to create payments associated with a contact (see payments model) however I'm having trouble figuring out how to save the payment with the relevant contact associated, as the contact isnt selected as part of

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-28 Thread Pratik Mandrekar
Yes 0.0.0.0:8000 is correct. You would need to disable firewall for that port. In Ubuntu I used the Uncomplicated Firewall utility. You can try something like http://download.cnet.com/Windows-7-Firewall-Control/3000-10435_4-10618117.html for Windows 7 On Friday, July 27, 2012 6:42:18 PM

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Bill Freeman
The 0.0.0.0:8000 argument to runserver is the right way to do this. (Apparently 0:8000 us a legal shortcut.) But you may have a firewall on your machine which is not allowing access to port 8000. You will have to find someone (maybe you) with specific knowledge of firewall configuration on your

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Christopher Downard
Assuming both laptops are connected to the same local network (192.168.1.*) then it should be able to access the server. Are you getting a page not found or are you getting an error with the URLs? My server starts up just fine with python manage.py runserver 192.168.1.149:8020 (my lan's info).

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Miguel Lavalle
Thanks. It didn't work, though. In the development laptop I started the server with python manage.py runserver 192.168.1.116:8000 In the laptop where I am trying to access the app, I typed in the browser: 192.168.1.116:8000

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Christopher Downard
Try python manage.py runserver 192.168.1.116 where that address is your computer's address. On Jul 27, 2012 7:15 AM, "Miguel Lavalle" wrote: > Hi, > > I am new to Django. I am developing my first app on a Windows 7 laptop. I > want other people to be able to connect to this

Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Miguel Lavalle
Hi, I am new to Django. I am developing my first app on a Windows 7 laptop. I want other people to be able to connect to this app. As indicated in the documentation, I start the server with: python manage.py runserver 0.0.0.0:8000 And then I try to access my app from another laptop pointing

RE: Dumb newbie question

2012-02-17 Thread Bob Carlson
Of Tom Evans Sent: Friday, February 17, 2012 10:12 To: django-users@googlegroups.com Subject: Re: Dumb newbie question On Fri, Feb 17, 2012 at 4:15 PM, Babatunde Akinyanmi <tundeba...@gmail.com> wrote: > I'm also a noob. If I had code that would use the same models then I > would kee

Re: Dumb newbie question

2012-02-17 Thread Tom Evans
On Fri, Feb 17, 2012 at 4:15 PM, Babatunde Akinyanmi wrote: > I'm also a noob. If I had code that would use the same models then I > would keep everything inside one app but divide them into modules > I would say that is slightly sub optimal. There is nothing wrong with an

Re: Dumb newbie question

2012-02-17 Thread Babatunde Akinyanmi
I'm also a noob. If I had code that would use the same models then I would keep everything inside one app but divide them into modules On 2/17/12, Bob Carlson wrote: > I'm well into beginning building my actual app after going through the > tutorial, > but I have no feel yet

  1   2   3   4   5   >