Search Results

Search found 4109 results on 165 pages for 'django paypal'.

Page 74/165 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • Django: Get bound IP address inside settings.py

    - by Silver Light
    Hello! I want to enable debug (DEBUG = True) For my Django project only if it runs on localhost. How can I get user IP address inside settings.py? I would like something like this to work: #Debugging only on localhost if user_ip = '127.0.0.1': DEBUG = True else: DEBUG = False How do I put user IP address in user_ip variable inside settings.py file?

    Read the article

  • Setting custom SQL in django admin

    - by eugene y
    I'm trying to set up a proxy model in django admin. It will represent a subset of the original model. The code from models.py: class MyManager(models.Manager): def get_query_set(self): return super(MyManager, self).get_query_set().filter(some_column='value') class MyModel(OrigModel): objects = MyManager() class Meta: proxy = True Now instead of filter() I need to use a complex SELECT statement with JOINS. What's the proper way to inject it wholly to the custom manager?

    Read the article

  • django template find value within list

    - by dotty
    Hay, how do i find a value with in python list in django's template system? example list = [1,2,3,4,5,6,7] x = 1 if x is in list: return u'found!' else: return u'not found' endif: Something along those lines. any help would be great

    Read the article

  • Django site runs into "504 timeout error"

    - by jack
    I have a Django based site on Nginx+FastCGI which keeps running into "504 timeout error" after about 30 minutes since FastCGI process restarted. I did a "ps -aux" check and a lot of FastCGI processes are with D status. How can I figure out which part of the site make FastCGI processes not responsing?

    Read the article

  • Django: GROUP BY two values

    - by AP257
    I would basically like to do the same as this question, but grouping by combinations of two values, rather than just one: SELECT player_type, team, COUNT(*) FROM players GROUP BY player_type, team; Does anyone know whether, and how, this is possible in Django? I'm using 1.2.

    Read the article

  • How to access image folder in django

    - by anc1revv
    I just started django and i want to access images uploaded by a user. here is my model: class Food(models.Model): name = models.CharField(max_length=100) price = models.DecimalField(max_digits=4, decimal_places=2) quantity = models.IntegerField(blank=True, null=True) description = models.CharField(max_length=200) location = models.CharField(max_length=100) time = models.DateTimeField() photo_thumbnail = models.ImageField(upload_to="images") photo_fullsize = models.ImageField(upload_to="images") i stored the image in the "images" folder below the html is this: img src="{{steak.photo_thumbnail}}" and steak.photo_thumbnail = images/steak_and_egg_thumbnail_1.png here is the error i get: [06/Jul/2012 19:08:24] "GET /menu/ HTTP/1.1" 200 99 [06/Jul/2012 19:08:24] "GET /menu/images/steak_and_egg_thumbnail_1.png HTTP/1.1" 404 2127

    Read the article

  • Pagination of Date-Based Generic Views in Django

    - by Apreche
    I have a pretty simple question. I want to make some date-based generic views on a Django site, but I also want to paginate them. According to the documentation the object_list view has page and paginate_by arguments, but the archive_month view does not. What's the "right" way to do it?

    Read the article

  • Django: saving pickled object

    - by pistacchio
    Hi, i have a large dictionary I'd like to save. I have pickled it using cPickle.dumps and saved the result into a TextField. When trying to retrieve it (cPicle.loads) i get the following error: loads() argument 1 must be string, not unicode Does anybody have any experience in serializing python objects and storing them in a DB using Django? Thanks in advance.

    Read the article

  • Creating temporary user accounts - Django

    - by RadiantHex
    Hi folks, I need to setup temporary User models for each visitors, where the visitors are obviously tied by session data. I might not be aware of it, but does Django support attaching data to Anonymous users? The only way, I am currently aware of, is to use the session dictionary part of the request object. Help would be very much appreciated!

    Read the article

  • How to span multile tables in Django

    - by ipartola
    The Django documentation gives en example like so: b = Blog.objects.get(id=1) b.entry_set.all() Which from what I understand results in 2 queries. What if I wanted to get the blog, the blog entries and all the comments associated with that entry in a number of queries that does not depend on the number of entries? Or do I have to drop down to SQL to do that?

    Read the article

  • Django for web2py developers

    - by carrier
    Now that I've gotten relatively familiar with web2py, I'd like to give Django a go. What are the main differences? What would be the most efficient way to get started taking into account web2py knowledge? (It must help to have some python application framework knowledge,no?) EDIT Also, if you've used both, can you offer an opinion on which you prefer and why?

    Read the article

  • Run a shell command from Django

    - by Badifunky
    Hello, I'm developing a web page in Django (using apache server) that needs to call a shell command to enable/dissable some daemons. I'm try to do it with os.system(service httpd restart 1>$HOME/out 2>$HOME/error) and this command doesn't return anything. Any idea how can i fix this?

    Read the article

  • paypal API in VB.net

    - by StealthRT
    Hey all, i have converted some C# PayPal API Code over to VB.net. I have added that code to a class within my project but i can not seem to access it: Imports System Imports com.paypal.sdk.services Imports com.paypal.sdk.profiles Imports com.paypal.sdk.util Namespace GenerateCodeNVP Public Class GetTransactionDetails Public Sub New() End Sub Public Function GetTransactionDetailsCode(ByVal transactionID As String) As String Dim caller As New NVPCallerServices() Dim profile As IAPIProfile = ProfileFactory.createSignatureAPIProfile() profile.APIUsername = "xxx" profile.APIPassword = "xxx" profile.APISignature = "xxx" profile.Environment = "sandbox" caller.APIProfile = profile Dim encoder As New NVPCodec() encoder("VERSION") = "51.0" encoder("METHOD") = "GetTransactionDetails" encoder("TRANSACTIONID") = transactionID Dim pStrrequestforNvp As String = encoder.Encode() Dim pStresponsenvp As String = caller.[Call](pStrrequestforNvp) Dim decoder As New NVPCodec() decoder.Decode(pStresponsenvp) Return decoder("ACK") End Function End Class End Namespace I am using this to access that class: Private Sub cmdGetTransDetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetTransDetail.Click Dim thereturn As String thereturn =GetTransactionDetailsCode("test51322") End Sub But it keeps telling me: Error 2 Name 'GetTransactionDetailsCode' is not declared. I'm new at calling classes in VB.net so any help would be great! :o) David

    Read the article

  • onmouseover problems with JavaScript (rendered using django and django-imagekit)

    - by Michael Moreno
    I'm using Imagekit. View.py includes: def pics(request): p = Photo.objects.all() return render_to_response('Shots.html', {'p': p}) The following simple code in the template will generate associated images: {% for p in p %} <img src = "{{ p.display.url }}"> <img src = "{{ p.thumbnail_image.url }}"> {% endfor %} I'm attempting to generate a series of thumbnails {{ p.thumbnail_image.url }} which, when mouseover'd, will generate the slightly larger version of the image, {{ p.display.url }} via Javascript. The following code in the template attempts to do so: <html> <head> <HEAD> <script language="Javascript"> { image1 = new Image image2 = new Image image1.src = {{ p.thumbnail_image.url }} image2.src = {{ p.display.url }} </script> </head> <body> {% for p in p %} <a href="" onMouseOver="document.rollover.src= image2.src onMouseOut="document.rollover.src= image1.src"> <img src="{{ p.thumbnail_image.url }}" border=0 name="rollover"></a> {% endfor %} </body> </html> This will display the series of thumbnails, but the larger image will not display when mouseover'd. I believe it has to do with how I'm specifying the variable {{ p.display.url }}.

    Read the article

  • Security considerations for my first eStore.

    - by Rohit
    I have a website through which I am going to sell few products. It is hosted on a simple shared-hosting and does not have SSL. On the products page, each product has a Buy Now button created from my PayPal Merchant account. PayPal recommends to use it's Button Factory to create secure buttons and save it inside PayPal itself. I have followed the same advice and the code of any button is secure and does not disclose any information on either a product or it's price. When the user clicks on a Buy Now button, he/she is taken to PayPal site where a page is opened in SSL for the user to fill in the credit card and shipping details. After a successful transaction, the control is passed back to my site. I want to know whether there is still any chance when security could be compromised.

    Read the article

  • Auto Submitting a form (cURL)

    - by cast01
    Im writing a form to post data off to paypal, and this works fine, i create the form with hidden fields and then have a submit button that submits everything to paypal. However, when the user clicks that button, there is more that i want to do, for example change their cart status in the database. So, i want to be able to execute some code when they click submit and then post the data to paypal. I dont want to use javascript for this. My method at the moment is using cURL, the form posts back to the current page, i then check for $_POST data, do my other commands like updating the status of the cart, and then create a curl command, and post the form data to paypal. Now, it gets posted successfully, but the browser doesnt go off to paypal. At first i was just retirieving the result in a string and then echoing it out and i could see that the post was successful, then i set CURLOPT_FOLLOWLOCATION to 1 assuming this would let the browser go off to paypal but it doesnt, what it seems to do is grab some stuff from paypal and put it on my page. Is using cURL the right thing for this? and if so, how do i get round this problem? I want to stay away from javascript for this as only users with javascript enabled would have their cart updated. The code im using for curl is below, the post_data is an array i created and then read key-value pairs into post_string. //Set cURL Options curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, false); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl_connection, CURLOPT_MAXREDIRS, 20); //Set Data to be Posted curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string); //Execute Request curl_exec($curl_connection);

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >