Web platform for sharing free data for ML and research

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Add URL to API response

roundabout,
created on Friday, 6 September 2024, 17:28:31 (1725643711), received on Friday, 6 September 2024, 19:35:57 (1725651357)
Author identity: vlad <vlad.muntoiu@gmail.com>

37e6eb50def2eb0cf7e1adaa9cc29c70d862c6ff

app.py

@@ -625,6 +625,7 @@ def query_pictures():

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        "replaces": resource.replaces_id,
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        "replaced_by": resource.replaced_by_id,
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        "regions": [],
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    "download": config.ROOT_URL + flask.url_for("raw_picture", id=resource.id),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    for region in resource.regions:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        json_resource["regions"].append({
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

config.py

@@ -6,3 +6,4 @@ dotenv.load_dotenv("secrets.env")

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            DB_PASSWORD = environ["DB_PASSWORD"]
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            DB_URI = f"postgresql://gigadata:{DB_PASSWORD}@localhost:5432/gigadata"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            DATA_PATH = "./data"
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        ROOT_URL = "http://localhost:8080"